středa 7. května 2014

grub repair

1. boot CentOS rescue USB/CD

2. allow the rescue manager to mount root (and boot) partition (as /mnt/sysimage) - not necessary.
The disk setup is as follows:
/dev/sda = (hd0) = usb boot drive 
/dev/sdb = (hd1) = normal boot drive with failed grub.

3. start grub
server:# grub

4. I have separate boot and root partitions: /dev/sda1 (boot), /dev/sda3 (root). In a single root/boot partition setup try to find /boot/grub/stage1
grub> find /grub/stage1
(hd1,0)
grub> root (hd1,0)
grub> setup (hd1)
grub> quit
In this case grub uses grub/menu.lstto setup the configuration. Even if it refers to (HD0)

5. exit, reboot