LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub dual boot issue (https://www.linuxquestions.org/questions/linux-newbie-8/grub-dual-boot-issue-663972/)

jnav 08-20-2008 12:22 AM

Grub dual boot issue
 
First off I'd like to state that'd I've read the guides posted on this site and many, many other sites but nothing seems to work.

I'm trying to dual boot XP along with debian 2.6.25-2-amd64. I installed xp first then proceeded to install debian. Since the installation I haven't been able to boot to XP, just debian.

I have three SATA drives: ATA0 = windows partition, then deb partition, then other space; ATA1 = 2 NTFS partitions for files, ATA2 = 1 NTFS partition. The weird thing is when I do fdisk -l I get

Code:

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1      91201  732572001    7  HPFS/NTFS

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1        2677    21502971    c  W95 FAT32 (LBA)
/dev/sdb2            2678      14835    97659135  83  Linux
/dev/sdb3          14836      15443    4883760  82  Linux swap / Solaris

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *          1      16708  134206978+  7  HPFS/NTFS
/dev/sdc2          16709      30401  109989022+  7  HPFS/NTFS

As you can see, that for some reason it "shows" the last drive to be the first one. So I did some digging around and when I look up my device.map file I get
Code:

 
(hd0) /dev/sda 
(hd1) /dev/sdb 
(hd2) /dev/sdc

Which is odd since in my menu.lst has:
Code:

title  Debian GNU/Linux, kernel 2.6.18-6-amd64 
root    (hd0,1) 
kernel  /boot/vmlinuz-2.6.18-6-amd64 root=/dev/sdb2 ro 
initrd  /boot/initrd.img-2.6.18-6-amd64 
savedefault 
 
title  Debian GNU/Linux, kernel 2.6.18-6-amd64 (single-user mode) 
root    (hd0,1) 
kernel  /boot/vmlinuz-2.6.18-6-amd64 root=/dev/sdb2 ro single 
initrd  /boot/initrd.img-2.6.18-6-amd64 
savedefault 
   
title Other operating systems: 
root 
 
title        Microsoft Windows XP Professional 
rootnoverify (hd0,0) 
savedefault 
makeactive 
chainloader  +1

So the menu.lst (and grub) show the "right" order of things but not fdisk/device.map. Anyways, I've tried many different configurations for the MS portion of grub loader and have yet to find one that'll work

linuxlover.chaitanya 08-20-2008 12:28 AM

Your windows partitions seem to be on different hard drives physically. But in menu.lst under windows title it shows hd0 which infact should be hd2 for you have windows on sdc and your device.map shows sdc to be hd2.

checkmate3001 08-20-2008 12:30 AM

What happens when you try to boot XP?

jnav 08-20-2008 12:57 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3253392)
Your windows partitions seem to be on different hard drives physically. But in menu.lst under windows title it shows hd0 which infact should be hd2 for you have windows on sdc and your device.map shows sdc to be hd2.

I'm confused :).

I tried following these steps http://www.linuxquestions.org/questi...hooter-278748/ and tried to do
map (hd2) (hd0)
map (hd0) (hd2)

then proceeded to follow the rest of the steps and still got the same thing I usually get, "NTLDR is missing".

Quote:

Originally Posted by checkmate3001
What happens when you try to boot XP?

I either get "NTLDR is missing" or something about "grub and stage 2" (it loads quickly back to grub menu screen) depending on what I've been trying to do in grub.

Larry Webb 08-20-2008 05:50 AM

You need to try

title Windows
root (hd2,0)
map (hd2) (hd0)
map (hd0) (hd2)
makeactive
chainloader +1

jnav 08-20-2008 02:20 PM

Quote:

Originally Posted by Larry Webb (Post 3253609)
You need to try

title Windows
root (hd2,0)
map (hd2) (hd0)
map (hd0) (hd2)
makeactive
chainloader +1

Did that, got filesystem type uknown, partition type 0x7

NTLDR is missing.

Is it possible that linux somehow screwed up but grub didn't? It seems like grub loader knows which partition/drive is the correct one (menu.lst) but linux doesn't (fdisk and device.map).

yancek 08-20-2008 03:35 PM

I believe the entry should be:
title Windows
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

jnav 08-20-2008 08:33 PM

Quote:

Originally Posted by yancek (Post 3254159)
I believe the entry should be:
title Windows
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

Got the same thing, NTLDR is missing.

syg00 08-20-2008 10:04 PM

That message comes out of the Windoze (partition) boot sector record, so it looks that's intact at least.
As per your first post should work for XP. Did you really install into a FAT32 (rather than NTFS) partition ???.

garyg007 08-20-2008 10:20 PM

Dont know if this will help, but it is an observation and assumptions based on
the fdisk listing that was posted.
Hope this is of some help.

Do you know for sure which of the drives that have an hpfs/ntfs file system actually contain the XP bootable system? You wrote that you installed XP first, that means it should be on sda1 - the question is "is it?"

I see from the fdisk listing that sda1 is NOT marked as bootable.

I believe you can do that (mark it bootable) with fdisk

If sda is, indeed, the bootable XP partition, you should not need the grub "map" parameters because xp well be where XP demands it to be and there is no need to try and out-fox it.

Remove the "savedefault" command - after reading the grub doc, I don't see where it does you any good (perhaps even problems)

Also, you probably should use fdisk to make sda1 bootable. The way I read the grub documentation, it doesn't sound like "makeactive" will make sda1 bootable.

Also, please review indicative information in the grub manual.
Here is a link to the grub document

jnav 08-21-2008 02:09 AM

Quote:

Originally Posted by garyg007 (Post 3254398)
Dont know if this will help, but it is an observation and assumptions based on
the fdisk listing that was posted.
Hope this is of some help.

Do you know for sure which of the drives that have an hpfs/ntfs file system actually contain the XP bootable system? You wrote that you installed XP first, that means it should be on sda1 - the question is "is it?"

I see from the fdisk listing that sda1 is NOT marked as bootable.

I believe you can do that (mark it bootable) with fdisk

If sda is, indeed, the bootable XP partition, you should not need the grub "map" parameters because xp well be where XP demands it to be and there is no need to try and out-fox it.

Remove the "savedefault" command - after reading the grub doc, I don't see where it does you any good (perhaps even problems)

Also, you probably should use fdisk to make sda1 bootable. The way I read the grub documentation, it doesn't sound like "makeactive" will make sda1 bootable.

Also, please review indicative information in the grub manual.
Here is a link to the grub document

Yah, I'm pretty sure I installed windows on the first drive first partition. I'm pretty sure since the other drives (NTFS data) I never touched. What I think is wrong is somehow linux thinks that the drive in the ATA0 (OS drive) is sdb instead of sda for some reason, I don't know why.

The good thing is that grub shows things correctly since it correctly states (in menu.lst) that hd0,1 is my linux partition. That's what is so troubling as well since if it sees hd0,1 as the linux partition then it should know that hd0,0 is the windows partition and boot to it.

I've looked over the gnu documents and read the troubleshooting guides as well as the command and I think I should be ok with just doing a rootnoverify (hd0,0) and be good to go, but it just isn't that way for some reason. I've also played with different variations, some with makeactive and some with savedefault and played with different mappings. I'm really dumbfounded.

pentode 08-21-2008 09:39 AM

FWIW, that seems like a very old version of Debian. You might want to check the Debian website.

yancek 08-21-2008 10:54 AM

Your Grub menu.lst entry shows Debian on (hd0,1) which is the same as sda2.
Your fdisk output shows Debian as sdb2 (hd1,1)
Your Grub menu.lst entry shows windows on (hd0,0) which is the same as sda1.
Your fdisk output shows windows as sdb1 (hd1,0).
fdisk also shows active bootable windows partitions on sdb1 (hd1,0) and sdc1 (hd1,0). It also shows a windows partition on sda1 (hd0,0) which is not marked bootable.

Your boot partition for windows should be on the first partition of one of the drives?? Did you have all three drives connected when you installed xp? when you installed Debian?

How big is your FAT32 partition? I recall reading on a microsoft support site that booting xp from a FAT32 partition is problematic if the partition is over 32GB.

garyg007 08-21-2008 11:08 AM

based on the fdisk and device.map info you show your linux partition is (hd1,1)
which is /dev/sdb2. Take a look at the menu.lst posted - look at the "kernel" line it shows root=/dev/sdb2 - this is consistant.

Are those sata drives connected to the sata ports on the motherboard, or are they connected to the IDE ports thru an adaptor?

Have you moved any cables?

I'm going to take another look at the grub docs and see if I can find anything else.

garyg007 08-21-2008 11:55 AM

Try This: First using fdisk, make /dev/sda bootable then change menu.lst to show this for booting XP
Code:

title        Microsoft Windows XP Professional 
rootnoverify (hd0,0) 
chainloader  +1


jnav 08-21-2008 02:29 PM

Just wanted to say that I "fixed" it. I was looking at my windows partition and noticed that it was using H:\ and since every drive had the boot flag enabled I'm guessing that's how it happened. So, I removed the boot flags from all partition, reinstalled windows then proceeded to use a live cd to reinstall grub.


All times are GMT -5. The time now is 01:15 AM.