Quad-booting a system with linux and windows

jms1989

Member
Hello, I've got a question I need to run by ya'll.

Here's my setup, I've got Ubuntu, Windows XP, Windows 7 Beta, and I'm thinking on trying Fedora to learns some things on its side of linux.

I've got 3 hdds. One with Ubuntu and WinXP, the second with Win7, and the third for just storage.

/dev/sda{1,2} consists of a partition for windows and one for linux.
/dev/sdb{2,3,6} consists Ubuntu on #2, WinXP on #3, and possibly Fedora on #6
/dev/sdc1 is Win7

The setup works but I want to be able to boot both windows os from grub but the windows boot loader for 7 has taken over the XP boot loader. So my question is, how can I restore the xp boot loader and install the win7 boot loader on sdc1 so it will boot from grub without spitting an error out at me saying its boot loader is missing? Once that's fixed, I could then edit boot.ini for win7 to only boot itself.

The way it stands now is, I have ubuntu, xp, and 7 added to my grub menu. Once the computer gets to grub and I select Windows XP, it loads the Win7 bootloader with the option to boot either 7 or XP. There is another entry for 7 but if I select that it tells me the bootloader is missing.

I imagine its as simple as booting each setup disk and restoring the booloader for xp but what about 7? It just boots to a gui and not that lovely text-based setup menu xp has. Would I need to backup and copy the win7 bootloader from the xp partition and then restore its rightful boot loader?

Suggestions and help is welcome, jms1989.

Partition Info
Code:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e6777

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       39163   314576766    7  HPFS/NTFS
/dev/sda2           39164      121601   662183235   83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x58455f47

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         261     2096451   82  Linux swap / Solaris
/dev/sdb2             262        5483    41945715   83  Linux
/dev/sdb3   *        5484       12010    52428127+   7  HPFS/NTFS
/dev/sdb4           12011       60801   391913707+   5  Extended
/dev/sdb5           12011       13315    10482381   83  Linux
/dev/sdb6           13316       21148    62918541   83  Linux
/dev/sdb7           21149       60801   318512691   83  Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb398cd0a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       60802   488384512    7  HPFS/NTFS
 
Hi jms. Welcome to NST.
Please boot into Win 7, and take a screenshot of the Disk Management screen, and then upload it in your next post. That way we can get a clearer picture of your situation...:wink:
So you say when you select the XP entry in the Grub menu, it starts the Win 7 bootloader? That means your XP entry in your menu.lst on the Ubuntu partition must be pointing at the wrong partition...and not only that, but the wrong drive as well! You must have it pointed at the location of (hd2,0) in the root line, when it really should be pointed at (hd1,2)...
Your Win 7 bootloader on sdc1 is obviously working perfectly fine, if you get to that menu when you select the XP entry, and you can boot into Win 7 from it...

Cheers.

-Coolname007
 
Last edited:
Copy the XP entry in menu.lst and post again in there for Win 7 in grub's menu.lst file. Than make sure the orginal XP entry in grub's menu.lst is referring to the correct disk/partition for XP (or your active partition) and that ntldr, ntdetect.com, and boot.ini are there. Than add a kernel line above the chainloader line. "/ntldr" should do, assuming ntldr is located there. Should boot XP directly than without bootmgr popping up. The copied entry should be used for Windows 7. Use EasyBCD to add an entry for it to the Windows bootmgr, and remove the bad entry for Windows 7 giving you errors from the menu.lst file.

Sample entry that directly boots xp:

Code:
title Windows XP
root (hd0,1)
kernel /ntldr
chainloader /ntldr
 
A syntax like this for the XP entry would possibly work better:

Code:
title Windows XP
root (hd1,2)
chainloader +1
If necessary, add a "makeactive" line to it. Oh, and since its a drive other than 0, you would also need to add map lines to it as well...

-Coolname007

EDIT: And if you happened to see where I said put "(hd1,1)" for the XP entry in my first post, then just ignore that...it was a typo, and I've already corrected it with "(hd1,2)".
 
Last edited:
That would work cool, if the bootsector was installed properly in said location for ntldr. Adding the kernel line/modified chainloader line specifically tells grub to chainload /ntldr in said location regardless of the state of the partition's bootsector.
 
Hmm, I'll post my menu.lst file for you. Now when I select the xp entry it goes to the win7 bootmgr. I know it points to the xp partition and after looking at xp's files, I see that 7 placed it boot files onto xp's partition. I'm pretty sure grub points to the right partitions and I'm guessing if I add that ntldr entry for xp, it should boot xp directly so how would I go about moving 7's boot files to its partition and setting it so that it will boot even if hd0 was disconnected or the boot order was adjusted?

Code:
title        Ubuntu 8.10, kernel 2.6.27-11-server
uuid        7abed22e-2754-4730-be51-ed912efa1bd6
kernel        /boot/vmlinuz-2.6.27-11-server root=UUID=7abed22e-2754-4730-be51-ed912efa1bd6 ro quiet splash 
initrd        /boot/initrd.img-2.6.27-11-server
quiet

title        Ubuntu 8.10, kernel 2.6.27-11-server (recovery mode)
uuid        7abed22e-2754-4730-be51-ed912efa1bd6
kernel        /boot/vmlinuz-2.6.27-11-server root=UUID=7abed22e-2754-4730-be51-ed912efa1bd6 ro  single
initrd        /boot/initrd.img-2.6.27-11-server

title        Ubuntu 8.10, kernel 2.6.27-7-generic
uuid        7abed22e-2754-4730-be51-ed912efa1bd6
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=7abed22e-2754-4730-be51-ed912efa1bd6 ro quiet splash 
initrd        /boot/initrd.img-2.6.27-7-generic
quiet

title        Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid        7abed22e-2754-4730-be51-ed912efa1bd6
kernel        /boot/vmlinuz-2.6.27-7-generic root=UUID=7abed22e-2754-4730-be51-ed912efa1bd6 ro  single
initrd        /boot/initrd.img-2.6.27-7-generic

title        Ubuntu 8.10, memtest86+
uuid        7abed22e-2754-4730-be51-ed912efa1bd6
kernel        /boot/memtest86+.bin
quiet

title        Windows XP Home Edition
root        (hd0,2)
makeactive
chainloader    +1

title           Windows 7 Ultimate
root            (hd1,0)
makeactive
chainloader     +1
 
That would work cool, if the bootsector was installed properly in said location for ntldr. Adding the kernel line/modified chainloader line specifically tells grub to chainload /ntldr in said location regardless of the state of the partition's bootsector.

As far as I know the bootsector is installed properly, i.e. the XP bootsector exists on the XP partition. :wink: It seems to me his problem is that only his XP entry is pointed at a partition other than XP's in his menu.lst...

-Coolname007
 
Last edited:
Ok, so copy the following and paste it again in the menu.lst file:

title Windows XP Home Edition
root (hd0,2)
makeactive
chainloader +1

Now with the first copy, change it so it is the following, assuming your ntldr and other XP boot files are on /dev/sda2:

title Windows XP Home Edition
root (hd0,2)
kernel /ntldr
makeactive
chainloader /ntldr

Now with the copied entry, leave as is for Windows bootmgr (May want to rename the title there). Delete the Win 7 entry since it isn't working. Now with EasyBCD add a new entry for Windows 7 and it should appear in the bootmgr menu after you've selected the copied entry.
 
I know it points to the xp partition and after looking at xp's files, I see that 7 placed it boot files onto xp's partition. I'm pretty sure grub points to the right partitions and I'm guessing if I add that ntldr entry for xp, it should boot xp directly so how would I go about moving 7's boot files to its partition and setting it so that it will boot even if hd0 was disconnected or the boot order was adjusted?

Code:
title        Windows XP Home Edition
root        (hd[B]0[/B],2)
makeactive
chainloader    +1

title           Windows 7 Ultimate
root            (hd1,0)
makeactive
chainloader     +1
According to your first post, you said XP was installed to the second hard drive (sdb3, which translates to (hd1,2) ). :wink: So how can the above XP entry be possibly correct, if its pointed at drive 0, partition 2 (sda3)?
/dev/sda{1,2} consists of a partition for windows and one for linux.
/dev/sdb{2,3,6} consists Ubuntu on #2, WinXP on #3, and possibly Fedora on #6
/dev/sdc1 is Win7

But seeing as Win 7 installed its boot files (you said) to XP's partition, then you would likely still get to the Win 7 created menu when you boot into XP, even if the XP entry was pointed where it should...:wink:

-Coolname007
 
Which is why specifying to grub where to go may be crucial, when otherwise the bootsector instructions would just load bootmgr instead of immediately chainloading ntldr to load XP.
 
Which is why specifying to grub where to go may be crucial, when otherwise the bootsector instructions would just load bootmgr instead of immediately chainloading ntldr to load XP.

True. Good point. :wink:
But I still think his XP entry is pointed at the wrong place, and would be still even after following your instructions...

-Coolname007
 
According to your first post, you said XP was installed to the second hard drive (sdb3, which translates to (hd1,2) ). :wink: So how can the above XP entry be possibly correct, if its pointed at drive 0, partition 2 (sda3)?


But seeing as Win 7 installed its boot files (you said) to XP's partition, then you would likely still get to the Win 7 created menu when you boot into XP, even if the XP entry was pointed where it should...:wink:

-Coolname007

That's very true but since sdb is my boot device, it appears as hd0 to grub. Linux sees my boot drive as sdb but grub and windows' bootloader see it as hd0 and device(0), respectivly. I modified my menu.lst file for xp to:

Code:
title        Windows XP Home Edition
root        (hd0,2)
kernel     /ntldr
makeactive
chainloader     /ntldr

I'm going to reboot to see if that works. Now what files to I need to move to the win7 partition so the grub entry can work? I know I need to move \boot and bootmgr, what am I missing?

Addendum:

Ok, so that didn't work. It claimed it couldn't mount boot device, I think error 17. ?? Changed it back to where I had it.

I'm thinking all I really need to do is fix each boot loader so they will just boot their intended os on the windows side.
 
Last edited:
That's very true but since sdb is my boot device, it appears as hd0 to grub. Linux sees my boot drive as sdb but grub and windows' bootloader see it as hd0 and device(0), respectivly.
Ok...so what you actually meant was XP is installed to the *first* (not the second) hard drive in the boot priorty/sequence, which has Grub installed to the MBR of that drive. :smile: All clear now.
while I modified my menu.lst file for xp to:

Code:
title        Windows XP Home Edition
root        (hd0,2)
kernel     /ntldr
makeactive
chainloader     /ntldr
I'm going to reboot to see if that works. Now what files to I need to move to the win7 partition so the grub entry can work? I know I need to move \boot and bootmgr, what am I missing?
Good luck. Let us know how it goes. :wink:
You don't need to move anything, seeing as your XP partition is "active" and "system", and contains your Win 7 boot files, along with XP's. If Win 7's boot files are indeed on XP's partition, then the XP partition will contain the /boot folder, along with "bootmgr", and that is where they need to be anyway. If you try to move anything, you would likely screw up something else, so just leave it as it is, and reboot, and see what happens.

Cheers.

-Coolname007
 
Last edited:
Well if your sure your pointing to the right place for XP's partition and ntldr, ntdetect.com, and boot.ini are located there and your boot.ini is correct (which it should be if you're able to get into XP), than it should work just fine.
 
Ok, so that didn't work. It claimed it couldn't mount boot device, I think error 17. ?? Changed it back to where I had it.

I'm thinking all I really need to do is fix each boot loader so they will just boot their intended os on the windows side.

If you're getting an error 17 now, then that simply means the entry is pointed at the wrong place, which is what I originally thought...:wink: Please post a screenshot of Disk Management from Win 7, as I suggested in the first post. I want to see firsthand your drive and partitioning setup from Win 7's perspective.

Cheers.

-Coolname007
 
Last edited:
Hmm, maybe I should of mentioned in the beginning that I wanted it so if I decided I didn't like 7, I could just wipe it from it partition and delete the entry in grub and everything would be fine and dandy. It would of worked if I had unplugged my main boot drive or changed the boot order when I installed 7. :frowning: Now I need to move everything that's related to 7 in xp's partition to 7's so that they should boot independently, even if I removed 7.
 
Last edited:
Hmm, maybe I should of mentioned in the beginning that I wanted it so if I decided I didn't like 7, I could just wipe it from it partition and delete the entry in grub and everything would be fine and dandy. It would of worked if I had unplugged my main boot drive or changed the boot order when I installed 7. :frowning: Now I need to move everything that's related to 7 in xp's partition to 7's so that they should boot independently, even if I removed 7.

Don't move your Win 7 boot files. :tongueout:oint: If you do, then Win 7 wont be able to boot. Keep them on XP's partition, and go ahead, and post that screenshot. :wink:

-Coolname007

EDIT: I see you already did...
Hold on while I take a look at it.
 
Last edited:
Ok, so now please post the output of the following command run from EasyBCD's Power Console in the "Useful Utilities" section (assuming of course you've got EasyBCD installed in Win 7):

Code:
bootpart
Also, do you know if you have an IDE/SATA drive mix? If you're truly booting from the XP partition (into Win 7), then it should be showing as Disk 0, not 1, in Disk Management...

EDIT: And I'm assuming that screenshot was taken after booting into Win 7 from Grub, correct? What I mean is you selected the XP entry in the Grub, got to the Win 7 menu, and then chose to boot into Win 7?
 
Last edited:
Your assumption is correct. Currently, to get to windows 7 I have to, from grub, select windows xp to get to thge win7 boot menu, then select windows 7.

Here is the output from bootpart:

Boot Partition 2.60 for WinNT/2K/XP (c)1995-2005 G. Vollant (info@winimage.com)
WEB : Gilles Vollant software and BootPart
Add partition in the Windows NT/2000/XP Multi-boot loader
Run "bootpart /?" for more information

Physical number of disk 0 : e6777
0 : C:* type=7 (HPFS/NTFS), size= 314576766 KB, Lba Pos=63
1 : C: type=83 (Linux native), size= 662183235 KB, Lba Pos=629153595
Physical number of disk 1 : 58455f47
2 : D: type=82 (Linux swap), size= 2096451 KB, Lba Pos=63
3 : D: type=83 (Linux native), size= 41945715 KB, Lba Pos=4192965
4 : D:* type=7 (HPFS/NTFS), size= 52428127 KB, Lba Pos=88084395
5 : D: type=5 (Extended), size= 391913707 KB, Lba Pos=192940650
6 : D: type=83 (Linux native), size= 10482381 KB, Lba Pos=192940713
7 : D: type=5 (Extended), size= 62918572 KB, Lba Pos=213905475
8 : D: type=83 (Linux native), size= 62918541 KB, Lba Pos=213905538
9 : D: type=5 (Extended), size= 318512722 KB, Lba Pos=339742620
10 : D: type=83 (Linux native), size= 318512691 KB, Lba Pos=339742683
Physical number of disk 2 : b398cd0a
11 : E:* type=7 (HPFS/NTFS), size= 488384512 KB, Lba Pos=2048
Physical number of disk 3 : 4030201
12 : F:* type=b (Win95 Fat32), size= 3927516 KB, Lba Pos=1096
Physical number of disk 4 : 44fdfe06
13 : G:* type=c (Win95 Fat32 LBA), size= 488384001 KB, Lba Pos=63
Physical number of disk 5 : b0235
14 : H: type=b (Win95 Fat32), size= 7865839 KB, Lba Pos=32
EDIT: I have 3 sata disks.

Edit 2: I found a article in the wiki that can restore vista's or in my case 7's boot loader. If I set the default boot device in the bios to 7's disk, it will boot without a menu. Great! Now I need to fix xp so that it boots when I select it from grub. I will try booting 7 from grub after I delete some old files. :smile:

Is it possible to restore xp's bootloader from EasyBCD?

UPDATE: Well, I'll be, it worked. I can call 7 and xp from grub with no extra menus. :smile: I just needed to restore the vista boot loader to 7's partition and delete \boot and bootmgr from xp's partition for it to boot normally. Now, on to finding a working driver for my atheros network adaptor for 7.

Excellant! Thanks for stearing me in the right direction. :smile:
 
Last edited:
Back
Top