02 November 2012

Resolving grub rescue issue after Windows 8 installation

The issue occurs when you try to upgrade your Windows 7 to Windows 8 and have installed a Linux version (e.g. Ubuntu) in the past, parallel to Windows 7. The grub rescue screen appears just after first restart and it doesn't let you boot into the Windows. In my case the text looked like this:

error: unknown filesystem.
grub rescue>

This happens because grub can not find the Linux partition, which you may have deleted earlier (just by formatting the Linux disk partition). First you can try all these options:

1. Repair Windows start-up using Windows 7 installation DVD.
2. Using command prompt option with W7 installation DVD to fix master boot record (MBR) [Link] & [Link]
3. Try removing Grub using Ubuntu live CD/DVD [Link]
4. Use Ubuntu tool "Boot-Repair" [Link]

If any of the above mentioned option did not work, then use the Ubuntu live CD/DVD to install Boot-Repair, after installation click on "Create a BootInfo summary":

This will analyze all the partitions' boot information and create a report, you'll have to access this report using the URL given by this program. The URL will look like: http://paste.ubuntu.com/(a_number)/

The report is divided in many sections, what you should be looking at is the block where you can find an entry mentioning grub.

For example in my case the grub entry was located on the partition sda3:



sda3:__________________________________________________________________________
    File system:       vfat
    Boot sector type:  Unknown
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /EFI/Boot/bootx64.efi /EFI/ubuntu/grubx64.efi 
                       /EFI/Microsoft/Boot/bootmgfw.efi 
                       /EFI/Microsoft/Boot/bootmgr.efi 
                       /EFI/Microsoft/Boot/memtest.efi

In you case grub boot file may be located on a different partition, mount that partition into newd directory using command (in ubuntu live cd/dvd session):

sudo mount /dev/sda3 /newd
go to the newd directory and then EFI by typing:
cd /newd/EFI/
remove the whole ubuntu directory using command:
sudo rm -r ubuntu
End the live Ubuntu session and restart. If you can boot into the Windows then it worked!! Otherwise look for other solutions on the Google (one of them was: re-installing the Ubuntu again, hence fixing the Grub).