Recovering boot grub2 in Ubuntu 14.04 LTS
I was running Ubuntu 12.04 LTS in my Laptop. Last time, when i saw Ubuntu 14.04 LTS was released, I upgraded my Ubuntu to 14.04. But, upon restarting my laptop, my boot grub has been crashed.
My old technique of recovering grub was as follow:
Booting Ubuntu from Live USB pendrive or CD, and after that execute the following commands in Ubuntu terminal.
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
But, this time, it didn’t work for me. I have to work on another process of recovering grub.
My new technique of recovering grub worked well for me and i hope this is the good technique of recovering grub in linux system:
I booted my laptop using Ubuntu Live USB.
Then, i found my linux boot partition issuing following command.
sudo fdisk -l
In my case, my boot partition was /dev/sda6. Then, i mounted my device boot partition to /mnt folder. Likewise, i mounted /dev/sda6 to /mnt/boot. After that, i created separate directory tree or mirroring of whole device to mounted device folder using –bind.
Then, i did chroot to /mnt folder , but in my case, it was not necessary, i still don’t know why. And I installed the grub in my /dev/sda, which is my harddisk partition.
Finally, i unmounted all the previously mounted folders and rebooted.
sudo mount /dev/sda6 /mnt
sudo mount /dev/sda6 /mnt/boot
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda
sudo umount /mnt/dev
sudo umount /mnt/boot
sudo umount /mnt
That’s it. Fabulous job, grub has been restored. Cheers!