Polite notice

Just to let you know that this web site uses CSS to enhance the look and user experience, it looks like your web browser can not understand CSS or you have turned it off.

The effect is that things may not look as intended. Thanks for viewing though!


Archive for August 3rd, 2006

Juggling with Disks

My primary hard disk has been on the blink for quite a while now, since at least the New Year. Once it’s up and running 8 times out of 10 it will be just fine, the other 2 times it crash with DMA errors in the logs and bring the whole OS with it. But if it doesn’t start up at boot time then I’m in for a 30 minutes of fun. It’s got to the stage now where I can’t put up with it any more.I had already moved /home onto another disk (actually I just removed the LVM partition from the LVM volume) so all that remained on it was the operating system. My plan was to move the OS from the primary disk to the second disk and then make that the primary disk. The current primary disk would then be left unplugged.

Yesterday I started by moving the important virtual machines to another computer, and the rest to my backup disk. This morning I did a backup of /home – once I managed to get the disk to boot! Then booting the Ubunut install CD I deleted the LVM volume, ordinarily I wouldn’t have to do this. On this occasion it was needed asI found the paritions on the second disk had become a little confused over where they were suposed to be. Once I had removed the LVM partitions and other partitions on the second disk I recreated them all, and rebuilt the LVM volume with partitions.

The current primary disk was mounted alongside the now empty second disk and a simple cp -axv oldroot/* newroot/ copied the OS from the primary disk to the second disk. Repeat for the /boot partition and the OS was on the new disk. The contents of /home where then restored from the backup onto the LVM partition.

I then shutdown the computer, unplugged the primary disk and made the second disk the primary disk. Booted the computer with the Ubuntu install CD again and mounted /boot and / onto top of the CD’s /boot and /. At this point the file system in /boot appeared at have a problem so I formatted it, rebooted with the original primary disk plugged in and copied it over again. This time it worked and I had a clean /boot file system. As I wasn’t changing where the disk would be booting from I didn’t have to change any boot files to point to the new disk, instead with help from the Gentoo wiki I ran grub and then typed

root (hd0,0)
setup (hd0)
quit

to install the MBR on the new primary disk. With anticipation I rebooted, only to be greated with “No OS can be found, please instert a medium to boot from and press any key“. Once again I booted from the Ubuntu install CD and mounted the partions. This time I tried the other suggestion on the Gento wiki: grub-install /dev/hda.

It worked! After rebooting the Grub screen came up and then started to boot Ubuntu, it stopped and scanned /home but once complete I was greeted by the logon screen. Success. I’ve now copied over the virtual machines and got these working. On the next reboot/shutdown I’ll unplug the old primary disk as I don’t trust it any more. At some point I’ll get around to running the S.M.A.R.T . tools and manufacturer utilites on it to see if they come up with anything. I don’t really want to waste a 120GB disk, but neither do I want to be using a near dead disk.

Tuxx.org.uk is proudly powered by WordPress, Gallery, Debian & Zen