Home > Linux > How to recover grub in Ubuntu

How to recover grub in Ubuntu

Sometimes after a kernel upgrade, I don’t know why, the grub is not updated properly and then it is not possible to boot the system. Here it comes the way to solve this problem quite easily.

Use a LiveCD or a Rescue Mode to have access to the hard drive that holds the OS you are not able to boot.

Once logged in, chroot your former system.

$ sudo -i
# mkdir /mnt/chroot
# mount /dev/sda1 /mnt/chroot                <--- replace sda1 for your system partition
# mount -o bind /dev /mnt/chroot/dev
# mount -o bind /sys /mnt/chroot/sys
# mount -o bind /proc /mnt/chroot/proc
# chroot /mnt/chroot
# grub-install --recheck /dev/sda1
# update-grub

Then reboot and cross-fingers.

Advertisements
Categories: Linux Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: