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.

Little problem with a newbie here, after a bunch of reinstalling, I've managed to make 7 + 8 + Ubuntu not crash on my new T430. 8 (pre)installed first, then 7, then Ubuntu (bootloader installed onto the root partition, not MBR I'm guessing?), then boot-repaired from a live CD Grub works, huzzah!

Problem is, booting to windows comes in two options:

  • Windows UEFI bkpbootmgfw.efi
  • Windows Boot UEFI loader

Both of which send to me to the Windows 7 bootloader, which then gives me the choice to boot 7 or 8. Any way I can boot to both of them directly from grub?

UPDATE: I tried to use easybcd to re-default the windows bootloader, but it somehow managed to screw things up when "reset"ing, and I ended up with 60 boot items. Windows would not boot at all afterwards.

I have now completely reinstalled everything, so Ubuntu and Windows both have their own boots which I can select as devices by pressing F12, and I can adjust the default as well. However, I would still like to have all 3 options available from start up.

I tried using easybcd to add Ubuntu to the windows bootloader, but it says that it's missing the /NST/AutoNeoGrud2.mbr file and won't boot from there.

share|improve this question
    
Could you edit your question, and add the output of running blkid and sudo grub-mkconfig. –  Braiam Sep 23 '13 at 23:07

2 Answers 2

When you boot Windows, it goes straight to it's bootloader, not to the OS itself. Because you have two versions of Windows installed, it will recommend both to you instead of just booting Windows itself. As a result, it is easier to just use the Windows bootloader and have it boot Linux. Grub can later be configured to go directly to Ubuntu. Here's what you need to do.

  1. Get EasyBCD
  2. Use EasyBCD to set Windows as the default bootloader and modify its boot menu to include grub
  3. Go into Ubuntu. Your boot menu should now allow you to choose between Windows 7, 8, and grub. Be sure that Ubuntu is the default option for grub.
  4. Run gksudo gedit /etc/default/grub from Terminal
  5. Make sure GRUB_HIDDEN_TIMEOUT equals 0
  6. Profit!

This should make Grub go directly to Ubuntu, and make the Windows boot menu allow you to choose between all your operating systems. Good luck!

share|improve this answer
    
This would work on a BIOS-based computer, but the last I heard, EasyBCD was useless for selecting boot options that include Linux on an EFI-based system. It's possible that this has changed recently, but if so, I have yet to see confirmation of it from anybody who's actually done it. I have seen lots of reports of people digging themselves in deeper by trying to do this, though, so I recommend caution when trying this on an EFI-based computer. –  Rod Smith Sep 24 '13 at 3:44

This is not definitive, since I've never tested it; however....

First, the MBR is irrelevant on your system, except insofar as a protective MBR is part of the GUID Partition Table (GPT). Your boot loaders are stored as files in the EFI System Partition (ESP), which is mounted at /boot/efi in most Linux installations. Ubuntu stores GRUB in the ESP's EFI/ubuntu directory (that is, /boot/efi/EFI/ubuntu from Ubuntu), and Microsoft stores its boot loader in the EFI/Microsoft directory tree on the ESP. This is why you get the dual boot loader treatment when you want to boot Windows -- Microsoft uses one location for both Windows 7 and Windows 8, just as Ubuntu would if you were to install multiple versions of Ubuntu, so that one boot loader must present a menu to enable you to boot either version of Windows.

In theory you might be able to create a second ESP, copy the original ESP's EFI/Microsoft directory to it, and edit files on both ESPs to limit them to boot just one version of Windows. Unfortunately, I don't know enough about the Windows boot files to give more precise instructions. In fact, I don't even know that it would really work, but it might.

If you're willing to go to the effort, you could try this to get Windows to do most of the work for you by re-installing Windows 7:

  1. Create a second ESP on the disk. In GParted, you'll need to shrink a partition by a small amount, create a new FAT32 partition in that space (be sure it's FAT32, not FAT16), and give it a "boot flag." I also recommend giving it a unique name, like "WIN7ESP." (This might be useful if you end up using rEFInd or to help identify it in file browsers.)
  2. Remove the "boot flag" from the original ESP.
  3. Optionally, change the type code on the Windows 8 partition. You could set the "lvm flag" on it in GParted, for instance. The goal here is to make it less likely that the Windows 7 installer will detect Windows 8.
  4. Erase the original Windows 7 partition by creating a fresh NTFS filesystem on it. Give it a unique name to make it easier to identify.
  5. Re-install Windows 7. At this point, Windows 7 should boot directly.
  6. Restore GRUB as your default boot manager. If you're unsure how to do this, you can use Boot Repair. Alternatively, you could install another EFI boot manager, such as rEFInd or gummiboot.
  7. In Linux, launch GParted and undo the partition type code changes you made earlier -- reset the boot flag on the original ESP and, if you changed the type code on the Windows 8 partition, remove that flag to restore it to the correct type code.
  8. In Linux, type sudo update-grub to get it to re-detect boot loaders, with any luck including both of the Windows boot loaders. If that fails, you may need to edit /etc/grub.d/40_custom to add a custom menu; or you could install my rEFInd boot manager, which should detect both copies of the Windows boot loader.

I make no promises that this procedure will work. Also, even if it does work, it may create problems down the line, because Windows doesn't support more than one ESP per system. (The EFI specification says it's OK, though.) Thus, a future Windows update or re-installation could end up getting confused and misbehaving. You should be able to work around such problems by temporarily resetting the type code on one or the other ESP (that is, removing its "boot flag" in GParted).

If this procedure doesn't work, or if it sounds too involved for you, I recommend you ask about this on a Windows forum, since Windows boot loader configuration is more of a Windows issue than a Linux issue.

Two more points:

  • AFAIK, Ubuntu is still giving its Linux partitions the same type code that Windows uses. This makes the Linux partition(s) show up as unformatted disks in the Windows file browser. I recommend correcting this problem with gdisk, as described here. Neglecting to do this makes it too easy to accidentally trash your Linux installation from Windows.
  • Windows 8 uses a new "fast startup" feature that's incompatible with dual-booting (even with Windows 7). It's IMPERATIVE that you disable this feature, as described here. Failure to disable this feature will almost certainly result in filesystem corruption.
share|improve this answer
    
Question more for Rod? And I do not know either. Rather than second efi partition why not another folder in the current efi partition. Folders seem to have any name so Windows7 and Windows8 with each having copies of all the Windows files and edit each BCD to only boot that system? I have seen Kubuntu instead of Ubuntu for some systems but otherwise identical to an Ubuntu efi folder. –  oldfred Sep 24 '13 at 0:26
    
The bootmgfw.efi file, which is the Windows boot loader, seems to work off of hard-coded file paths rather than relative file paths. Thus, if you created a second directory (say, EFI/Windows7), the bootmgfw.efi file in it would still use the configuration files in EFI/Microsoft. At least, that seems to be the case, based on the fact that you can move/rename bootmgfw.efi to EFI/BOOT/bootx64.efi and it still works. I'm hoping that the program at least restricts itself to one partition, in which case my suggestion has some hope of working. As I said, though, I've not tested it. –  Rod Smith Sep 24 '13 at 3:41

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.