4

I have a dual boot install. I first installed Windows 7 in its own disk (C:) with the secondary drive disconnected. I did this because I know Windows has a tendency to mess with other drives. Then I connected a secondary drive and created a data partition (D:) and installed Linux in a third partition.

To sum up:

  • Disk 1: Windows partition (C:)
  • Disk 2: Data (D:), Linux (invisible from windows due to filesystem), swap.

When Linux installed itself, it also installed GRUB in the second disk (BIOS, not UEFI). So the Windows bootloader, which was installed in C:, wasn't used. Still if in case of an emergency I disconnected the second disk or it failed, Windows 7 bootloader worked.

This has been working fine for years.

Now as part of a Windows Update this month, and I presume it is related to that update that nags you with the end of support message and a possible upgrade to Windows 10, Windows 7 has moved its own bootloader from C: to the data partition in the secondary disk (D:). There is now a bootmgr.exe and a Boot folder in D:, and there is none in C:.

Dual boot via GRUB is still working fine though, but I would like Windows' own bootloader to stay in C: where it belongs. Will it suffice with copying bootmngr.exe and the Boot folder back to C:, or should I use Windows installation DVD to "repair" the Windows install? And If I fixed that disk alone, would the GRUB in the secondary disk still work?

UPDATE: (Dec 2019) It has happened again! I installed a security cumulative package and apparently Windows decided that the SSD where it was installed is no good and moved itself to the other hard drive.

3 Answers3

3

UPDATE I disconnected the second disk, restarted, and windows booted into repair mode instead of normally. I chose "startup repair" but it didn't work. It said windows couldn't repair automatically. The error detail shown was something like "NoOsLoader". I inserted the original Windows installation DVD and restarted the PC. In BIOS it said "press any key to boot from DVD", so I did that and booted from DVD. Selected timezone and keyboard, then chose "startup repair" again, and it fixed the missing bootloader without having to perform a full reinstall. Now windows restarted again and this time it could boot from C: normally. During all this time the secondary HDD was disconnected (both power and data cables) for just in case windows repair utility decided to mess with this disk instead. After repair was confirmed sucessfull, I connected again the other hdd and booted into linux. I inspected the D: partition and I found some files that were not there before and were created by windows recently:

/boot
bootmgr.exe

So that was definitely the cause of the problem. Windows HAD MOVED ITS OWN BOOTOADER TO A PARTITION OF HIS CHOICE.

I deleted those files as they were already reinstalled into C: where they belong.

Now to prevent this from happening again I have 2 choices:

  1. Never ever install "security" updates again, as they clearly mess with the bootloader.
  2. Disable the D: partition in windows.
0

This is an issue I experienced about a year back, I was attempting to install windows on a second drive to facilitate the migration of data from an old HDD to a new SSD. During installation, whether it be a bug or by design, Windows will detect boot-loaders on other disks and install itself there. I was unable to, by any measure, get the boot-loader on the correct disk and all attempts to remedy was met with blue screens or a tidy "no OS found" message.

Your best bet would be to try to repair windows with an installation disk/USB with your linux disk disconnected. While it's probably possible to move the file(s) over, I don't recommend it as Microsoft likes to create associations which may make your life miserable.

0

The problem is delicate, since the Windows 7 boot process is quite fragile.

In theory, it is possible to copy the System Reserved partition that contains the Boot folder from D to C, but there are some gotchas:

  • The Windows 7 partition must stay in its exact sector address, or the boot process will not work. If you will move it in order to free disk space, it may become unbootable.

  • After copying the System Reserved partition from D to C, the command to set the BCD is:

    bcdboot c:\windows /s c:
    

    and it must be issued from inside Windows, so you must boot from grub, and it's unclear which BCD Store will be updated. If it's the one on D, then you may need to boot Windows 7 from USB into the Command Prompt and issue this command using the right volume letter and with the Linux disk disconnected.

Before starting, I suggest taking some precautions:

You might be able to short-circuit some of the above precautions, but you will then need to have some luck on your side.

harrymc
  • 498,455