Jump to content

Booting Windows On a Non-1st HD Using GRUB


V.T. Eric Layton

Recommended Posts

V.T. Eric Layton

If you have multiple hard drives on your system and have Windows installed on the 1st partition (where it must be to operate) of your non-boot (1st) drive, then you have to make a few changes in how you boot using GRUB. Let's say you have two SATA drives. In GRUBspeak, they are (hd0) and (hd1). And let's say that your primary operating system (Linux) is on (hd0) and your Windows is on (hd1). To chainload Windows with GRUB you'll need an entry similar to this:

title	 Windowsroot	 (hd1,0)savedefaultmap	  (hd0) (hd1)map	  (hd1) (hd0)chainloader +1

What the "map" entries do is to trick GRUB into thinking that Windows is on the 1st hard drive.Now here's a recent problem I had...Last night, after a weekend long install-fest, I realized that my Windows installation would not boot using GRUB. To check Windows integrity, I used fdisk to set a bootable flag on my secondary SATA drive (where Windows is located). This will force a bypass of GRUB on my primary drive and boot the secondary drive directly using whatever bootloader is present in the MBR of that drive (in this case, Windows bootloader). The Windows installation booted fine this way. That told me that my GRUB - menu.lst entry for Windows was not correct.I had never booted this installation of Windows since installing it. It's there to play games on my system and that's about it. My Windows doesn't even have Network capabilities enabled. Anyway, I have a unique situation on my system because it's a hybrid of EIDE and SATA drives. GRUB gets confused on how it identifies my SATA drive because of this. It calls my 1st SATA (hd0), which is correct. However, it thinks my 2nd SATA is (hd2), which would normally be the designation for a third SATA drive, not a second one. This really confused me too, when I first started adding entries to my menu.lst for booting alternate operating systems. I've gotten used to it by now, though.The problem with my Windows menu.lst entry was that the drives were misidentified (my boo-boo). To get it to work on my system, I had to make my entry thus:

title	 Windowsroot	 (hd2,0)savedefaultmap	  (hd0)(hd2)map	  (hd2)(hd0)chainloader +1

That did the trick. I can now load S.T.A.L.K.E.R. Shadow of Chernobyl and go kill some mutants. ;)Have while you're learning. B)

Link to comment
Share on other sites

Good info. I make life easy by having Windows on the first partition of the first drive, and not mixing SATA and IDE drives (I put IDE in external USB boxes).And I can't imagine why you have savedefault in your GRUB entry. Why would you ever want Doze to start automatically when it was the last OS booted?

Link to comment
Share on other sites

V.T. Eric Layton

Myeh... the stock Debian menu.lst had it that way. I just never changed it. And it doesn't work anyway because Winduhs definitely does NOT auto-boot on my system. The default boot OS is ALWAYS Slackware. B)

Link to comment
Share on other sites

Myeh... the stock Debian menu.lst had it that way. I just never changed it. And it doesn't work anyway because Winduhs definitely does NOT auto-boot on my system. The default boot OS is ALWAYS Slackware. :P
savedefault works for me. I only have it for Lenny, my main OS. Of course you also need
default  saved

in the "default" entry near the top.I use Sidux' GRUB as it's prettier, and if I have a number as default it changes whenever I add a new kernel in Sidux - ie. regularly. B) :thumbsup:

Link to comment
Share on other sites

Frank Golden

An aside here. While it is true that Windows XP needs to be on the first partition of any drive to work, Win 7 can be anywhere.I have it installed on sda10 with XP at sda1.All this is installed on my main internal drive with several linux distros. Hardy at sda5 is where menu.lst is and the entry for Windows automatically created when I installed Hardy after XP. Later installing Win 7 wiped out my Grub and replaced it with Win 7/older version of Windows boot menu. Using super grub to restore Grub to sda5 created a hybrid menu where clicking on the Windows menu item brings up the Win 7/ older version of Windows menu.No fussing around with creating chainload entries etc.

Edited by Frank Golden
Link to comment
Share on other sites

An aside here. While it is true that Windows XP needs to be on the first partition of any drive to work, Win 7 can be anywhere.No fussing around with creating chainload entries etc.
Hello FrankCorrect me if I am wrong. I believe that win XP can be anywhere on the drive Including a second hard drive, But only the Boot loader has to be on the first partition, Unless you are using a 3rd party boot manager like boot it NT.Mel B)
Link to comment
Share on other sites

V.T. Eric Layton

The Windows XP disk will not let you install on any partition but #1 as far as I can remember. That's been my experience. I don't have time at the moment to Google documentation about this, though. I could always be wrong, but I distinctly remember the Windows XP installation not allowing me to put Windows anywhere but partition #1. I could be wrong. It's happened before. B)

Link to comment
Share on other sites

The Windows XP disk will not let you install on any partition but #1 as far as I can remember. That's been my experience. I don't have time at the moment to Google documentation about this, though. I could always be wrong, but I distinctly remember the Windows XP installation not allowing me to put Windows anywhere but partition #1. I could be wrong. It's happened before. :)
Sorry Eric, But you are wrong. It can be done as I have done it. You can put XP on any primary partition as long as the boot loader (boot.ini), (NTLDR) and another file I forget which one, is on the C drive (1st Partition) or if you use a Boot manager such as Boot-it-NG Boot magic or have Vista Installed. It can also be installed on a Logical Partition but that is a little more involved.Example: Not using any add-in boot-manager utils, you can install the actual OS itself - its system folders/files - to a logical drive..., but the actual boot/start-up files "must" be in the active Primary partition... The ARC/path-statement will point to the correct location of the ntldr etc. and thus boot the OS (XP - or W2K/NT) that is installed in other than the active Primary...I have a feeling that even using a decent boot-util the same condition applies. The only difference being that the boot-util slips itself into the active Primary etc., replaces the NT style boot-menu and efffectively controls what boots and how...Take a look at the Boot.ini file in the windows C drive to get a better picture of what is going on. It is hidden so you will have to change the attributes.Mel B) Edited by mhbell
Link to comment
Share on other sites

V.T. Eric Layton

Hmmm... well, you learn sumthin' new ever day. Yup! :w00t:From Microsoft:

Also, you must have 30 MB free space on the first primary system partition for installation. The first primary system partition is the disk volume that contains the hardware-specific files that you must have to start Windows. For example, the primary system partition contains the Ntldr, Boot.ini, and Ntdetect.com files.
http://support.microsoft.com/kb/326583/en-usH3ll, for that you basically must install Windows on the first partition.. at least part of it. Either that or make a first partition that is 30Meg so you can have this stuff on it. You won't be able to put anything else with that data, like another non-Windows OS. Either way the FIRST PARTITION MUST BE USED BY WINDOWS, so I'm basically correct... technically speaking. Edited by V.T. Eric Layton
Link to comment
Share on other sites

Frank Golden
Hmmm... well, you learn sumthin' new ever day. Yup! :w00t:From Microsoft:http://support.microsoft.com/kb/326583/en-usH3ll, for that you basically must install Windows on the first partition.. at least part of it. Either that or make a first partition that is 30Meg so you can have this stuff on it. You won't be able to put anything else with that data, like another non-Windows OS. Either way the FIRST PARTITION MUST BE USED BY WINDOWS, so I'm basically correct... technically speaking.
Yep Eric you are correct, With Win 7 you can install to any suitable partition on your drive. No messing around with where ntldr or other needed files are installed. All done for you by the installer.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...