Last couple of weeks have been a great learning experience. I needed a “Case-sensitive Journaled HFS+” file system on my machine. By default Macintosh supports Case-insensitive file system. The normal way of partitioning the drives would be to use Disk Utility application but fortunately it displayed Mac OS extended(case-insensitive, Journalated) as an option for partition format and not HFS+. I didn’t realize that HFS+ is also called Mac OS extended. So I decided to use the terminal for creating a new partition. I will take you guys through the process of creating new partition from Terminal.
Type “diskutil listFilesystems” command on the terminal, you get the list of file system supported by your Macintosh. You can refer the image displayed below.
(Once I went through the entire list, I realized that HFS+ is also called Mac OS extended. Since I had come this far, I decided to go ahead and create a case-insensitive hfs+ partition from terminal. Another reason being I was hopelessly stuck in the task I was working on, I thought this might help change the state of my mind)
Back to the discussion on hand.
Before making any partitions lets check the file system once, because we need few information regarding the partitions currently available on the machine. Type ‘diskutil list‘ on terminal and press enter. You will get information like identifier, size and partition format type, which will come in handy in next stage.
Refer the image below for details.
Now lets create a new partition. The command for creating partition is
diskutil resizeVolume IDENTIFIER NEW_SIZE PERSONALITY NEW_DRIVE_NAME NEW_DRIVE_SIZE
I know it looks very complex. So I will give an example
Please refer to image 1 and 2 for details regarding the values used.
diskutil resizeVolume disk0s3 10.3G jhfsx Testing 10G
disk0s3 is the Identifier of the partition (refer Image 2)
10.3G would be the new size of the partition disk0s3
jhfsx means Case-sensitive Journaled HFS+ (refer Image 1)
Testing name of the new partition
10G size of the new partition
Another thing I realized is that creating partition from terminal takes almost half the time required to create partition using Disk Utility.
The different options available for format(Personality) are shown in Image 1.
Before using this technique to resize/create the partitions on your drive, make sure you’ve backed up everything. It’s all too easy to make a typo, and you can’t undo the command line!
Feel free to drop in your comments.