?

Log in

No account? Create an account
An update 33 months in the making - Baxil [bakh-HEEL'], n. My Sites [Tomorrowlands] [The TTU Wiki] [Photos]
View My LJ [By Tag]


December 9th, 2006
03:32 pm
[User Picture]

[Link]

Previous Entry Share Next Entry
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.

However!

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.

Current Location: ~/computer_desk
Current Mood: jubilantjubilant
Current Music: Fuel, "Shimmer"
Tags: ,

(5 comments | Leave a comment)

Comments
 
[User Picture]
From:krasnayath
Date:December 10th, 2006 03:45 am (UTC)
(Link)
*grins* You do realize that the beginning of the disc is on the inner tracks, not the outer ones, right?
[User Picture]
From:baxil
Date:December 10th, 2006 09:20 am (UTC)
(Link)
That wasn't what I understood to be the case. Of course, now that I'm doing more research, it looks like it depends on who you ask. :P Some sources say lower-numbered tracks are on the inside of the disk; some sources say data is written to the outside of the disk first.

My understanding was that hard drives generally are numbered outside-in, and floppy disks/CDs are numbered inside-out. (Hence a partially filled CDR will change color at the center.) If you or anyone has a solid and unambiguous source on this, I'd love to find out more.
[User Picture]
From:natetg
Date:December 10th, 2006 06:30 pm (UTC)

SEP

(Link)
You're not supposed to worry about that sort of thing anymore.
[User Picture]
From:roaminrob
Date:December 11th, 2006 02:27 am (UTC)
(Link)
The only thing I might be able to add here is that the "bad sectors" and partition map tracks are (for sure) located on the innermost track of a hard drive.

I know this because I attempted -- not that long ago -- to rescue data off of a drive that had been a victim of a head crash. The head crashed close to the spindle; I had thought that would be good news for the data recovery. However, after I had successfully completed the black magic platter transplant, I still couldn't read data off the drive. Further investigation revealed that without very special equipment, damage close to the spindle makes it impossible to retrieve data from a drive.

That still doesn't say for certain where a drive starts writing user data though.
[User Picture]
From:kadyg
Date:December 11th, 2006 03:29 am (UTC)

*ahem*

(Link)
In the case of this particular hard drive I went to Best Buy. Please give credit where due. ;-}
Tomorrowlands Powered by LiveJournal.com