Monday, May 10, 2010

Windows7 bootloader missing from Grub



Recently, I upgraded my Ubuntu from 9.10 to 10.04, I chose to upgrade the grub, and then later I found windows7 bootloader missing from Grub. I tried a few things, trying to recover the bootloader, but ended failed. Whenever I fix windows using Windows Recovery Disc, my windows went back to normal, but unfortunately I lost the Ubuntu's grub. When I tried to recover grub, I lost the windows boot loader.

This is the command to recover grub, by using live-CD (my ubuntu installation is in sda3):
sudo mkdir /media/sda3
sudo mount /dev/sda3 /media/sda3
sudo grub-install --root-directory=/media/sda3 /dev/sda

I tried some other tricks suggested by others to recover bootloader through Windows Recovery Disc (as below),  but this doesn't worked for me. From the repair disk, choose "Command Prompt", then type below command:

bootrec.exe /fixboot
bootrec.exe /fixmbr

 At last, I found a solution here (by Aklem):


1: Run Gparted in Ubuntu

2: Right click on partition with windows, and set flags as "boot"

3. Run windows recovery to fix any other errors using startup repair 
4: Restart

Upon restart, I still can't see Windows7 bootloader in the grub's menu, but when logged in, in Ubuntu, I just run "sudo update-grub" in terminal to update grub, and finally Windows7 bootloader listed in grub.

Yeahaaa, I'm very happy now, problem solved !! :)

No comments:

Post a Comment