0

Dear future people: Install Windows 7 in BIOS mode. GPT and UEFI are not properly supported.

Longer answer: If you have an EFI partition on another HDD, even if it's your only EFI partition, the UEFI mode Win7 installer will keep writing EFI partitions until it can't anymore. After that, it will write the System Reserved partition, format the rest of the blank space as NTFS, and the installer will fail. When you try to delete the NTFS and install on top of what you're formatted, you will be informed that Windows 7 can't be installed on a GPT disk.

This post is going to be kind of long because I've done a lot of testing. Until proven otherwise, I'm going to assume this incredibly bizarre issue is caused by my computer being haunted. I'm also kind of busy, so I may not be able to try out the proposed fixes for a few days.

Backstory: I just built a new desktop. I have 3 hard drives in it: a 1TB from someone's old PC (which I completely reformatted to put a fresh Windows install on), an 80gig I bought clean (completely reformatted), and one from my old BIOS laptop that I'm still using because it's only a few months old. I just installed 17.3 on top of 17.2 (both based on Ubuntu 14.04) due to hardware compatibility issues. Aside from that and a few other things (partition resize to remove laptop's Windows install) it's exactly the same setup that worked. It's just in a UEFI system instead of BIOS. My Linux hard drive shows an MBR-type partition table, but that shouldn't be the problem. Every partition on the laptop drive is part of an extended partition.

Problem: Windows can't boot. When I try, the Windows logo pops up for a second, then the screen goes black and a progress bar appears saying "Windows is loading files". Then it tells me that Windows failed to start. Safe mode does not work. I've tried putting in the installation media and running startup repair, but it immediately goes to "Attempting repairs" and the repair operation cannot be canceled except by turning off the machine.

What I've done (at the time of question posting) (this is just what I remember doing off the top of my head, there may be some other things I forgot to mention):

All installs and boots are done in UEFI mode, not legacy BIOS mode. Firmware is flashed with latest version. Yes, I shut down before I unplug hard drives. No, secure boot is not enabled.

First attempt: First install on new machine. Installed Windows to 1TB, resized laptop partitions, and installed Linux on laptop HDD. Rebooted to Linux, worked fine. Later discovered that Windows is fubar now.

Second attempt: Deleted partitions on 1T. Unplugged 1T and laptop. Installed Windows to 80G (to generate a new EFI partition). Booted to Windows, everything works. Unplugged 80G, replugged 1T. Reinstalled Windows to 1T, then deleted everything on 80G except EFI. Booted to Windows, everything works. Unplugged 1T and reinstalled Linux, selecting the EFI partition on 80G as the boot partition. Replugged 1T and booted to Linux, then ran update-grub. Booted to GRUB, selected Windows. Windows failed to start.

Third attempt: Deleted 1T again and ran update-grub to remove the Windows entry, then edited .bash_aliases to make sure I couldn't somehow update GRUB by accident (yes, I know this is per-user and not for system). Unplugged laptop and 80G. Reinstalled Windows. Replugged laptop and 80G. This time I boot to windows using the BIOS boot menu instead of GRUB. Windows loads fine. Rebooted to Linux. Looking at GRUB, no Windows entry. Linux loads fine. Now I'm feeling pretty confident, but just to be 10,000% sure, I rebooted to Windows, again through the mainboard's UEFI boot menu. Windows fails to load. GRUB still doesn't show an entry for Windows.

At this point, I'm at a complete loss. These shouldn't even be interacting, much less doing this. Does Windows 7 now have piece of code that detects Linux and pukes itself, but only in UEFI mode? I'm half tempted to think it has something to do with my MBR laptop drive, but that's where my Linux install is hosted, not to mention that last attempt completely eliminated the possibility of any accidental overwrites. This is a real problem for me because some of my work requires programs that don't run under WINE. I can do it at the college, but if I realize Friday afternoon that I made a mistake I'm completely SOL. Can anybody tell me what's going on and how I can fix this? Research tells me that multiple EFI partitions shouldn't create a problem, and my perfectly functional MBR Linux install shouldn't affect my Windows on a separate drive. I'm kind hesitant to try and convert it to GPT just to see what happens, because for some reason my backup program freezes when it gets to steam.pipe (and a few others, but it usually hits that one first) and I can't afford to lose all my data.

Can this be fixed, or should I call an exorcist?

12
  • No, it's not Windows that is at fault. It's GRUB, that doesn't work reliably for anything but Linux. Commented Feb 6, 2016 at 19:32
  • I'm confused, are you trying to get data off the windows partition or are you just trying to get a dual boot to work. If you have a legitimate copy of windows then you can dual boot them under UEFI, I know this becuase I have it on the machine I'm using now. I suspect you need to configure GRUB.
    – Jordan Camp
    Commented Feb 6, 2016 at 21:09
  • @Jordan Camp I'm trying to get dual-boot to work. For some reason it just won't and I can't figure out why. As far as I can tell, I've tried everything and it still messes up because reasons.
    – VHS
    Commented Feb 6, 2016 at 21:17
  • @IInspectable It worked fine on my laptop. The only two differences are that this is a UEFI system and I've got each OS on a separate drive.
    – VHS
    Commented Feb 6, 2016 at 21:19
  • can you get to the grub screen when turn the computer on?
    – Jordan Camp
    Commented Feb 6, 2016 at 21:25

2 Answers 2

1

I have no definite solution, but I do have some observations and suggestions:

  • Show us details -- Your summary of what you've done at every step omits an awful lot of details. What might be helpful is a summary of those details at one point in time, then stop messing with the system until you collect a few suggestions that you can prioritize. The Linux Boot Info Script will collect the information in one file (RESULTS.txt), which you can post to a pastebin site and post the URL to your document here. Feel free to try one or more of the below before you do this, but please don't post your system state and then change it. Also, add to your report of the Windows boot failure the exact error message. (Take and post a digital photo, if it's a long message.)
  • Remove GRUB from the equation -- Unlike IInspectable, I don't think GRUB is the root of your problems; however, on the off chance that it is, you could remove it from the equation. You can re-install Windows to get a working copy, then install Mint without GRUB. In Ubuntu, you'd do this by booting the installer to its "try without installing" mode, open a Terminal and type ubiquity -b. The -b option tells it to not install GRUB. I suspect the same would work for Mint, but I'm not 100% positive of that. At this point, Mint will be installed but unbootable. You can use my rEFInd boot manager on a USB flash drive to boot on a temporary basis, or install its PPA or Debian package in Mint to install it permanently to your hard disk. rEFInd does a better job of launching the Windows boot loader than GRUB does, so there's a small chance that using rEFInd and keeping GRUB off the disk will help.
  • Stop juggling disks -- You're making heavy use of the old BIOS trick of unplugging disks to control the boot process. This practice is less useful in the EFI world because in EFI, the complete path to the boot loader is stored in NVRAM. When you unplug a disk, the firmware may notice that a path is invalid and delete it. This issue won't break Windows as booted from GRUB, but if the only way you can get Windows to boot is via its NVRAM entry, unplugging the disk could remove or damage that entry, thus causing problems. Combined with a GRUB bug that prevents it booting Windows, this could explain many of your problems.
  • Use GPT exclusively -- It should be possible to mix GPT and MBR. Doing so usually works. I've seen some problem reports, though, that suggest that the presence of an MBR disk can cause some subtle and weird problems on some computers. Yours could be one of these. Thus, I recommend using GPT exclusively. If you have valuable data you want to preserve on your MBR disk, I recommend you back up those files and then use my gdisk program to convert from MBR to GPT. (gdisk comes with Mint and is available for Windows.) The conversion itself is low in risk, but not 100% risk-free, and takes a fraction of a second -- it will take far longer to navigate the menus and type the commands than to rewrite the data structures.
  • Disable Fast Startup and Hibernation in Windows -- These two Windows features cause innumerable headaches and weird boot problems with dual-boot configurations. When active, a shutdown or reboot operation becomes a suspend-to-disk operation, which results in filesystem damage, which can manifest as boot problems. See here and here for instructions on how to disable these features. Note that it's the Windows feature that's important. Many EFI's have a "fast start" feature that's completely unrelated and that is not the source of your problems.
  • Disable the CSM in your firmware -- The Compatibility Support Module (CSM), aka "legacy boot support" or something similar, provides an EFI with the ability to boot BIOS-mode OSes. This could be causing problems because you might have installed one or the other of your OSes in BIOS mode without realizing it. See this page of mine for more on the CSM and how it can cause problems.
  • Identify and limit the number of ESPs -- The EFI spec is quite clear that multiple ESPs, and even multiple ESPs per disk, are legal; however, some OSes misbehave in the presence of multiple ESPs. This is true, at a minimum, of the Windows 7 installer. (I've not checked more recent Windows installers for this.) I've never heard of problems like yours arising because of multiple ESPs, but on general principles, I'd try to limit the number of ESPs, across all of your disks, to one.
  • Check your NVRAM entries -- You can use EasyUEFI in Windows or the efibootmgr utility in Linux to view and manage your NVRAM entries. If you care to do a fresh install of everything, I'd start by clearing out all of the Windows and "Ubuntu" (really Mint) entries, as well as anything else that might be left over (say, a Fedora entry if you've previously installed Fedora). Note that some entries are created by the firmware and will keep re-appearing even if you delete them.

Of these suggestions, disabling Fast Startup and Hibernation, disabling the CSM, and stopping your disk-juggling practice are probably the most important. Switching from GRUB to rEFInd shouldn't help, but given your description of when the problem began occurring, it may be worth trying.

2
  • Thanks for the tips, I just got it fixed last night. For some reason, disabling the CSM caused Windows to not boot from the install DVD or the hard drive, so I tried installing it in compatibility mode and it works with almost no side effects. GRUB doesn't recognize it, but holding F10 will open the BIOS boot menu. Also, it seems as though Windows 7 doesn't properly support GPT or UEFI, since I got multiple different problems relating to these technologies when I hooked up my other hard drives during the Windows install.
    – VHS
    Commented Feb 14, 2016 at 18:33
  • Windows 7 and later certainly support both GPT and UEFI. What you describe in your bolded addition to your question is, however, a known bug in the Windows installer: If the disk has multiple EFI System Partitions (ESPs), or if an ESP uses FAT16 rather than FAT32, the installer becomes confused and fails. This is easily corrected by removing the "extra" ESPs (or changing the first to use FAT32 rather than FAT16).
    – Rod Smith
    Commented Feb 14, 2016 at 20:08
0

sounds like you need to setup the hard-drive to GPT instead of MBR. which i only know how to do in a way that destroys ALL-DATA on the drive you are installing to. by hitting Ctrl+f10 whilst booted from your windows DVD/USB bootable device. which brings up a command prompt where you can use "diskpart"

entering; list disk (which shows disks)

then; select disk # (replace # with drive number

then type; clean (warning this deletes all partitions)

then type; convert gpt (to convert mbr to gpt)

finally type; format fs=fat32 quick

then type "exit" end hit enter then "exit" and enter again

which should leave you in the windows installer menu with a GPT hard-disk that will accept a UEFI installation.

tip!!!! use rufus to burn windows .iso/.img files to a USB drive for creating GPT/UEFI compatable installation media!.

some DVD media dont have an EFI install option.

You must log in to answer this question.

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