Baxil (baxil) wrote,

An update 33 months in the making

I'm getting a remarkable sense of deja vu here, so I'm going to give in and copy and paste, correcting where appropriate:

Just bought Last month, I bought myself my first new piece of computer hardware in a while: A brand new external hard drive. Went to Fry's Best Buy and picked it up piecemeal; an $80 case and (after rebate) a $110 Hitachi drive grabbed one of their Seagate external USB drives on sale for $80. Two hundred One hundred sixty gigabytes. ...

Incidentally, Mac OSX's Disk Utility is the most moronic piece of shit ever. Oh, wait, excuse me, that's not being quite fair. It is, in fact, a MORONIC PIECE OF SHIT.

I didn't have time to set up my new toy last month, what with BaMoTtuStoTTwo and all, but now I'm trying to get it set up ... and remembering how inexplicably shitty Apple's partitioning tools are. Naturally, it's been long enough that I don't recall what workaround I found to make my old partitions.

Of course, it has been over two years. Maybe the software has gotten better? ... Um, no. Or maybe someone else has had this same problem and posted about it on the Internets? ... Not really; all of the Mac users who are partitioning drives are trying to do something exotic like mix Windows/Unix/Mac drives on a single disk.


Happily, I can report that there is a very simple trick that removes all of the frustration from basic Macintosh drive partitioning. It took me an hour of Web research, but I finally broke through into the light halfway down a long thread at macosxhints. (Search the page for 'moritzh'. Thank you, Moritz. Thank you lots and lots. :D)

It doesn't involve fdisk (which doesn't fully support the Mac partitioning scheme). It doesn't involve pdisk (which does, but is a piece of crap). It doesn't even involve downloading anything. Glorious, elegant simplicity, and right there on your computer:

Disk Utility has a command-line equivalent.

Go to your Applications folder, go into the Utilities folder, and open up a Terminal window (or, if you're a inveterate geek like me, open it from the dock). It's called diskutil and even gives you helpful instructions if you type its name by itself on the commandline. (There's always man diskutil, too, but the inline instructions are all you need.)

I'm cribbing one of moritzh's tips here, in case the macosxhints thread disappears: The first thing you want to do is find out the number of the disk you want to partition. (Make sure you don't have any data on it you care about! As with all partitioning schemes, this will format the drive.) You can do this by typing ls /dev/rdisk? into the terminal with the drive unplugged, and then again with the drive plugged in, and seeing what the number is of the new drive that pops up.

My next advice is to get the exact size of the disk: diskutil info /dev/diskXXX. Replace the X's with the number you just learned; so in my case it was /dev/disk1. (This also has the benefit that you can verify you're about to partition the right drive!) Write down the "Total Size" line. Figure out how many partitions you want to split this into, and how big you want them to be. Double-check your math; you don't want to partition beyond the size of the drive.

Then, it's just a matter of giving it the partition command with all the right options. Typing diskutil partitionDisk tells you how to write these out; it's fairly straightforward. You give it a few set options and then list the partitions you want to create, along with their formats and sizes. In my case, the complete command I wrote was:

diskutil partitionDisk /dev/disk1 4 OS9Drivers HFS+ Scratch 3.1G HFS+ BaxMedia 123G HFS+ BaxApps 8G HFS+ BaxDocs 15G

Voila! Two minutes of typing and a few more of waiting. I wish I'd been able to find out about this in 2004.

Incidentally, one of the reasons I want to partition my drive is that different types of data do better on different physical disk positions. As you move from the front of the disk to the back, you move from the edge of the platter to its center. So having a "scratch" partition first for heavily accessed space (such as temporary Photoshop files, or virtual memory) will give you better access speed (a single rotation of the drive platter passes more data under the read head). Putting large media files in the outer portions of the disk, again, gives you better access speed. Whereas your documents should be placed near the end, near the center of the drive; in case of catastrophic disk failure (a head crash or dropping it on the ground), you'll have better chances of retrieving the important things.
Tags: geekery, mac osx partitioning
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded