Tales of a full hard drive

In between watching the US Open finals this weekend, I had to fix up my PC. My hard drive (300GB) has been filling up with stuff and finally got full. My partitions looked like this:

/dev/sda1 (NTFS): 40GB at 80%
/dev/sda2 (ext2, /boot): 40MB at 50%
/dev/sda3 (swap): 2GB
/dev/sda4 (extended)
/dev/sda5 (ext3, /): 40GB at 100%
/dev/sda6 (FAT32): remaining space at 90%

The root drive being full had various bad effects on my ability to log in and do things under X. Also, the boot drive is quite small and has in the past got too full during large upgrades. So I wanted to fix both problems.

So I cracked my 500GB backup drive out of its enclosure and put it in the machine. My first thought was to move /home to its own partition. So reformatted it as ext3, and put in the necessary /etc/fstab line to mount it in the right place, renamed the old home directory and copied everything over.

Things started to go wrong immediately. Gnome wouldn’t load properly, and I got a stern message saying “HARDWARE ERROR”. Ulp. I tried to ignore that and tried plan B.

Plan B was to just mount the new drive as another volume and keep my home directory as is. So I reverted my changes there, and instead, copied a bunch of stuff from the FAT32 volume to the new volume. I didn’t really need to access that stuff from Windows (which I keep around just for games and VPN to work).

Plan B seemed to work better. To eliminate any sources of errors resulting from frankenstein configurations, I decided to start with a clean home directory, and restore some things from my backup. Having cleared some space from the FAT32 volume, I then just had to resize the partitions, so I downloaded a gparted live CD and got to work.

I shrunk the NTFS partition by 40MB and resized /boot into it, so that I doubled the size of /boot. This should help with future kernel updates. Then I shrunk the FAT32 partition by 50GB. This took a long while, and I went to bed while this was happening. I guess gparted had a lot of work to do. Anyway, I got up this morning and it was done, so I expanded the root partition into the leftover space, which didn’t take nearly as long.

And now I’m done, with an extra 50GB of space on the root partition. I still think the long term fix (and the desirable one) is plan A: to migrate /home. But I’ll leave that for now. I’m going to wait and see how the new drive pans out before I commit more important data to it, after that hardware error message.

Leave a Reply