Fix grub 2 for Ubuntu 12.04

This simple tutorial will show you how to fix/re-install grub 2 using live cd or usb in Ubuntu 12.04.

1.Boot from you Ubuntu Live cd or usb disk/pendrive

2.Open a terminal from Dash or by pressing Ctl+Alt+t

3.Use bellow commands to re-install grub 2.

sudo -s
mount /dev/sda1 /mnt         #Assume your root partition is /dev/sda1
mount /dev/sda6 /mnt/boot     #skip this command no separate boot partition
grub-install --root-directory=/mnt/ /dev/sda

4.Verify your grub.cfg

ls /mnt/boot/grub/grug.cfg

IF grub.cfg is missing,run below commands to generate one

mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub

5.(Optional)Check if your vmlinuz and initd.img are normal

file /mnt/initd.img
file /mnt/vmlinuz

6.Eject or unplug your boot media then reboot

reboot

One thought on “Fix grub 2 for Ubuntu 12.04

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>