grub comes to the rescue

Sometimes, the creating of a double boot system messes up the bootsector, ending up staring at:

grub>_

Just a couple of statements to get the system up and running again. First a listing of the drives:

grub> ls

(hd0) (hd0,6) (hd0,5) (hd0,3) (hd0,1) (hd1) … etc.

Showing the partition type of a partition with:

grub> ls (hd0,5)

Partition hd0,5: Filesystem type ext2 – Last modification time, bla, bla…

Well this could be the root partition. Let us select it:

grub> root (hd0,5)

(0,5): Filesystem is ext2

Check the contents with:

grub> ls /

lost+found/ var/ etc/ media/ bin/ /boot/ dev/ home/ … etc. etc.

Looking good. Probably this is the one. Select a kernel to boot, using /dev/sda5 (hd0,5) as root:

grub> linux /boot/vmlinux-whatever-you-like root=/dev/sda5

Boot into it with:

grub>boot

Once booted into the system execute:

# grub-install /dev/sda

Bootcd

If all of the above doesn’t work boot with a live cd.

Once booted, mount the root partition on /mnt. Then:

# mount –bind /dev /mnt/dev

# mount –bind /proc /mnt/proc

# chroot /mnt

# grub-install /dev/sda

# umount -a

# shutdown -r -t2 now

Leave a Reply

Your email address will not be published. Required fields are marked *

*