Windows moved the bootloader to another drive

10,685

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.
Share:
10,685

Related videos on Youtube

Mister Smith
Author by

Mister Smith

Updated on September 18, 2022

Comments

  • Mister Smith
    Mister Smith over 1 year

    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.

  • Mister Smith
    Mister Smith about 5 years
    But the DATA partition in the secondary disk (D:) is not system reserved! It is a regular NTFS partition and I have it filled with my own personal data (which is why I freaked out)
  • Mister Smith
    Mister Smith about 5 years
    Also nothe that GRUB's regular bootloader is installed in this very same secondary disk since always, and it is still working. So I'm guessing windows fucked up while trying to install its own bootloader in this disk and just copied a bunch of files in there. These windows boot files are probably not located in specific sectors or anything, since this is a large data partition.
  • Mister Smith
    Mister Smith about 5 years
    But let's say I manage to restore windows bootloader in C:. When I connect back the other disk, and since it comes first in boot order in the BIOS, will GRUB be able to boot Windows in C just as before?
  • harrymc
    harrymc about 5 years
    Questions: (1) Are you using BIOS or UEFI? (2) Do you see any System Reserved partition on D (not DATA)? (3) Do you have such a partition on C, or has it become unused space (meaning Windows Update has deleted it)?
  • Mister Smith
    Mister Smith about 5 years
    I'm using good old BIOS. There should be no new system partition in D, since I manually partitioned it and there is no free space available. There is the DATA partition, a linux ext partition and a linux swap partition. I've no idea of what has happened to C:, but there should be a single Windows partition. I'll check when I get home.
  • harrymc
    harrymc about 5 years
    If you have no System Reserved partition on D, then there is nothing to copy. If there is enough space for it on C, then bcdboot should be able to create it from scratch. If all fails, you will need to disconnect drive D and do Startup Repair.