diskutil
into the command line and press Enter, you’ll receive a list of “verbs” that diskutil
can operate on.diskutil
can accomplish. The most basic verb for diskutil
is list
, which you’ll enter like so:/dev/disk
and are used to specify disk operations in diskutil.
Partitions (called “volumes” in diskutil
parlance) are specified by their identifier on the right.diskutil
umount
verb unmounts a specified volume. Unmounting is just like ejecting a volume from Finder, but it can be done to internal disks. In this example, I’ve specified the volume I want to unmount with the disk identifier. You can also specify the volume using the partition name. Unmounted disks become inaccessible via Finder, but they can still be seen via diskutil list
and manipulated with other diskutil
commands. Also, note the command is umount
, with no “n”.unmountDisk
verb is similar to umount
, but it unmounts an entire disk instead of one volume. Disks are specified with their mount point, as seen above. You can’t unmount your boot disk or volume, and you’ll get an error if you try to unmount a disk or drive that’s currently in use.eject
verb is a lot like unmounting a drive, but only for removable disks. Removable disks are things like USB hard drives and flash drives. If it connects through an interface on the outside of your computer, it qualifies as a removable drive. Once a drive is ejected, it won’t appear in Finder or diskutil list
until it’s physically unplugged and plugged in to its interface again.mount
verb is the inverse of the umount verb. It mounts volumes on internal disks manually. Only unmounted volumes can be mounted, obviously. To mount all volumes on a disk, use diskutil mountDisk disk1
, for example.diskutil
verifyVolume
verb will run a verification pass on a specific volume. Verification involves checking the contents of the disk against the expected values. If any mismatches are found, the disk will be identified as in need of repair.diskutil
reformat
verb will erase a single volume on the disk while keeping the same name and format. It rewrites the same file system that the volume started with, resetting the volume to a blank state.diskutil
diskutil partitionDisk MountPoint[numberOfPartitions] [APM|MBR|GPT] [part1Format part1Name part1Size part2Format part2Name part2Sizepart3Format part3Name part3Size ...]
partionDisk
isn’t the easiest way to partition a disk, but if Disk Utility is complaining, its a good alternative.