Get my dual-boot back
June 9, 2009 5:12 PM   Subscribe

DualBootFilter: I've moved a Windows XP hard drive into a new machine, in a physically different configuration, and I think I need to fix boot.ini and maybe the mbr but I'm not sure how. Difficulty: new location is a secondary drive to a primary Linux drive running GRUB. Help?

OK so I've done some googling and even searching of askmefi, but I am feeling dumb about this so I need someone to spell it out for me.

Here's the longer story:
I used to have a dual-boot setup, with Linux as the primary boot device, running GRUB, as Primary IDE disk. Windows was a SATA disk, plugged in as the first SATA drive.

Now, I've got a new Linux installation that's on a SATA drive, and want to be able to boot the old Windows as well.
Linux is now the first SATA drive, and Windows is the second.
Linux is running GRUB, and recognizes the Windows partition as something bootable. From within Linux, I can even mount the NTFS partition and read and write files.
Unfortunately, when I try to boot the Windows partition, I get a blue screen that flashes by too fast (looks more like a chkdsk screen than a BSOD, if I blink), followed by a reboot which brings me back to my GRUB menu.
I've narrowed this down to probably being an issue with boot.ini, but a Windows XP bootable cd doesn't seem to be able to see the partition with the "bootcfg" command at all, so I can't use those tools.
I'd love to be able to use some magic to edit boot.ini in a text editor and at least get that Windows installation booting to Safe Mode.
I've tried a few things, but I get a variety of different errors depending on where I modify the numbers, from "Cannot load hal.dll" to "your boot device is corrupt"

So, hivemind, what can I do to convince the Windows drive that it can boot, without corrupting GRUB? Or is the blue-screen-that-passes-by telling me something worse is wrong?

The (original) contents of the boot.ini in question:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect


and the contents of the "Windows XP" section of my grub/menu.lst:
title Microsoft Windows XP Home Edition
rootnoverify (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
posted by jozxyqk to Computers & Internet (8 answers total)
 
Response by poster: Update: Upon one more desperate test, it looks like a *new* blue screen which *does* look more BSOD-y, is appearing for the brief fraction of a second before spontaneously rebooting now. Is it a lost cause? Reinstalling Windows from scratch on the drive is not completely out of the question, especially since I can save a full backup of stuff.
posted by jozxyqk at 5:31 PM on June 9, 2009


You need to reinstall, Windows is looking for hardware that isn't there/not looking for the hardware that is. Even if you got it working there's no guarantee it would be particularly stable. You've created a big ball of driver conflicts.
posted by Phyltre at 7:13 PM on June 9, 2009


Phyltre is right. But note that a Widnows reinstall will overwrite the boot disk's MBR and possibly screw up grub. (I don't know enough about configuring grub to advise on that, though.)
posted by anadem at 9:35 PM on June 9, 2009


You need to do a Windows reinstall (a repair install should work, and preserve all your existing accounts, apps and settings). Windows does not like having its hardware switched out from underneath an installation. There are ways to deal with that but a repair install will usually cost you less time and grief.

Do the repair install with the Linux drive physically disconnected from the PC. That way, Windows won't trash the bootloader in your Linux drive's MBR. This will make Windows believe it's supposed to run from the first hard drive.

After verifying that it boots and runs this way, I'd plug in the Linux drive and see if it all Just Works again. There's a fair chance it will, because the map commands in your menu.lst file are telling GRUB to fiddle with the BIOS-mandated drive ordering; by the time the Windows boot loader gets control, GRUB will have made it look like the Windows drive is once again the first one.
posted by flabdablet at 11:16 PM on June 9, 2009


Response by poster: Unfortunately, after trying flabdablet's solution, the situation looks grimmer.
Booting with the XP CD with just the XP drive in the box, it doesn't recognize it as an NTFS partition at all, and "detects no windows installations".

Looks like a fresh reinstall is my only option.

Thanks for the advice though.
posted by jozxyqk at 4:48 PM on June 10, 2009


Vanilla XP installer CDs don't know what to do with SATA hard disks unless you feed them a SATA driver on a floppy (you know the part where you're asked to press F6 to install additional SCSI or RAID drivers? That thing). Unless you deal with that issue, neither a repair install nor a full one will work.

You will need to download an "F6 driver" for your SATA card from its manufacturer's support site. These things are generally supplied as Windows executables that prepare a suitable floppy disk, which won't help you much if you don't currently have a functioning Windows box. Sometimes the executable is a self-extracting Zip or Rar archive and the Ubuntu archive manager will be able to open it up and show you the floppy image buried within. Post back if you need more help to get your F6 floppy prepared.

If your new machine doesn't have a floppy drive, your best way forward is to find a friend with a functioning Windows box and run nLite on it to prepare a modified XP installer CD with the correct F6 driver preinstalled.
posted by flabdablet at 7:09 AM on June 11, 2009


Response by poster: PROGRESS REPORT (for those of you still watching this thread):

Along the same lines of what flabdablet was suggesting, I found a BIOS setting to disable "AHCI" management of hard drives.

This got WIndows to boot!
Just like that.

I had to re-Activate the windows installation (and had to use the phone because network still is mysteriously not working).

After that, I just started installing drivers off the motherboard and video card CDs, and about 90% of it is already working, without any sort of "recovery install".
Of course, one of the things that still isn't set up correctly is AHCI support, but I'm working on that!

Sure there may be some instability, but I don't need to boot to windows more than like once a year when I have the itch to play a DirectX game.
This is good enough for me.. will continue to try to get drivers working.

If you're interested in continuing this thread and finding out more epilogue, me-mail me please.
posted by jozxyqk at 5:03 PM on June 11, 2009


Response by poster: final followup: still can't boot into Windows with AHCI enabled, but it works in SATA mode.. I'm planning on wiping the whole Windows installation and getting a fresh new copy of Win7 in the fall, which should make that issue go away.
posted by jozxyqk at 1:53 PM on July 10, 2009


« Older With what gratitude, what joy!   |   What to do, and where to meet people, in... Newer »
This thread is closed to new comments.