Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed 12.04 through a USB drive and when it's done I can't load Windows 7 (Loader)(on/dev/sda1) in GRUB. When I select that, it displays a black screen and then returns to GRUB but I'm still able to boot into 12.04.

Help me to solve this, I installed boot-repair, I checked and reinstalled Grub in the main option tab and checked place boot flag on sda1 Windows7 in other options tab , rebooted and it wasn't working.

This is the boot info summary: http://paste.ubuntu.com/1206875/.

I also tried

sudo grub-install "(hd0)"
sudo update-grub

in the terminal and it gave me

found Windows 7 (loader) on /dev/sda1 

and rebooted but I still wasn't able to boot into Windows 7. This is my boot info summary after I typed those two commands: http://pastebin.ubuntu.com/1206955/

Please help me, I'm at wits end.

share|improve this question
add comment

1 Answer

You've installed grub2 into the MBR of /dev/sda1 - the Windows boot partition according to the first bootinfo summary. It's not necessary to do this, and I'm not too sure what it will do to Windows. I'm also not sure how to repair it - you might try one of the Windows support sites and see what they say.

If you resized the Windows boot partition during the install it's a very good idea to run chkdsk and defrag on the NTFS partition before you proceed. This ensures that the resize operation is done quickly and with the least chance of corrupting the Windows install.

At this point you should back up all the data on the Windows partition because if it's not possible to repair it, you will need to re-install. (and if you resized the partition, it should be backed up anyway - resizing is a risky operation at the best of times).

/dev/sda4 appears to contain the Windows recovery partition. Under no circumstances modify this partition if you don't have the installation disks. Consult the system manual on re-installing Windows from this partition.

If you run the Windows installer after installing Ubuntu, it will overwrite the grub bootloader with the Windows MBR (Master Boot Record). What you need to do is boot the LiveCD and chroot into the Ubuntu system, then re-install grub2

From looking at the bootinfo it appears that the Ubuntu / partition is /dev/sda6

For the purposes of these instructions I'm going to write /dev/sdX from now, to prevent new users blindly typing these commands. You will need to replace /dev/sdX with your Linux partition.

Firstly, boot the LiveCD and in a terminal window mount the Ubuntu root partition:

 sudo mount /dev/sdaX /mnt

Next, export the LiveCD filesystem to the root filesystem on the drive:

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

Now change the root filesystem to the hard disk:

 sudo chroot /mnt

Now re-install grub2 to /dev/sda

sudo grub-install /dev/sda

At this point you could reboot and it should allow you to boot into Ubuntu, however if Windows was installed after Ubuntu then it won't know about the Windows OS yet. To fix this run update-grub:

sudo update-grub

and it will find all OS's on your system and add them to the grub menu. You can now reboot:

sudo reboot
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.