Mailinglist Archive: opensuse (1523 mails)

< Previous Next >
Re: [opensuse] Confused by hard drive naming/position /dev/sda vs hd0 etc,
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Fri, 12 Mar 2010 21:09:57 +0100
  • Message-id: <4B9A9F95.2060204@xxxxxxxxxxxxxx>
Hash: SHA256

On 2010-03-12 19:25, C wrote:
OK, I'm really going around in circles here, and I'm just getting
confused by it all... maybe someone here could clear the mud for me?
Hang in there with me... this is a bit hard to explain :-P

My main computer has five SATA hard drives, one SATA DVD drive, and
zero PATA drives.

The drives are all physically connected to the motherboard SATA
controller (no extra controller card etc):

SATA0 = 1TB (main drive with 4 partitions for various Linux
distributions, 1 swap and 1 /home)
SATA1 = 1TB (data drive1, single partition)
SATA2 = 500GB (data drive2, single partition)
SATA3 = 500GB (data drive3, single partition)
SATA4= 320GB (Windows drive)

And how do you know that SATA 0 is 0 and not, say, 3? :-)

openSUSE 11.2 is mounting the drives by ID, and this always works
fine. The order openSUSE sees the drives (using fdisk -l) on /dev is
different than the physical connect order:

/dev/sda = SATA2
/dev/sdb = SATA3
/dev/sdc = SATA4
/dev/sdd = SATA0
/dev/sde = SATA1

openSUSE is installed on the 6th partition of SATA0 (/dev/sdd6). Grub
in openSUSE is set to boot (hd0,5)... which is correct (as I
understand Grub) and which boots fine.

Now here is where it gets weird.

I installed Gentoo on the 7th partition of SATA0 (dev/sdd7)... but
fdisk -l from the Gentoo install sees the drives differently than
openSUSE... it sees the drives like this:

/dev/sda = SATA2
/dev/sdb = SATA3
/dev/sdc = SATA4
/dev/hdc = SATA0
/dev/hdd = SATA1

Note that this time the two 1TB drives are picked up as hdc and hdd
instead of sdd and sde.

huh? :-o

This causes me all sorts of problems..
including a complete failure to boot with an error about no valid root
device - which is what led me to start poking into this drive stuff.

Next I installed Ubuntu 9.10 on the 5th partition of SATA0. Grub from
Ubuntu is set to boot (hd3,5). hd3? Where did that come from?
Ubuntu boots fine with this Grub line.... but... how? The SATA0 drive
is not hd3 in any way I understand it could be. As well, it picked up
openSUSE at (hd3,6), and Windows at (hd2,1)..... yet when I do an
fdisk -l it shows the exact same info as openSUSE.

The names grub sees are listed in /boot/grub/ I tried to change the
mapping to reflect
what I thought correct, looking at the bios and the cables - and then the
system would not boot

So.. with all this conflicting information.. it's making it really
hard for me to figure out what Grub in openSUSE should be set to
(since I want to use the openSUSE boot menu for all of the installed
OSes). Each install thinks the drives are different in some way..
which is making life... difficult to say the least. Why is SATA0
attached to /dev/sdd? Why not /dev/sda? (minor issue since I'm using
mount by id, but still... doesn't make sense) Why is one Linux seeing
SATA0 as /dev/sdd and the other seeing it as /dev/hdc? Why would Grub
in openSUSE see SATA0 as hd0 (which makes sense to me) and Grub in
Ubuntu see that same drive as hd3 (which makes no sense at all to me)?

Does anyone have any hints or clues for me here?

My current method is to install each grub to its own boot partition, and have a
generic mbr code.
This means that the grub that will boot is the one on a primary partition
marked bootable. Then each
grub's configuration can change the bootable marking of a partition. Of course,
you can only have
three. Perhaps four, installing a grub in the extended.

This entry loads another grub menu.lst file, but the first one remains in

title another -- (via configfile in /dev/sda1)
root (hd0,0)
configfile /boot/grub/menu.lst

This one changes the active partition and boots the grub code there. Also, on
next reboot, the main
grub will be that one, so it has to have a corresponding entry to revert things:

title another -- via chainload - changes active boot to /dev/sda1
rootnoverify (hd0,0)
chainloader +1

Then you can have entries booting the kernel from another partition, booting
another system,
acording to the naming in the first one.

This method allows each installation to control its own boot code.

Otherwise, you have one grub in the MBR, as master grub, and this will load
another grub (in any
boot partition) as needed, chaining menus - but "makeactive" will not work. The
advantage is that
you need not use primary partitions and the number of grubs is not limited.

- --
Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 "Emerald" GM (Minas Tirith))
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE -

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups