Using the same command, we partition a hard disk with multiple partitions and formatting them as useable volumes. So the command to run will repartition a hard disk identified as disk2 with GUID Partition Table containing a single volume called New that spans the entire disk. Specifying 0b tells the command to just use all available free space. 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. 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. 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.
0 Comments
Leave a Reply. |