diskutil(8) BSD System Manager's Manual diskutil(8)
NAME
diskutil -- Modify, verify and repair local disks.
SYNOPSIS
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
Verify the permissions of a Mac OS X boot volume.
repairPermissions device
Repair the permissions of a Mac OS X boot volume. Ownership
of the affected disk is required.
repairOS9Permissions
Repair the permissions of the user selected Classic System and
Applications folder.
eraseDisk format name [OS9Drivers APMFormat MBRFormat GPTFormat]
device
Erase an existing disk, removing all volumes. Format dis-
cussed below. Ownership of the affected disk is required.
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]
...
(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 mirrorstripe setName format device device ...
Create a RAID set on multiple disks or volumes. Ownership of
the affected disks is required.
destroyRAID device
Destroy an existing RAID set. Ownership of the affected disks
is required.
checkRAID listRAID
Print out the list of available RAID sets.
enableRAID mirrorconcat device
Convert single filesystem disk or volume into a unpaired mir-
ror RAID set or concat set. Ownership of the affected disk is
required.
convertRAID device
Convert a 1.x RAID (built on Panther or earlier) into a 2.x
RAID (Tiger). Ownership of the affected disks is required.
repairirror 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 keyvalue 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 oldDiskoldUID raidDisk
Remove a slice or spare from an existing RAID set. oldDisk
and raidDisk are only Device Nodes or Disk Identifiers. A
UID 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/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
DEVICES
A device parameter to any of the above commands (except where explicitly
defined otherwise) is any of the following
The device node entry. Any entry of the form of /dev/disk*. ex.
/dev/disk2
The disk identifier. Any entry of the form of disk*. ex. disk1s9
The volume mount point. Any entry of the form of /Volumes/Mountpoint.
ex. /Volumes/Untitled
SEE ALSO
authopen(1), hdid(8), hdiutil(1), ufs.util(8), msdos.util(8),
hfs.util(8), drutil(1), diskarbitrationd(8.)
Mac OS 18 May 2006 Mac OS
|