The Inferno



The Inferno :: It is a fallacy to state that something exists just because it can’t be proven that it doesn’t
Archive for May, 2008
5/16/08
6:38 pm
Moving the Root Partition

I’m a Gentoo user (but not a Gentoo ricer) and last week, I noticed all sorts of aberrations with the emerge command:

  1. Emerge stalling at a random point during “emerge -uD world“. Processor usage went down to 0% and disk I/O shot up to 1011 MB/sec. This would continue for a few minutes and the system would eventually become unresponsive and required a hard reset
  2. Emerge stopping at a random point with the error that the root partition was mounted read-only and thus /var/tmp/portage was unwriteable to.

So of course, I booted into a livecd and ran e2fsck on the root partition: / , /dev/sda2 in this case. There were no errors with the filesystem. After some investigation and asking in #gentoo, I realized that my disk had developed some faults and these weren’t filesystem faults, but actual physical drive problems. This left me with no choice but to migrate the / partition to my 2nd drive.

I fired up qtparted and made a 50 GB ext3 partition on my second hard drive, /dev/sdb6. I mounted it at /mnt/newroot and at this point I was still running off /dev/sda2 as root, but in a root shell I typed:
cp -ax / /mnt/newroot

This copied over all my files, with some errors about copying files from /proc and /sys which I ignored. This took around 30 minutes for the 12 GB on /.

Once this was done, I deleted the contents of /proc and /sys on the new root. Then I edited /etc/fstab to mount /dev/sdb6 as the new root. One last change was in /boot/grub/grub.conf, which needed the root to be changed from root=/dev/sda2/ to root=/dev/sdb6/.

With everything done, I rebooted into my new root and everything worked, right off the bat. However there was one slight bug, the /etc/fstab needed to be modified on the new root as well. You could modify /etc/fstab before copying it over to avoid this.

I realize that the best way to do this would have been to reboot into a livecd and then copy my / over, thereby avoiding the cp errors with the files in /proc and /sys, as well as having to delete them later. But this lazier approach saved me one reboot. I suppose you could have copied over all the folders explicitly and simply ignored /proc and /sys too.

One important caveat: my /boot partition is on a completely different partition, /dev/sda4. This helped me immensely, I’m not sure how this would affect bootability if my /boot folder actually contained my kernel. Maybe one would have to modify initrd? I’m not sure.

Anyway, it was painless and straightforward, hope it works out for you if you ever try it.

5/13/08
2:44 pm
Tightly Controlled

You know it’s great when gambling is more closely monitored than the electoral process. Not even just the electoral process, but the cornerstone of democracy, the voting process.

One Armed Voter

Remember to hack this, if you’re an American and plan on spending a bit more time in the election booth. With a little bit of practice at home, you might even be able to complete this maneuver in under a minute.

Subversion