GRUB, SATA and mysterious drive numbers
Hi I'm trying to set up SUSE 9.0 on a new box with a P4 on an Intel D875PBZ board like another recent poster. I have: 1 PATA drive (pri master), 1 DVD (sec master) and 2 SATA drives. I have installed the system onto the first SATA drive (I'll call it SATA0) but am having trouble with the final stage of reconfiguring the drives and GRUB. To do the install, I set the BIOS to Legacy mode and asked for both SATA drives and the PATA Sec Master (DVD). (Note that the PATA drive is not selected - it isn't possible to select it as well as the DVD and a SATA drive and contrary to other reports it is NOT necessary to have or use one to do the install.). Boot from the DVD and install to the first SATA drive, which appears as hda. So far so good, running system with network and everything. Will happily reboot itself from disk using GRUB. The problem comes when I reset the BIOS to Enhanced mode, so I'll be able to see the PATA disk as well. I've told the BIOS that SATA0 takes precedence in boot order, so GRUB starts OK. If I stop the boot and go into GRUB's command line I can then see from the partition tables that it is seeing SATA0 as (hd0), SATA1 as (hd1) and PATA as (hd2). I have a menu entry: kernel (hd0,0)/boot/vmlinuz root=/dev/hda0 initrd (hd0,0) That fails saying: sh2021: reiserfs_read_super: can not find reiserfs on ide0(3,1) Kernel panic: VFS: Unable to mount root fs on 03:01 I have another menu entry: kernel (hd0,0)/boot/vmlinuz root=/dev/hde0 initrd (hd0,0) This gets further. It appears to load the kernel and various drivers such as ethernet, usb but the root file system fails its fsck (my /etc/fstab says /dev/hda1 / reiserfs defaults 1 1) : reiserfs_open: the reiserfs superblock cannot be found on /dev/hda1. The system then boots into maintenance mode. df says that /dev/hda1 is mounted on / and I can browse the reiserfs file system that is on the first partition of SATA0. I also have a device.map file that says: (hd0) /dev/hda (hd1) /dev/hdc (hd2) /dev/hde (hd3) /dev/hdg But when I ask cfdisk to inspect /dev/hda it shows me the partition table for the PATA disk and when I ask to see /dev/hde it shows me SATA0. Within dmesg there are lines saying: PIIX-4 ... ide0: ... hda:DMA ... ide1: ... hdc:DMA ... ICH5-SATA ... ide2: ... hde:DMA ... ide3: ... hdg:DMA ... hda: ST3120022A, ATA DISK drive [ this is the PATA model number ] hdc: SAMSUNG DVD-ROM ... hde: ST3120026AS, ATA DISK drive [ this is the SATA model number ] hdg: ST3120026AS, ATA DISK drive [ this is the SATA model number ] If I edit my /etc/fstab to refer to /dev/hde1 then reiserfs is detected, fsck'ed and mounted OK (the system then locks up but that's another subject!) I'm confused!!! (hair being pulled out) It seems as though (hd0) is the SATA drive when GRUB starts but somehow /dev/hde (hd2?) becomes the SATA drive. Looking at the dmesg, I'd kind of expect SATA0 to be (hd2) from the get go. Can anybody explain what's happening? Also in the hope that this may help someone. Cheers, Dave
Hello Dave, Wednesday, January 28, 2004, 9:51:09 AM, you wrote: ... DH> PIIX-4 ... DH> ide0: ... hda:DMA ... DH> ide1: ... hdc:DMA ... DH> ICH5-SATA ... DH> ide2: ... hde:DMA ... DH> ide3: ... hdg:DMA ... DH> hda: ST3120022A, ATA DISK drive [ this is the PATA model number ] DH> hdc: SAMSUNG DVD-ROM ... DH> hde: ST3120026AS, ATA DISK drive [ this is the SATA model number ] DH> hdg: ST3120026AS, ATA DISK drive [ this is the SATA model number ] This would be correct. You have 2 PATA channels (4 devices) and 2 SATA channels (2 devices): PATA: IDE 0,0 = hda IDE 0,1 = hdb IDE 1,0 = hdc IDE 1,1 = hdd SATA: SATA0 = hde SATA1 = hdg DH> If I edit my /etc/fstab to refer to /dev/hde1 then reiserfs is detected, DH> fsck'ed and mounted OK (the system then locks up but that's another DH> subject!) As I would expect (not the lock up) when you disable "Legacy" mode on the SATA interfaces. DH> I'm confused!!! (hair being pulled out) DH> It seems as though (hd0) is the SATA drive when GRUB starts but somehow DH> /dev/hde (hd2?) becomes the SATA drive. Looking at the dmesg, I'd kind DH> of expect SATA0 to be (hd2) from the get go. DH> Can anybody explain what's happening? When you enable "Legacy" mode in bios, SATA0 & SATA1 are mapped to IDE 0,0 and IDE 0,1 (unless your bios offers additional mapping options), and ignores whatever may be connected to your primary PATA interface. So, when you install with your bios in compatibility mode, GRUB sees SATA0 as IDE 0,0. Once you disable compatibility mode, GRUB sees your primary drive on IDE channel 1 as IDE 0,0, and adds your SATA interfaces to the end of the list. I'm only going by my single experience with installing Suse to an SATA interface (I didn't have to use compatibility mode), so I hope someone corrects me if I'm wrong with the following recommendation... I'd say try this for a GRUB entry: kernel (hd2,0)/boot/vmlinuz root=/dev/hde0 initrd (hd2,0) I'm far from a "knowledgeable" user, but I think there are also some drive remapping options in GRUB. Unfortunately, I cannot tell you what they are. I'm sure one of the more knowledgeable users here can correct my mistakes and guide you further. HTH and good luck! -- Best regards, Brian Curtis
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 28 January 2004 13:31, Brian Curtis wrote:
Hello Dave,
Wednesday, January 28, 2004, 9:51:09 AM, you wrote:
...
DH> PIIX-4 ... DH> ide0: ... hda:DMA ... DH> ide1: ... hdc:DMA ... DH> ICH5-SATA ... DH> ide2: ... hde:DMA ... DH> ide3: ... hdg:DMA ... DH> hda: ST3120022A, ATA DISK drive [ this is the PATA model number ] DH> hdc: SAMSUNG DVD-ROM ... DH> hde: ST3120026AS, ATA DISK drive [ this is the SATA model number ] DH> hdg: ST3120026AS, ATA DISK drive [ this is the SATA model number ]
This would be correct. You have 2 PATA channels (4 devices) and 2 SATA channels (2 devices):
PATA: IDE 0,0 = hda IDE 0,1 = hdb IDE 1,0 = hdc IDE 1,1 = hdd
SATA: SATA0 = hde SATA1 = hdg
DH> If I edit my /etc/fstab to refer to /dev/hde1 then reiserfs is detected, DH> fsck'ed and mounted OK (the system then locks up but that's another DH> subject!)
As I would expect (not the lock up) when you disable "Legacy" mode on the SATA interfaces.
DH> I'm confused!!! (hair being pulled out)
DH> It seems as though (hd0) is the SATA drive when GRUB starts but somehow DH> /dev/hde (hd2?) becomes the SATA drive. Looking at the dmesg, I'd kind DH> of expect SATA0 to be (hd2) from the get go.
DH> Can anybody explain what's happening?
When you enable "Legacy" mode in bios, SATA0 & SATA1 are mapped to IDE 0,0 and IDE 0,1 (unless your bios offers additional mapping options), and ignores whatever may be connected to your primary PATA interface.
This maybe helpful or not. it shows that grub see sata as hd0 and then fstab see it as hde. two things: 1) try ide=reverse, my get a message that it cant find the root fs, 2) it's either fstab/mtab problem or the instructions to grub need to be reconfigure. The drive map my point to things in the wrong order. Have a look at "/boot/grub/device.map". HTH, Curtis.
So, when you install with your bios in compatibility mode, GRUB sees SATA0 as IDE 0,0. Once you disable compatibility mode, GRUB sees your primary drive on IDE channel 1 as IDE 0,0, and adds your SATA interfaces to the end of the list.
I'm only going by my single experience with installing Suse to an SATA interface (I didn't have to use compatibility mode), so I hope someone corrects me if I'm wrong with the following recommendation...
I'd say try this for a GRUB entry:
kernel (hd2,0)/boot/vmlinuz root=/dev/hde0 initrd (hd2,0)
I'm far from a "knowledgeable" user, but I think there are also some drive remapping options in GRUB. Unfortunately, I cannot tell you what they are. I'm sure one of the more knowledgeable users here can correct my mistakes and guide you further.
HTH and good luck!
-- Best regards, Brian Curtis
- -- Spammers Beware: Tresspassers will be shot, survivors will be shot again! Warning: Individuals throwing objects at the crocodiles will be asked to retrieve them! If pro is the opposite of con, then the opposite of progress must be congress! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFAF0yxN9r/ngHXpykRAhQoAJwNVvGXwjl7Nrj0QiWzQ4s+2Drv8ACgzm2D 7oAD+nak1eeddWscxT2fAA0= =TSwn -----END PGP SIGNATURE-----
Brian Curtis wrote:
DH> I'm confused!!! (hair being pulled out) DH> It seems as though (hd0) is the SATA drive when GRUB starts but somehow DH> /dev/hde (hd2?) becomes the SATA drive. Looking at the dmesg, I'd kind DH> of expect SATA0 to be (hd2) from the get go.
When you enable "Legacy" mode in bios, SATA0 & SATA1 are mapped to IDE 0,0 and IDE 0,1 (unless your bios offers additional mapping options), and ignores whatever may be connected to your primary PATA interface.
Agreed.
So, when you install with your bios in compatibility mode, GRUB sees SATA0 as IDE 0,0. Once you disable compatibility mode, GRUB sees your primary drive on IDE channel 1 as IDE 0,0, and adds your SATA interfaces to the end of the list.
I'd say try this for a GRUB entry:
kernel (hd2,0)/boot/vmlinuz root=/dev/hde0 initrd (hd2,0)
Well, that was how I was thinking as well, but that command does NOT boot. I gave the one that does in my previous message (except for a typo, I had hde0!): kernel (hd0,0)/boot/vmlinuz root=/dev/hde1 initrd (hd0,0) That's why I'm confused. Why does GRUB find the kernel and the initrd on (hd0,0) instead of (hd2,0)? Especially when it is /dev/hde1 instead of /dev/hda1. Cheers, Dave
Dave Howorth wrote:
That's why I'm confused. Why does GRUB find the kernel and the initrd on (hd0,0) instead of (hd2,0)? Especially when it is /dev/hde1 instead of /dev/hda1.
FWIW, I've now changed the boot order of the drives in the BIOS. The boot order is now PATA, SATA0, SATA1 With this change and using the Win2000 boot loader chaining to another version of GRUB (from the Knoppix 3.2 distribution, IIRC) I can now boot the system into SUSE 9.0 using the GRUB drive number (hd1,0) which is what I would expect. I wonder if GRUB knows that the BIOS is able to scan drives in a different order for boot purposes than when scanning the hardware? This might account for its schizophrenia over drive numbers. Cheers, Dave
participants (3)
-
Brian Curtis
-
Curtis Rey
-
Dave Howorth