Archive for April 22nd, 2009

I won’t be doing that again, or “Partition Fail!”

I got a brand-spanking-new 1tb external drive (Western Digital MyBook) for archival, and I decided it would be a good time to redo my partitioning scheme on my current Linux Mint machine. I have two drives in that box, a 160gb (sdb) and 320gb (sda). For some reason, I had sliced and diced them partition-wise: sda had a total of 5 partitions, sdb had 6. most of the partitions were in small chunks, between 40 and 80gb, but there were a couple of smaller ones (15gb and 20gb). This resulted in me constantly running out of space in one of the partitions, then trying to shuffle data between other partitions. (I was too impatient to set up LVM. )

So I came up with my plan: copy the contents of each partition to a directory on the MyBook, then use gparted to combine all of the partitions on each disk. It would be a simple process: copy all data to the MyBook, unmount the current directory, create a symlink to the corresponding directory on the MyBook, then use gparted to nuke the corresponding partition. Simple and straight-forward.

My issue, hwoever, was that I didn’t stop to consider what the ramifications of unmounting part of a filesystem could have. I had no problem moving /home. And I actually had no problems copying /usr onto the MyBook. But then I made the mistake. And learned my lesson:

Never umount /usr if you are not logged in as root! Doing a “sudo umount /usr” worked perfect, of course. However, since sudo is in /usr/bin, and since I had just umounted /usr, there was no way to do a “sudo ln -s /media/mybook/usr /usr”. Or sudo. anything else, including mount. In short, I was hosed!

The easy fix, of course, would be to reboot and let the system re-mount /usr. Except that I had already removed the reference to that partition in /etc/fstab, and since sudo didn’t exist anymore, I couldn’t re-edit /etc/fstab.

With rebooting out, the next solution would be booting off of a recovery CD. The problem with that is I was not at home; I was making these changes remotely. Yeah, that was quite stupid of me; I won’t be doing that again!

I spent a couple hours last night trying to fix everything. I booted off a GPartEd Live CD, and then finished copying files from the various partitions to the MyBook. I then nuked all of the partitions off sda and created one nice, big partition. I’ll be mounting that as /data, and making symlinks where necessary. I also deleted all of the partitions off of sdb except for the root partition. I made this bigger (figured I won’t come close to 50gb anytime soon), then made the rest of the drive a big partition, too.

Of course, I am still running from the gparted CD. I need to copy everything back onto the new partitions. I am also decomissioning a file server, so I’ll be adding another 320gb drive to the system (all as one big partition). That’ll put my Linux Mint box at around 800gb of internal storage plus 1tb external. I think that might handle my needs for a while.

Assuming I don’t break anything else, of course.

Blogged with the Flock Browser

Profile picI am a 40-ish uber-geek, Daoist and family man. Blessed to have one incredible wife and three wonderful kiddos. Dao has been kind to me.

April 2009
« Mar   May »
QR Code
Top categories