Upon returning home from a short trip yesterday, I discovered that my desktop G5 had, during my absence, developed a problem—I was unable to copy some images from my digital camera into my iPhoto Library. Instead of success, I was greeted with the not-so-pleasant message that iPhoto “couldn’t create” the image on the disk. After a bit of troubleshooting, I determined that I had a hard drive problem, not an iPhoto problem. In short, the drive where my iPhoto Library resides was no longer writable. I could read files from it, but any attempts to write to it failed—either via iPhoto or the Finder. Disk Utility didn’t show any errors on the drive, and even a directory rebuild with Disk Warrior didn’t fix the problem.
At this point, I had no option but to zero the drive (using Disk Utility) and restore my files from the backup I made just before I left on my trip. With that done, the drive was again happy and healthy. But this article isn’t really about the problem itself, but rather, why it was only a minor problem and not a major problem (besides the fact that I had a current backup, of course).
My dead drive was only a minor problem because, well, to be honest, it wasn’t a drive that died at all. It was, in fact, a partition on a drive. For those who aren’t familiar, a partition is nothing more than one smaller piece of a larger hard drive. Though this is oversimplifying things a bit, to the operating system there’s no difference between a hard drive and one partition of a hard drive—both appear as distinct mountable volumes to the system.
And since a partition looks and acts like a hard drive, when you have an issue with a partition, the problem is usually restricted to that one partition—the remainder of the partitions on that disk will be fine. This isn’t true in all situations, of course. If you have a catastrophic failure of the drive (the power unit fails, the read/write heads stop moving, etc.), then partitioning isn’t going to help at all. But for most minor drive problems, only the affected partition will have difficulties. In my case, even though the iPhoto partition was completely thrashed, I could read and write to the other partitions on the disk without any troubles at all. You can see how OS X treats partitions by taking a look at one of my Finder windows:
As you can see, OS X thinks I have nine distinct hard drives attached. But by using Disk Utility, you can see that I’ve really just got two drives on my system, with a total of nine partitions across those two drives:
Disk Utility shows the true relationship between each partition and the real drive it’s associated with.
Had this problem happened to a non-partitioned drive, there’s a good chance I would have spent many hours rebuilding my entire system—I probably wouldn’t have even been able to boot the machine, since OS X is almost always modifying cached files. I would have been forced to boot from a FireWire drive, zero the entire damaged disk, and then restore a complete install, including OS X, all my personal files, application preferences, etc. But thanks to partitioning, I had a very easy restoration of one non-bootable partition.
Pros and Cons of Partitioning
In addition to isolating problems to one partition, there are some other upsides to partitioning:
- It’s a good way to run more than one version of the OS. In my case, I keep two partitions available for testing— oldsystem holds the next-to-current OS X release, and xperimental , which holds beta versions of OS X that I’m testing.
- It can enforce good data storage practices. Since partitions are fixed in size, you can’t just pile everything into one of them without any thought for how much space you’re using up.
- It can help organization. Instead of having a number of folders inside my user’s Documents folder (or elsewhere), I use partitions to separate major types of data. As seen in the above Finder screenshot, in addition to my test partitions, I have partitions for music, video, applications (those that don’t have to live in /Applications), a couple of storage partitions for personal files, and a scratch (temporary) partition for Final Cut Express and DVD Studio Pro projects. And oh yea, the actual boot partition, of course (named xtatic ).
- If you have a rogue program that’s writing data constantly to your drive (without your knowledge), partitions will prevent that program from filling your entire hard drive; the program will encounter an error when it fills the volume it’s writing to.
- Partitions can allow completely different operating systems to live on the same machine. If, for instance, you want to try out PowerPC Linux, you would do so by first creating a partition for it to live on.
- You can separate the system from your data. In my case, I try to keep my xtatic partition to strictly system-related files, along with Apple’s applications and any third-party applications that insist on residing in the /Applications folder. In the unlikely event of a major OS X issue, this makes the restore process much simpler—I don’t have 50gb of data to restore, just the OS and some key applications.
But partitioning isn’t all goodness; there are some downsides as well:
- Partitions are fixed in size. So is your hard drive, of course, but partitions make size limitations more obvious, as you have to choose a size for each partition at creation time. Should your 300GB drive become five 60GB partitions? Or one 150GB and two 75GB partitions? Once set, there’s no Apple-provided solution to change the size of the partition without losing any data on that partition. However, the third-party programs iPartition (Coriolis Systems, $44.95) and VolumeWorks (SubRosaSoft, $59.95) will let you do just that. I don’t have any direct experience with VolumeWorks, but I did choose iPartition as a Pick of the Week on macosxhints.com back in 2004.
- Partitions make data management more complex. Instead of having everything in one spot, you have to think about which drive something might be stored on, or which drive you might want to store something on.
- It seems to me that Spotlight (in OS X 10.4 ) is much slower on my machine than on my buddy’s non-partitioned G5. We haven’t done any empirical testing, so this is just a feeling at this point, of course. Perhaps it’s related to Spotlight having to deal with a number of separate indexes on a partitioned system, instead of one large index file on a non-partitioned system.
For me, the upside of not losing an entire hard drive due to a small problem with one portion of the drive makes the hassle of partitioning well worth the downsides. I saved quite a bit of time in this latest incident, and I really enjoy the structure that comes from separating my system files from the various sorts of data files.
How to Partition
Apple’s Disk Utility provides the easiest way to partition your disks—just launch it, choose the drive you wish to partition in the left-hand column, and click on the Partition tab. You can use the Volume Scheme pop-up menu to pick a partition setup, or you can create your own.
Very Important Warning
Partitioning your drive will cause all of the data on it to be erased! If you are considering partitioning, please make certain that you’ve got a current backup, and that you are capable of restoring from that backup! Failure to listen to this warning will make you very, very angry when all of your data goes *poof!*
The question of ‘to partition or not’ will always be somewhat contentious—some see it as a must-do, others see it as a why-do. To me, though, partitioning offers a good protection plan against a long and painful rebuild process, so I see it as quite worth the effort.