Pages

Aug 12, 2012

Recover Grub2 via LiveCD (Fedora16/17)

After installing the windows 8 RTM in my computer, I can't boot into my Fedora 17. I need to fix the grub2.

I use the Fedora LiveCD to fix it. First, boot the liveCD, and then open a terminal and type:
$ sudo fdist -l
Now, remember which device listed is your Linux distribution. For example, my Linux distribution is in /dev/sda3
$ sudo mount /dev/sda3 /mnt
If you have /boot on a separate partition, you need to mount it too. For instance, your /boot partition is /dev/sda2, you need run sudo mount /dev/sda2 /mnt
$ sudo mount --bind /dev /mnt/dev
$ sudo chroot /mnt
# grub2-install /dev/sda
After this command, it will show you the grubs is installed successfully and then you can reboot. The grub2 list comes back now.

When you boot into your original Fedora, open the terminal and type:
$ su -c 'grub2-mkconfig -o /boot/grub2/grub.cfg'
It will update your boot list.