Windows 7 boot fails with EFI/Grub/Ubuntu

  • Nek

    My windows doesn't boot. Here is a screencast.

    Initial situation

    For some special cause, I had two concurrent windows 7 installations and a version of ubuntu (grub boot broken).

    How I broke my boot

    My computer is configured to work with UEFI (I speak here with boot) so notice that's there is NOT a story about MBR (I think), there's more interesting things about MSR, GPT and EFI on the web...

    I tried to install Ubuntu with deleting one of the two windows partitions. This broke everything because Ubuntu doesn't support EFI installation yet. I used the Linux Secure Boot livecd to repair the linux boot. It worked... But I needed to modify the windows loader part to have a fully work installation.

    Here is a description of what I did:

    But as you can see on the video, my windows start partition seems to be buggy. I saw two windows and no one works.

    (I have an image of my disk if it can help but I can't post it right now)

    Thanks for help !

  • Answers
  • Nek

    Here is the solution for all my problems.

    Remember facts :

    My computer is using SecureBoot/UEFI/GPT.

    1. I installed Windows
    2. I installed Ubuntu (on another hdd)
    3. The boot was broken I restored it with boot-repair
    4. Ubuntu boot, not windows. Impossible to boot on Windows.

    The solution : (and the why)

    Ubuntu support secure boot only since the last release (the 13.04 version). When I installed it, Ubuntu made automatically a MBR partition. The part of mistery is how boot-repair came to make a boot with using "MBR for Ubuntu" and "EFI for windows" (which obviously didn't work).

    So I :

    1. Removed Ubuntu (because it's more simple to re-install than upgrade to GPT format partition).
    2. Installed the new version of ubuntu
    3. Use again boot-repair, which work pretty good this time

    If you want to use Ubuntu LTS (no support for secureboot) or another distribution, you have to disable the "secureboot" option from your bios and be sure the partition your distribution create is in "GPT" format.

    Hope to be usefull !

  • snayob
    • You should try to repair Windows 7 booting using Windows 7 installation/repair CD/DVD. Try automatic repair option (should be run up to 3 times with rebooting after each run). If errors persist just run following command:

    bcdboot c:\windows - where c: maps to Windows 7 installation drive.

    • Then run Boot Repair for Linux. It should pick up Windows 7.

    An UEFI capable BCD Editor can be downloaded here.

  • Related Question

    How to fix EFI-boot on my Macbook Pro after Ubuntu install?
  • Reilly Beacom

    The MacBook does not boot. The screen stays blank (black) – not the grey, active screen like normal. To power off, I hold the power button down.

    After 5 boot attempts the MacBook finally shows the grey, active screen and boots OSX.

    This started after I installed Ubuntu 11.04 on a 2nd partition.

    Here is the sequence of events and my attempts to fix the problem:

    1. OS X on partition 1.
    2. rEFIt installed and set to appear on every boot – everything still working fine.
    3. Installed Ubuntu 11.04 on partition 2 – at the end it said Grub was installing on the hard-drive.
    4. MacBook, after shutdown, and restart sounds a long tone and has a blank (black), unlit screen (ie not grey/active). It does not boot or do anything. Holding Option key does not work. After 5 power cycles, the MacBook finally boots to OSX.
    5. I synced the partition table with rEFIt and shutdown.
    6. Same as step 4, after many reboots I can load rEFIt then OS X or Ubuntu.
    7. I ran rEFIt script to bless it again – result same as 4.
    8. I used OS X's Startup Disk utility to select OSX hard-drive – result same as 4.
    9. I then used OS X install-DVD to totally format hard-drive and re-installed OS X – result same as 4.
    10. Many more attempts of steps 5 to 9 – result same as 4.

    Further details on number 4 (above):

    Note, Option (AKA Alt) key works on a normal bootup, but it is after/outside my problem.

    A "normal boot" can be described as:

    • OSX loads
    • or, holding Option key shows the EFI boot-selection
    • or, holding Command+Option+P+R keys resets NVRAM.

    However, the problem I have is that "normal boot" fails for the first 5 power-cycles. (After a failed boot, I can kill power by holding the power-button down.) During failed boots, NOTHING works (no keys, no OSX) - just a blank screen.

    Its like the EFI code crashes or freezes. But on the 5th power-cycle a "normal boot" always works, like some fail-safe is triggered. Then after I shutdown OSX, the boot issue repeats - ie another 5 power-cycles before I can get back to OSX.

    Note, on the first (only the first) failed boot (one of five) (after shutdown) the MacBook Pro makes a tone (an error-tone I assume).

    Here is my system:

    • Model Name: MacBook Pro
    • Model Identifier: MacBookPro5,4
    • Processor Name: Intel Core 2 Duo
    • Processor Speed: 2.53 GHz
    • Bus Speed: 1.07 GHz
    • Boot ROM Version: MBP53.00AC.B03
    • SMC Version (system): 1.49f2

  • Related Answers
  • 8088

    Try resetting the NVRAM and PRAM. See this Apple Support link.

    It could also be a problem with the boot loader; try pressing Alt at boot time and select the OS X partition. If it boots directly w/o any problems you need to check on the boot loader.

    For further information about Ubuntu on a MacBook you could also consider reading Installing Ubuntu on a MacBook.

  • chrismurphy

    The lack of a detailed description of the installation makes it unclear whether the hardware is booting in EFI mode or using the CSM. If the installation CD/DVD is inserted, the computer turned on, and you hold the option key to bring up the startup disk menu, if the CD icon is labeled "Windows" then it will enable CSM (BIOS emulation) boot and the installer will install a BIOS dependent bootloader. If the CD icon is labeled EFI Boot then that's EFI mode booting and the installer will install an EFI dependent bootloader: most likely grub.efi, on the EFI System partition.

    On my Macbook Pro 4,1 I can only do EFI booting with text console. Nouveau and proprietary nvidia drivers hang graphics display upon enabling, although it's possible to ssh into the system and it functions fine otherwise. Using kernel parameter 'nomodeset' I can successfully boot text only and use the built-in display. According to the following bug, the nouveau developers are saying they cannot get the information needed from EFI mode booting, from Apple's EFI implementation. (Comment 34).

    On my Macbook Pro 8,2 an EFI mode boot produces unusable text and graphics video and I have been unable to do any further testing.

    With both hardware models, CSM mode boot functions pretty well outside of certain hardware driver availability and refinement. But it's not obvious how the user can know whether EFI mode or CSM mode boot is occurring. This is one reason why I decided to abandon rEFIt as I just couldn't really tell what was being booted or how, and it would present options for booting that simply wouldn't work.

    To produce an linux distro installation that uses the CSM without depending on rEFIt requires some special handling to get Apple's EFI to enable the CSM. I've filed those in this bug.

    Really we should lobby Apple for full UEFI 2.x support, instead of their current firmware which is still largely based on Intel EFI 1.10 (with some things from the UEFI spec). In my opinion it is unreasonable, even if it would be nice, to expect the linux distributions to support Apple's non-standard EFI implementation. So for now, I'm using the CSM, but I'm hopeful that Apple will get this sorted out.

    For those using Lion, you will likely have a "Recovery HD" partition as your 3rd partition, so partitions 3, 4, and 5 in the bug above will be 4, 5, and 6.

  • slhck

    Having the same problem with my Macbook Pro. I've tried everything suggested here, but end up with the same 5 power boot before getting normal boot scenario. I hope that another user or Ubuntu Community would provide a solution for these problems, as for now my solution is: Do not Shut Down your system, just put it in Sleep mode. That would save you some trouble (for now).