I just got a new PC (HP P7-1380T) with Windows 7 preinstalled. The machine is set up for EFI booting without 'secure boot'. I had planned to install my old SATA drive (dual-boot XP and Linux with grub in the MBR) as a secondary drive to copy both windows and linux files over to the new drive - and then leave it in as a backup device. The problem is that I can't install the old drive in a way that both Windows and Linux can see it.

The machine came with its hard drive in SATA0 and a DVD/ROM drive in SATA2. SATA1 and SATA3 are free.

When I plug my old drive into SATA1, I can't boot Windows 7. The EFI bootloader tries to boot from the old SATA1 drive instead of the new SATA0 drive. It gets as far as loading up the grub boot menu, at which point I power off to prevent further mischief. In SATA1, the old drive shows up in the BIOS, and when I boot Linux from a live CD, it sees it as /dev/sdb.

When I plug my old drive into SATA3, it doesn't show up in the BIOS, and when I boot the live linux CD, it does not see the drive either. But with the drive in SATA3, Windows 7 boots, and it sees the old XP partition and makes it available as drive F:.

I would prefer to use SATA1, obviously, so Linux can use the drive, but so far, I can only have Windows or Linux see it, but not both. Why would the EFI Windows bootloader try to boot off of a secondary drive, when it's obviously set up to boot off of SATA0? Is there some tool I can use to change this behavior?

  • Can you confirm the boot order in the UEFI firmware configuration? Sometimes the actual setting has nothing to do with the port numberings. It is also quite unsual for a UEFI firmware to decide to boot from a MBR drive. With the ways the firmware work, I can't see how this is even possible without resetting the CPU each time you boot. – billc.cn Jan 14 '13 at 23:35
  • Windows Boot Manager, USB floppy, USB hard drive, ATAPI CD/DVD drive. Could it be that the Windows Boot Manager has its own boot order implemented in software once it loads? Maybe the EasyBCD bootloader management utility would shed some light. come to think of it, prior to booting the old MBR's grub, the boot manager displays a progress bar with a message like 'scanning devices'. Maybe it's detecting the drive and inserting it into its boot list. – littlenoodles Jan 14 '13 at 23:49
  • I loaded EasyBCD, and the windows bootloader shows Windows 7 at the bottom of the list, with a generic 'Hard Drive' entry above it. Maybe that's the problem, that generic hard drive boots when I'm in SATA1 (BIOS reports it), but not when I'm in SATA3 (BIOS ignores it). I can try editing the boot order with EasyBCD, if you think that's the issue (and I can't brick my system...) – littlenoodles Jan 15 '13 at 0:12

Since it's got Windows XP on it, your old drive almost certainly uses MBR partitions and a BIOS boot loader. Unfortunately, there's no standardization in how modern EFI systems react when they're shown two disks, one of which uses GPT and an EFI boot loader and the other of which uses MBR and a BIOS boot loader. You may be able to get the disk to be ignored by fiddling with firmware settings or the boot order, but that might not be enough. Along those lines, look for boot order options or options to disable "CSM" or "legacy" support. You might also try enabling "fast boot" support.

If none of this works, you might consider an alternative:

  1. Install both disks.
  2. Boot an emergency Linux system from the optical drive. Something like System Rescue CD or Parted Magic should work well.
  3. Use the emergency system to copy all your files from the old disk to the new disk.
  4. Optionally, power down, remove the old disk, boot up using your new installations, and check that your files are all accessible. Reboot into the emergency system.
  5. Launch parted, GParted, or gdisk on the old disk.
  6. Create a new (empty) GUID partition table on the old disk. You do this in parted with the mklabel command, in GParted by using the Device->Create Partition Table dialog box and its Advanced option, and in gdisk by typing o in the main menu and then saving the changes with w. This should render the disk unbootable in BIOS mode, so it won't present the problem you're having now.
  7. Create new partitions and filesystems on the old disk. Be sure to use a GPT-aware tool, such as parted, GParted, or gdisk; do not use fdisk, cfdisk, or sfdisk!
  8. In the emergency system or after rebooting into your regular installation, begin using the old disk as a backup disk.

Of course, this procedure means that you won't be able to boot Windows XP or your old Linux installation. If you want to retain the ability to boot Windows XP, you'll need to look harder for a firmware-based solution; or perhaps you could do an image backup of the XP partition and try to run it using a virtual machine -- but a complete re-installation of XP makes more sense in that case.

  • Your answer sounds hopeful. I was thinking of somehow disabling the MBR on the old drive so there'd be nothing to boot there. Can I do that from the rescue CD using fdisk to just unflag the default partition (or something) - without having to wipe the drive? – littlenoodles Jan 16 '13 at 18:33
  • Either way, I don't care about keeping the ability to boot XP - or even my old linux /root partition. I just want to copy data from the XP partition and to move my old linux /home to the new drive. I assume you're recommending repartitioning the new GPT drive to allocate linux paritions prior to the whole rescue procedure, so I can move linux stuff to linux partitions? – littlenoodles Jan 16 '13 at 18:36
  • One other thing - if I could make linux see the old drive as SATA3, my boot problems would be moot - windows is fine with the old drive in SATA3, it's linux that can't see it there. – littlenoodles Jan 16 '13 at 18:37
  • Tried some more stuff. Booted gparted from a live flash drive and reset the boot flag on my old XP partition. No effect. Oddly, when I left the flash drive plugged in and tried to boot win7, it booted gparted - and I gitva graphical gparted boot menu whereas I got a text menu when I specifically asked to boot from flash. I think windows is doing the booting and has its own internal concept of boot order. In both the sata1 and flash cases, I get a "windows is loading files" progress bar prior to the is loading. I don't get that when there are no secondary drives and win7 boots itself. – littlenoodles Jan 17 '13 at 3:56
  • You can repartition the new drive either before or after moving data off the new one, but obviously before makes more sense if you have significant amounts of Linux data. You might be able to convert the old drive from MBR to GPT format without data loss by using gdisk and have it all work correctly, but it really depends on what's triggering your firmware to do boot the old disk in BIOS mode. Windows cannot be doing booting; that's the job of the firmware and any boot managers and boot loaders you have installed. That said, a Microsoft boot loader could be causing problems. – Rod Smith Jan 17 '13 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.