diskutil verb [options]
DESCRIPTION
diskutil uses the Disk Management framework to manipulate local disks.
VERBS
Each verb is listed with its description and individual arguments.
list [device]
List the partitions of a disk or all disks. If no device is
listed, than all partitions on all disks will be displayed.
info | information device
Get information on a disk or volume.
unmount [force] device
Unmount a single volume. Force will force unmount the vol-
ume.
unmountDisk [force] device
Unmount an entire disk (all volumes). Force will force
unmount the volumes.
eject device
Eject a disk.
mount device
Mount a single volume.
mountDisk device
Mount an entire disk (all mountable volumes).
rename device name
Rename a volume.
enableJournal device
Enable HFS+ journaling on a mounted HFS+ volume. Ownership of
the affected disk is required.
disableJournal device
Disable HFS+ journaling on a mounted HFS+ volume. Ownership
of the affected disk is required.
verifyVolume device
Verify the disk structure of a volume. Ownership of the
affected disk is required.
repairvolume device
Repair the structure of a volume. Ownership of the affected
disk is required.
verifyPermissions device
eraseVolume format name device
Erase an existing volume. Format discussed below. Ownership
of the affected disk is required.
reformat device
Reformat an existing device in the same name and format. Own-
ership of the affected disk is required.
eraseOptical [quick] device
Erase an optical media (CD/RW, DVD/RW, etc.). Quick specifies
whether the disc recording stack should do a full erase or a
quick erase. Ownership of the affected disk is required.
zeroDisk device
Erase a disk, writing zeros to the media. Ownership of the
affected disk is required.
randomDisk [times] device
Erase a disk, writing random data to the media. Times is num-
ber of times to write random information. Ownership of the
affected disk is required.
secureErase [freespace] level device
Securely erase a disk or freespace on a mounted volume. Level
should be one of the following
1 - Single pass randomly erase the disk.
2 - US DoD 7 pass secure erase.
3 - Gutmann algorithm 35 pass secure erase. Ownership
of the affected disk is required.
partitionDisk device numberOfPartitions [OS9Drivers | APMFormat |
MBRFormat | GPTFormat] <part1Format part1Name part1Size>
<part2Format part2Name part2Size> <part3Format part3Name
part3Size> ...
(re)Partition a disk, removing all volumes. All volumes on
this disk will be destroyed. Format is the specific filesys-
tem name you want to erase it as (HFS+, etc.). OS9Drivers
specifies that an Apple Partition Map should be used, and laid
out in a manner compatible with Mac OS 9. APMFormat specifies
that an Apple Partition Map should be used. MBRFormat speci-
fies that the partition map should be written in DOS compati-
ble format. GPTFormat specifies GUID Partitioning Scheme.
Valid sizes are B(ytes), K(ilobytes), M(egabytes), G(iga-
bytes), T(erabytes) Example: 10G (10 gigabytes), 4.23T (4.23
terabytes), 5M (5 megabytes) You cannot partition the boot
disk. Ownership of the affected disk is required.
createRAID mirror|stripe setName format device device ...
Create a RAID set on multiple disks or volumes. Ownership of
the affected disks is required.
RAID (Tiger). Ownership of the affected disks is required.
repairMirror raidDisk newDisk
Repair a failed mirror. Supply the existing RAID as the raid-
Disk parameter. Supply the new disk as the last parameter of
the request. newDisk and raidDisk are only Device Nodes or
Disk Identifiers. Ownership of the affected disk is required.
updateRAID key value raidDisk
Update the key|value parameters of an existing RAID set. Own-
ership of the affected disk is required.
addToRAID type newDisk raidDisk
Add a slice or spare to an existing RAID set. Type is one of
'member' or 'spare'. newDisk and raidDisk are only Device
Nodes or Disk Identifiers. Ownership of the affected disk is
required.
removeFromRAID oldDisk|oldUUID raidDisk
Remove a slice or spare from an existing RAID set. oldDisk
and raidDisk are only Device Nodes or Disk Identifiers. A
UUID of the oldDisk (see diskutil checkRAID) may be specified
instead; this is useful if the oldDisk is offline or no longer
exists. Ownership of the affected disk is required.
FORMAT
The format parameter of erase and partitioning (and RAID creation) is the
filesystems name. You can determine this name by looking in the /Sys-
tem/Library/Filesystems/<fs>.fs/Contents/Info.plist.
Some examples include HFS+, HFS, JournaledHFS+, UFS, MS-DOS, etc.
EXAMPLES
Erase a disk
diskutil eraseDisk UFS UntitledUFS disk3
Erase a volume
diskutil eraseVolume HFS+ UntitledHFS /Volumes/SomeDisk
Partition a disk
diskutil partitionDisk disk3 3 HFS+ Untitled 10G UFS UntitledUFS 10G MS-
DOS DOS 10G
Create a RAID
diskutil createRAID mirror MirrorDisk HFS+ disk disk2
Destroy a RAID
diskutil destroyRAID /dev/disk3
Repair a damaged RAID
diskutil repairMirror disk2 disk3
Man(1) output converted with
man2html
|