Page 1 of 1

Ubuntu Hardy Server recovery not working

Posted: 05 Jun 2008, 06:48
by Franic
Hi all,

I installed an Ubuntu Hardy Server which worked fine. The root was on a software raid1 /dev/md0 and the swap on another software raid1 /dev/md1.

The only problem is I made a mistake and it didn't work anymore.

Fortunately I knew it could happen, so when it was working I made an image of the root with partimage using SystemRescueCD.

When the Ubuntu Server was broken, I recovered using this image and put it back on the raid /dev/md0 which was the root of my system. Then I installed grub on the MBR in each disk.

When I reboot, grub runs fine. But the Ubuntu Server doesn't want to start and I have this error message:
ALERT DOES NOT FIND MD0
and it starts in busybox mode.

Unfortunately if I boot SystemRescueCD it finds perfectly my 2 software raid1.

I've checked the files mdadm.conf and menu.lst, and they seem correct.

Anyone knows why the recovered Ubuntu Hardy Server from a working image doesn't want to start? Why can't it find /dev/md0?

Thanks.

Posted: 21 Jun 2008, 11:42
by Tuipveus
When I upgraded my normal 1 harddisk installation to raid-1, I needed to write following to the menu.lst.

Code: Select all

title           Debian GNU/Linux, RAID kernel 2.6.18.1
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.18.1 root=/dev/md0 md=0,/dev/hda1,/dev/hdc1 ro
savedefault

title           Debian GNU/Linux, RAID recovery kernel 2.6.18.1
root            (hd1,0)
kernel          /boot/vmlinuz-2.6.18.1 root=/dev/md0 md=0,/dev/hdc1 ro
savedefault


Notice md=0,/dev/hda1,/dev/hdc
I wrote this under of "### END DEBIAN AUTOMAGIC KERNELS LIST"
I manually disconnected harddisk no. 1 and it still started. Then did same for harddisk no. 2 and it still started.

I also have Debian in another computer, which has been installed directly to RAID, but I haven't checked if it is able to boot from both harddisk. It has different configuration:

Code: Select all

title           Debian GNU/Linux, kernel 2.6.22-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.22-2-686 root=/dev/md0 ro
initrd          /boot/initrd.img-2.6.22-2-686
savedefault


I think your raid-partitions are fine, but grub is messed up. If you can mount your md0 with sysresccd, you should be able to see state of harddisk with

Code: Select all

cat /proc/mdstat


After it will work again, please make extra backup of first 63 sectors with dd.

Code: Select all

dd if=/dev/hda of=/your_directory/grub_backup_hda.bin bs=512 count=63
dd if=/dev/hdc of=/your_directory/grub_backup_hdc.bin bs=512 count=63

or something like that.