Sunday, January 2, 2011

How to recover Grub2 in Linux

The grub is the boot, is what allows us to choose between different operating systems to turn on the pc. But we fucked for example every time we install windows and it's really annoying that happens, nothing is more annoying than turning on the pc and it will not boot. But the truth is easy recover grub and all I need is a live cd of Ubuntu (or any distro that uses Grub2) and run a few simple commands. So ...

Step 1: Start with some live cd of Ubuntu

Step 2: In the console type the following:
sudo fdisk -l
With that may see the partitions on your system.

Step 3: Run
sudo mount /dev/sda1 /mnt
Where sda1 is where you have installed Ubuntu or Linux before I had installed grub. This unit may be different in each case (sda2, sda3, etc). May realize that unity is correct because in step 2 of the partitions has an asterisk in the 'Boot' or 'Home'

Step 4: Run
sudo grub-install –root-directory=/mnt/ /dev/sda
Here you should note that at the end says sda, not sda1. This value makes reference to the disk where this linux. If you have multiple disks may be the case with linux on the second disc then that value would be sdb.

Step 5: Now you can reboot and log into your linux, but as the former was replaced grub is more necessary to run a command to retrieve the previous entries (other operating systems you have installed):
sudo update-grub
And here a picture of what would be the entire process:

If this article was useful and you want to help us to grow Subscribing to our feed or Click "Like" in our Facebook page ,or follow us via Twitter or subscribing to our feed.

People who read this post also read :


Thank you so much for sharing. I really appreciate your post.

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More