When I add a second SATA drive, Windows 7 insists on trying to boot from it...

#1
I just got a new HP PC, which came with Windows 7 and is set up for EFI booting (no secure boot problem).

The system came with a hard drive in SATA0 and a DVD/ROM in SATA2. SATA1 and SATA3 are free. I'd like to add the SATA drive from my former system in such a way that I can see it from Windows and Linux (once I install linux on the primary drive). I also would like to be able to copy the files from the windows and linux partitions on the old drive. The problem is that Windows won't boot with the drive in SATA1 and linux can't see the drive when it's in SATA3 (the BIOS also doesn't see the drive in SATA3 - but Windows sees it once it's started).

With the dirve in SATA1, both the BIOS and Linux see it, but for some reason, the Windows boot loader insists on trying to boot from it. It brings up the grub boot loader from the MBR and shows me the old grub menu. If I move the old drive from SATA1 to SATA3 (or remove it altogether), Windows 7 boots normally. How can this happen?

I tried using EasyBCD to change the boot order in the Windows boot loader. The EasyBCD menu showed an unchecked 'hard drive' entry above the Windows 7 entry, and I thought maybe moving that down below Windows 7 might help, but it didn't. And when I got Windows back up, the entry was back where it started.

Any ideas?

Thanks, Rob
 

Mak 2.0

Mod...WAFFLES!?!?
Staff member
#2
So with the drive hooked up to SATA3 you went into the BIOS and made sure that the device was turned on right? When you hook it up to SATA1, do you go into the BIOS to make sure that SATA0 is still set as the primary drive?
 
#3
So with the drive hooked up to SATA3 you went into the BIOS and made sure that the device was turned on right? When you hook it up to SATA1, do you go into the BIOS to make sure that SATA0 is still set as the primary drive?
The BIOS shows all SATA ports enabled, and there is no setting to designate a primary drive.

The boot menu contains 2 sections - one for EFI booting that lists the "Windows Boot Loader" as the only option, and a Legacy Boot section that lists all the drives the BIOS knows about - it doesn't list SATA3 when I'm plugged in there, but it does list SATA1 when plugged in there. No matter - I'm using the EFI Windows Boot Loader option, since 'legacy booting' off of SATA0 doesn't even see the OS.

I think the Windows Boot Loader has its own concept of boot order - that's what EasyBCD is supposed to let me mess with. But when I turned on the delay feature in EasyBCD, the menu I'm shown has only one entry 'Windows 7'. When I select that entry, it boots the old drives MBR if that drive is in SATA1 - even though Windows 7 is in SATA0. So the Windows boot loader is doing its own magic in picking which drive to boot from. By the way, prior to attempting to boot from the old drive's MBR, the WBL displays a progress bar with the message "Windows is scanning files". That must be where it has detected new hardware and is reconfiguring itself. I need to make it not do that.

For what it's worth, I've been booting linux (live CD) by selecting the CD from the legacy boot options. EasyBCD shows the CD as an EFI boot option, but it's not checked in the menu (only Windows 7 is checked). If I were to check the CD there, I assume it would show up in the windows boot menu. Do you think booting Linux from the CD via the windows boot menu would somehow make SATA3 visible to linux? iI'd be okay, I guess, with the drive as SATA3 if I could see it from both systems - though I'd still like to understand what's happening when it's SATA1.
 

Mak 2.0

Mod...WAFFLES!?!?
Staff member
#4
There is a settings for the primary drive. When yo go to the Boot section, it will tell you which devices and in which order are set to boot. Make sure that your drive marked SATA0 is set to boot before the SATA1 drive. You may have to know the make/model of the drive for this but it is and how it has been done with in the BIOS for years.

Yes EFI or UEFI is the new secure boot with Windows 8. If the device or system you are booting to does not have UEFI, then it will fall under the legacy aspect unless you turn secure boot off.

No Windows boot loader does not have its own concept and no EasyBCD is not supposed to let you mess with that. EasyBCD is exactly what it sounds like. An EASY way to work with the Windows BCD to setup multiboot. We basically gave the BCD.exe command from Windows a GUI.

So you want the ability to boot like the old way of Windows but while having the new GUI. It cant and wont happen. So you will have to disable secure boot.
 
#5
There is a settings for the primary drive. When yo go to the Boot section, it will tell you which devices and in which order are set to boot. Make sure that your drive marked SATA0 is set to boot before the SATA1 drive. You may have to know the make/model of the drive for this but it is and how it has been done with in the BIOS for years.
My BIOS does have all this under the 'legacy boot' section, and SATA0 comes before SATA1. But I'm not booting in legacy mode, because Windows won't boot that way. SATA0 has a GPT partitioning scheme, and in legacy boot mode, no OS is detected.

Yes EFI or UEFI is the new secure boot with Windows 8. If the device or system you are booting to does not have UEFI, then it will fall under the legacy aspect unless you turn secure boot off.
I don't think secure boot is turned on - this isn't windows 8, it's windows 7. I'm able to boot from a live linux CD, and secure boot would prevent that, right?

No Windows boot loader does not have its own concept and no EasyBCD is not supposed to let you mess with that. EasyBCD is exactly what it sounds like. An EASY way to work with the Windows BCD to setup multiboot. We basically gave the BCD.exe command from Windows a GUI.
Well, there's something going on after I select Windows 7 from the text boot menu that shows up. I get a "Windows is scanning files" progress bar, and then it boots the SATA1 MBR. Without SATA1 in there, I don't get the progress bar - it just boots straight to Win7.

So you want the ability to boot like the old way of Windows but while having the new GUI. It cant and wont happen. So you will have to disable secure boot.
That's okay - I don't care about the graphical boot loader (it'd be nice, but I'm not up to that yet). Besides, that's a Win8 thing, right?
 
#6
Here's another couple of odd wrinkles. I'm able to boot to a gparted live flash drive by selecting it from the BIOS's legacy boot menu. When I do that, I get a text-based grub menu that works to boot it. I tried turning off the 'boot' flag on the old drive's XP partition, but that did nothing (I guess resetting the partition boot flag doesn't disable the MBR).

When I went to reboot to see if resetting the boot flag did anything, I didn't remove the flash drive. I just selected 'Windows Boot Loader' from the BIOS's EFI boot menu. As usual, that displayed a text-based Windows boot menu with a single Windows 7 option. But when I selected Windows 7, this time I tried to boot from the flash drive instead of the old XP drive. And when the gparted grub menu came up, it was a graphical menu. So not only did the Windows Boot Loader choose to boot the flash drive as "windows 7", it had done some kind of hardware initialization of the graphics system so that the grub boot loader on the flash drive determined it could present a graphical menu.

As always, after selecting 'Windows 7' from the Windows boot loader menu, I displayed a "Windows is loading files" progress bar. Well, not 'as always' - I only see that when it boots from the wrong drive. When only SATA0 is there, I don't get that message or progress bar - it just starts booting Win7 right away.

So what I really need to find is some documentation somewhere of the process the Windows boot loader performs when you ask it to boot Windows 7. I think I read somewhere that windows tends to recreate its boot options on the fly unless you do something to prevent it from doing that - but I don't remember where I read that or what it was...
 

Terry60

Knows where his towel is.
Staff member
#7
The "boot" flag in Linux (hence gparted) is the "active" flag in MS-Speak
Windows Disk Management flags have the following meanings
"boot" = "this is the system you're running"
"system" = "this is where I found the boot files for the currently running system"
"active" (on the first HDD in the BIOS boot sequence) = "this is where I started the search for the boot files"
"active" (on subsequent HDDs in the BIOS boot sequence) ="this is where I will look if I don't find something in the MBR on the first HDD"
If you turned the "active" flag off on the "system" drive, the MBR will be unable to locate the windows bootmgr, so it will move on to the next "active" partition it can find, which happens to be your flash drive if you leave it connected.
The "active" flag (or boot flag in Linux terminology) is what the MBR IPL looks for, to locate the next step in the boot sequence. You should never switch the active flag unless you are doing it with a specific pre-planned purpose to a location where you know there is a set of boot files you wish to use.
Have a read of
Multibooters, Vista Dual and Multibooting - A Guide to the Multiboot Process
for a very readable tutorial on how it all works.