![mac os disk utility command line format mac os disk utility command line format](https://www.lifewire.com/thmb/1DJFMgvpc7-T9dAmNt9wVhnbIz4=/857x643/smart/filters:no_upscale()/format-mac-drive-using-disk-utility-os-x-el-capitan-later-2260751-befc233e5020482f8dbbd2886cf59e0b.jpg)
Specifying 0b tells the command to just use all available free space.
![mac os disk utility command line format mac os disk utility command line format](https://itgirl.tech/wp-content/uploads/2019/08/FormatpendrivemacOSterminal.jpg)
You can specify any size you wish, up to the maximum size of the free space available, using b (bytes), m (megabytes), g (gigabytes) and so-on. This represents the size of the partition to create. Partition SizeĪt the end of the command is the argument 0b. Intel Macs can only boot from GUID partitions.
![mac os disk utility command line format mac os disk utility command line format](https://www.howtogeek.com/wp-content/uploads/2014/08/diskpart-list-disk-command.png)
Unless you intend to boot a PowerPC-based Mac or Windows PC with your hard disk, there's no reason to select anything other than GPT. GPT is an option for the Partition Scheme. You'll also recognise JHFS+ as the filesystem, followed by the label to give the newly-created volume. The first three parts of the command are self explanatory, there's the actual diskutil command followed by the option partitionDisk and the disk's identifier /dev/disk(n). To partition a disk, we use: diskutil partitionDisk /dev/disk2 GPT JHFS+ New 0b This level of automation is simply not possible with Disk Utility, demonstrating how the command-line can be more useful. To automate the process and guarantee that each drive created was exactly the same, a shell script would automatically split a drive into the desired number of partitions then restore various versions of OS X and diagnostic software automatically. We'd usually need at least 5-10 of these drives at any one time and they all had to be identical, so every month each drive would be reset. Real World Usageīack in my days on the Genius Bar, we would use the command-line to create external diagnostic drives that contained multiple volumes.
#Mac os disk utility command line format how to#
Next, we'll see how we can perform disk partitioning as well as how to split, merge and erase ones created. In the first part of this series, we explored the basics of disk and partition management via the command-line.