Ubuntu – Recovering from Boot Problems after a new Windows install

Assumptions :

1. You had a Linux partition
2. For some reason you re-installed windows and now cant boot into Linux
3. You cant boot into linux even if you select the specific HDD in BIOS boot options

You will need :

1 Either a USB boot version of ubuntu or Live CD you can boot with

To create USB Memory Boot Stick :
A. Download your ubuntu .iso file
B. if you are on windows install LiLi from here http://www.linuxliveusb.com/ and create the boot USB drive.

To restore Boot :

1. Boot From you USB stick.

2. Now we will have to mount the local drives.

3. Find out from fdisk or parted the parition where Linux is located.

4. Mount the ubuntu partition drive

            sudo mount /dev/sdXX /mnt  (example 'sudo mount /dev/sda1 /mnt')

5.Only if you have a separate boot partition:

            sudo mount /dev/sdYY /mnt/boot.

6. Mount the virtual filesystems:

            sudo mount --bind /dev /mnt/dev
            sudo mount --bind /proc /mnt/proc 
            sudo mount --bind /sys /mnt/sys

7. To ensure that only the grub utilities from the LiveCD get executed, mount /usr

            sudo mount --bind /usr/ /mnt/usr 
            sudo chroot /mnt  

8. If there is no /boot/grub/grub.cfg or it’s not correct, create one using

          update-grub 
      or  update-grub2

9.Now reinstall Grub

            grub-install /dev/sdX  (e.g. grub-install /dev/sda. Do not specify the partition number.   

10. Verify the install

            sudo grub-install --recheck /dev/sdX

11. Exit chroot : CTRL-D on keyboard.
12. Unmount virtual filesystems:

            sudo umount /mnt/dev 
            sudo umount /mnt/proc
            sudo umount /mnt/sys 

If you mounted a separate /boot partition:

            sudo umount /mnt/boot 

13. Unmount the LiveCD’s /usr directory:

            sudo umount /mnt/usr

14. Unmount last device:

            sudo umount /mnt

15. Reboot.

            sudo reboot.

abridged from
http://opensource-sidh.blogspot.com/2011/06/recover-grub-live-ubuntu-cd-pendrive.html

Leave a Reply

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