Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Dell workstation that had Windows 7 installed on it. I added a second HD and installed Ubuntu to that using WUBI. This worked fine as a dual boot system for a long time but then the primary HD appears to have died enough that Windows refuses to boot now (it gets stuck in a Recovery cycle). I'm fine with Ubuntu as my primary OS, but the problem is that the Windows 7 Boot Configuration Data (BCD) has Windows as the default OS and a time-out of 3 seconds. The way it appears to boot is if I select Ubuntu from the Windows Boot Manager, it loads GRUB, which then loads Ubuntu. (I.e. if I hold down shift after selecting Ubuntu, I get the regular GRUB interface and can select the Ubuntu recovery mode).

I suspect the real solution here is to just blow away the whole machine and start fresh, but I'm hoping that there's some way I can just edit the windows BCD from within Ubuntu and have Ubuntu set as the default OS. Under XP, I know I could have just edited the boot.ini, but that seems to no longer be an option under 7.

What appears to be the configuration: sda0: Dell recovery partition and Ubuntu/WUBI install; sda2: default boot

Note that when I boot using the SuperGrub2, it tells me that it's booting Windows Vista. The Ubuntu install appears to be an NTFS disk with an Ubuntu Virtual disk on it.

share|improve this question

You can. Since you can somehow boot into Ubuntu, do so, and then download and install Boot-Repair. You can find all information here. Basic configuration is enough to solve most (not all) problems. This will correctly configure GRUB to give you an option between Ubuntu and Windows, and Grub is smart enought to search all disks for bootable partitions, not just the one it is being called for.

Incidentally, this will most likely mean you cannot use Wubi any longer. And that might be a smarter move than you suspect, since Wubi creates a very large number of problems, and its development has been abandoned.

share|improve this answer
There is no indication at the given link to Boot-Repair that it has the capability to edit the BCD. There is an option to "repair Windows boot files", whatever that may mean. – kreemoweet Dec 12 '13 at 17:36
why not use grub-install ? It's easy , I think. – Ashildr Dec 12 '13 at 18:51
It would be the right thing to do if there were Ubuntu only, on the machine. Since there is Windows too, I am afraid that Grub and BCD will somehow clash. Using Boot-Repair fixes the possibility of a conflict between the two. – MariusMatutiae Dec 12 '13 at 18:55
Got to Boot-Repair, but something messed up and now I'm getting the "BOOTMGR is missing" error when I try to boot. The partition is still there, as an old copy of UBCD lets me use an old copy of SuperGRUB2 boot to a read-only version of my computer. I'm downloading the Secure Linux disk to see if I can use that to fix things. – Aphoid Dec 12 '13 at 21:50
Boot repair was unable to fix this for me. I ended up installing a new copy of Ubuntu on a brand new HD and installed a Windows VM in VirtualBox for the rare occasions when I need Windows software. I copied my old configuration over by mounting the old WUBI root.disk temporarily. This should be a better setup for me regardless as the new HD is larger than my root.disk and it's native ext4 instead of NTFS mounted. Thanks for the help. – Aphoid Jan 28 '14 at 19:34

After trying the other suggestion of Boot-Repair and GRUB editing, I ended up replacing the failing drive and installing a fresh, native (i.e. non-WUBI) Ubuntu. For the rare occasions that I need to do something in Windows, I fire up a VirtualBox Windows 7 installation.

share|improve this answer

If your Windows hard drive is failing, I would think it inadvisable to continue to rely on it for booting. I suggest you use your Ubuntu installation to edit GRUB's configuration, and set your BIOS to boot from the second (Ubuntu) hard drive. You can add an entry to the GRUB menu to boot into Windows, if and when you ever resolve it's booting issues.

share|improve this answer
This is what Boot Repair is for. It fixes corrupt configurations, which is the case here: not all cases of misconfigurations are due to software errors, while Boot-Repairs can fix most of them. – MariusMatutiae Dec 12 '13 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .