Original title: How can i solve (un)booting windows 7 on the same partition with grub?
I've been researching this problem for two to three days but I have came up empty.
Basically, partition 1 is Windows 7 and partition 2 is Ubuntu 12.04. I told Ubuntu to install into partition 2 and to install GRUB on partition 1 and that works fine. But the problem now is that I can't boot Windows 7. It just returns to the GRUB menu after I select it.
From what I have researched, if I can edit GRUB to boot Windows 7 "mbr" or the bootloader \windows\system32\winload.exe
(without using a Windows 7 repair disk), my problem will be solved. Is this even possible?
The URL of Boot-Repair-Info is http://paste.ubuntu.com/981952/
Output from the command sudo blkid
/dev/sda1: UUID="1EA0019AA0017A13" TYPE="ntfs"
/dev/sda2: UUID="e4402f9e-83df-4dc3-8913-69b28314d253" TYPE="ext4"
/dev/sda3: LABEL="Vault Drive" UUID="74145BFD145BC132" TYPE="ntfs"
/dev/sda4: UUID="1c030d32-657f-4a78-9468-307d9e09a977" TYPE="ext4"
Could you create a Bootinfo Summary report using the boot-repair tool as described below and then post the link to the report?
I know you have already provided some details about your boot configuration. However, the report I am asking for contains more detailed information and might give us a better understanding of why you are unable to boot Windows using GRUB.
How to use boot-repair to provide a "Bootinfo Summary"
Since you can still boot Ubuntu, you can install and run the Boot-Repair tool using the
apt-get
command and then use it toCreate a Bootinfo summary
.Run the commands below in a terminal window to install the
boot-repair
tool.boot-repair
to start the tool.boot-repair
will ask if you want to download its newest version. Since you just installed the newest version, answerNo
.boot-repair
asks to install thepastebinit
package, respond withYes
.Create a Bootinfo summary
box/button. This will collect information about your system's boot configuration, but will not make any changes.boot-repair
will display a message containing a URL which should look like this:http://paste.ubuntu.com/123456/
.Please update/edit your question and add this URL. The information in the pastebin this link points to will (I hope) help us diagnose the problem.
I think over-writing the Windows partition's VBR caused this problem.
My understanding is that there are several steps to starting an operating system. In your case, I think something like the steps below happens.
bootmgr
program in your Windows partition.However, when you instructed the Ubuntu install a program to install GRUB into the Windows partition, GRUB appears to have replaced the Windows VBR with its own. This GRUB VBR displays the GRUB boot menu.
Unfortunately, I am not sure yet what would be the best way to fix this. We want to be careful that we do not break GRUB and make it impossible to boot anything on your computer when we attempt to fix the problem booting Windows.
Below is a copy of some of the information from your Bootinfo Summary for reference. My comments above are based on this information.
A possible workaround to boot Windows 7
Below is a suggestion for editing your GRUB boot commands which may allow you to boot Windows 7. I am not sure this will work, but it seems worth trying.
Currently, your
grub.cfg
uses the GRUB boot commands below to boot Windows 7.I am suggesting you try changing this and use these commands instead.
Here are the steps to do this.
Windows 7 (loader) (on /dev/sda1)
.menuentry
above.insmod ntldr
chainloader +1
to
ntldr ($root)/bootmgr
Note 1:
If the above workaround succeeds in loading the Windows 7 boot menu, then you could make it semi-persistent by
sudo
to edit the file/etc/grub.d/40_custom
and add the second, modifiedmenuentry
shown above. (If you do this, I'd also suggest you change the title of this "custom" entry.)sudo update-grub
to update/boot/grub/grub.cfg
to include your customized entry. (It will be on the bottom of the GRUB menu when you boot.)I would view the suggestion above as only a partly-baked solution. A better solution is to restore the Windows VBR to the Windows partition without also destroying the ability of GRUB to boot.
I think ... but am not 100% sure ... that the Windows recovery command
bootsect
can be used to do this. If you want to risk it, one possible way to do this is outlined below.Advanced Boot Options
menu.Repair Your Computer
entry.System Recovery Options
.Command Prompt
bootsect /nt60 C:
But you might also want to wait a bit and see what other answers you get to your the question before you take the risk of trying the above.
Note 2:
While searching for other things, I ran across two other questions on AskUbuntu which are related to your problem.
I'm not sure how much help these questions provide. The answer to the second question was to use the command
bootrec /fixboot
to restore the VBR for the Windows partition. My understanding from that question was that using thebootrec /fixboot
command solved the problem.But the second question insists that
bootrec /fixboot
did not solve the problem.(Beats the heck out of me as to what might be going on there.)
If you installed Windows on partition other than (hd0,1) you need to use drivemap command to boot to Windows. Chainloader +1 or ntldr /bootmgr both can be used to boot Windows 7.
What you did is you modified the VBR of the 1st partition; you may restore that by executing these commands in windows recovery mode in cmd when you boot from installation CD :
I don't really know about "(UN)booting)" you shoud try to fix your Windows by using Windows Repair disk (choose
Command Prompt
to run thebootsect.exe
utility. Bootsect is located inside the boot folder so change your directory toboot
. Now runbootsect /nt60 C:\
(without quotes) if you had Windows 7 initially installed in theC:
partition. Alternatively, you can run "bootsect /nt60 SYS" or "bootsect /nt60 ALL")And then re-install GRUB.
GRUB is installed in your Windows partition boot sector (PBR), as your BootInfo shows:
This prevents Windows from booting.
Solution is described nicely here: http://ubuntuforums.org/showpost.php?p=11693662&postcount=1
I had this same issue and would like to confirm the solution that worked for me in hopes that it helps others...
I edited grub.cfg to reflect the changes here:
That is, I added...
insmod ntldr
and changed the last line to...
ntldr ($root)/bootmgr
I'm going to attempt to restore the VBR shortly and will report back how it turns out.
Solved my windows 10 boot problem....
hexadec.code may be different