Wharrgarbl

Listening Subscribe Archive Theme

These are the haps of Nick Piepmeier



Jul. 02, 10

01:44 AM

Hard disk partitioning

I recently went on a small computer part acquisition binge and got all sorts of great stuff. Call me a huge geek, but researching, buying, and assembling computer hardware (and then setting up systems on top of it) is one of my favorite things to do. Some folks build ships in bottles, others care for bonsai; I make boxmachines.

The first group of things was a mini-ITX Intel Atom motherboard, some RAM, and a FireWire card, which are going to form the foundation of the NAS I’ve been meaning to build for over a year now. More about that in a later post.

Then I bought some other fun things, like a new wireless N router (with support from the manufacturer for DD-WRT) and other tidbits for my mom. Hopefully they’ll make her life easier and finally allow me to network the HTPC in her living room.

The thing I’m most excited about right this moment, however, is the new 500gig hard drive I just got for my laptop. It’s probably the most boring piece of hardware I ordered, but I love buying new hard drives. Hard drives are kind of like a reptile’s skin: you keep growing into the one you have until you’ve filled it out, then you shed it and secrete a new one. Ok, maybe not the whole secretion part, but you get the idea. It’s like a new ring in a tree, or getting a new, bigger bucket when your current bucket has filled up with whatever you have in your bucket.

Anyway, horrible analogies aside, I’m psyched about my new abundance of space. This drive is twice as big as my last one (inadvertently following the programmer’s rule of thumb when resizing a container), giving me all sorts of new space for all the cruft that I accumulate throughout my digital life.

What’s interesting this time, however, is that I finally have enough space, and have had this computer for long enough, to try out some slick partitioning schemes.

Let me provide a bit of (nontechnical) background: when you’ve got a new, untouched drive in front of you, it doesn’t have any filesystems on it. It’s just a bunch of uninitialized blocks of space for you to use to your liking. Before you can start copying your embarrassingly large collection of pictures of adorable kittens to your drive, however, you have to partition it - that is, you have to split it up into logical chunks of space where files can go.

Most of the time, folks just make one enormous partition and go to town. This has the advantage of being the most flexible layout: since everything goes in the same chunk of space, you don’t have to worry about allocating too much space for one chunk and not enough for another.

For many technical or logistical reasons, however, this isn’t always the best layout for your drive. For instance, let’s say you want to run two operating systems. I happen to have both Linux and Windows installed on my laptop, and in most cases, they can’t live on the same partition. So I need at least two partitions.

Here’s where things start to get a bit tricky. If I allocate too much space to my Linux partition(s) (which I use more often than Windows), but quickly fill up my Windows partition with all the amazing and cheap games I bought last week from Steam, then I’m in a pickle. Resizing/reallocating partitions is a nontrivial task, and if I don’t have my data backed up I risk losing it all if I screw things up.

This problem is exacerbated by the fact that it’s encouraged for Linux users to split their installs up with multiple partitions for security, stability, and maintainability reasons. To make matters worse, while it’s relatively easy to decide the relative amounts of space various operating systems should take up (all my games are for Windows, so I’m going to need a lot of space there, and Linux can access Windows partitions, so I won’t need a huge amount of space there), it’s not always clear how subdirectories in a Linux install are going to grow. For instance, /home usually gets pretty big because that’s where all the user’s files are stored. /etc, /usr, and /var, however, can grow in strange ways depending on what distro I’m using and where software thinks it should be installed. Also, while /boot might start off very small, if I don’t make sure to clean out old kernels I might end up with some problems.

Don’t even get me started on /opt.

Anyway, this is a difficult problem to solve, and historically I’ve just made an enormous Windows partition and a smaller Linux partition, and just bunged all of my Linux stuff into that single partition.

It gets more interesting this time around, though.

Since I’ve owned this computer for so long, and pretty much just moved partitions and resized them when I’ve gotten a new drive, the various directories in my Linux install have hit pretty stable states. I can now take a look at the various sizes of directories and intelligently allocate partitions on my new drive to suit them. This has the added bonus of allowing me to share data between installs and upgrade/reinstall operating systems without worrying about accidentally destroying my valuable data.

So this is a pretty huge deal. To some of you, this may resemble James May’s behavior whenever he’s presented with any sort of tool, but the important distinctions here are that I only need to do this once, and that I drive very, very fast.

Permalink | Tags: hardware HDD partitioning linux computers OCD
blog comments powered by Disqus