[lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-22 Thread Tobias Gasser
Jeremy Henty schrieb:
 Can I be sure that GRUB2's hd0, hd1 etc. will always correspond to the
 same  physical SATA  connectors  on the  motherboard,  no matter  what
 hardware I  plug in?  (I know  from experience that /dev/sda  does not
 always map  to the same  connector.)  If not, how  can I find  out the
 mapping after booting from a live CD?  Or can I drop into the BIOS and
 asssume that it lists the drives in hd0, hd1 ... order?


short: no, you can't.


long:
i'm using mobile racks in my dev systems. usually i just have 2, but in
my 'big iron' i use a icy-dock 3disk cabinet (mb 973sp) which is
connected to the 3 first sata-connectors. on the 4th i have the dvd.

if i just have 1 disk inserted, it will always be hd0 and /dev/sda,
independent which of the 3 slots the disk is in.

if i insert 2 disks, the topmost (slot 1 or 2) will be hd0, and the
lower one (slot 2 or 3) will be hd1. no matter how i populate (1+2, 1+3
or 2+3) the topmost is hd0/sda, the lower one hd1/sdb.

inserting a 'next' disk while having lfs up will give the next letter,
thus inserting a second will be /dev/sdb and the third /dev/sdc,
independent of which slot i use.

even worse #1:
booting with 3 disks, i get hd0,hd1 and hd2 with grub, and /dev/sda, sdb
and sdc. hd0/sda will be the topmost disk in the cabinet. unmounting and
removing sdb and sdc, waiting some time and then reinserting sdc (the
3thd) will show it now as sdb, insering the former sdb a little later
will show it as sdc!

even worse #2:
the mainboard has an additional marvel chip with another 2 sata ports.
i have another 3.5 plus a 2.5 bay attached to this ports.

if i just have inserted the 2.5 disk, grub assignes hd0, lfs uses /dev/sde.

lfs will use sde and sdf for the 2 ports. having inserted just one it
will be sde, independend wether i have the 2.5 or 3.5 bay filled on
startup. i guess the onchip driver is loaded first (assigning sda-scd)
and the marvel second (assigning sde+f).

grub seems to enumerate all available ports just enumerating the found
devices without leaving any 'whole'.

tobias

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-22 Thread D.Dreschers
At 20.07.2012 22:16, Jeremy Henty wrote:

 Can I be sure that GRUB2's hd0, hd1 etc. will always correspond to the
 same  physical SATA  connectors  on the  motherboard,  no matter  what
 hardware I  plug in?  (I know  from experience that /dev/sda  does not
 always map  to the same  connector.)  If not, how  can I find  out the
 mapping after booting from a live CD?  Or can I drop into the BIOS and
 asssume that it lists the drives in hd0, hd1 ... order?

You can avoid all the hassle about device mapping by using UUID's.

In parallel to my LFS, I have an Ubuntu installed. I use the grub 
bootloader from my LFS for it was the first system on the disk.
In the past Ubuntu sometimes hiccup'ed on the device mapping I used in 
my grub.cfg due to some updates I got for Ubuntu.

That was until I found out about UUIDs. Every partition on a disk gets a 
unique UUID when formated. By using this UUID in grub.cfg I got rid of 
any problems Ubuntu had with device mapping.

Here is a snippet from my grub.cfg

### BEGIN /etc/grub.d/17_ubuntu64 ###
menuentry Ubuntu 10.04 LTS 64 Bit {
 insmod ext2
 set root=UUID=9d35bf11-528c-4fa7-b838-ec734d13ba73
 search --no-floppy --fs-uuid --set 
9a36bf12-518a-4fb7-b238-ec714d13ca73
 echo Loading Ubuntu ...
 linux /vmlinuz root=UUID=9a36bf12-518a-4fb7-b238-ec714d13ca73 
ro splash quiet
 initrd /initrd.img
}


You can even use UUID inside /etc/fstab
Again a snippet from my fstab:

# Begin /etc/fstab

# file system   mount-point typeoptions dumpfsck
[...]
UUID=2ae6b852-0a23-4731-95a8-e4543603113b   /mnt/BigStore   ext3 
noauto,user 0   0
[...]


Maybe you can use this as well to get rid of any device mapping hassle.


Regards,

   Dan


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-21 Thread Jeremy Henty

Bruce Dubbs wrote:

 I can't really answer your question for sure, but on my motherboard,
 I have four  SATA sockets.  In adding a new  drive, the designation,
 sdb, sdc,  etc, seemed to go  with the particular socket.   The BIOS
 also seemed to map to the particular socket too.

I have four SATA  sockets too and I have definitely  seen the map from
socket to  /dev/sd? change depending  on what hardware was  plugged in
where.

This is interesting  - I burned a  grub rescue disk and  it thought my
first hard drive was hd1 , not hd0 ?  The root= parameter to linux was
still /dev/sda2 , but after booting  grub on the disk reports the same
device map as before, namely hd0 - /dev/sda .  Surprising!

Regards,

Jeremy Henty
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-21 Thread Aleksandar Kuktin
On Fri, 20 Jul 2012 23:10:25 +0100
Ken Moffat zarniwh...@ntlworld.com wrote:

  Personally, I would never trust a BIOS writer to do things
 correctly, nor a manufacturer of affordable motherboards to do
 things straightforwardly - on one of my current boxes, the connector
 where I happened to connect the DVD drive uses a different SATA
 driver from the other connectors  ;)

You must have been very happy when you figured it out. ;) LOL

-- 
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-21 Thread Ken Moffat
On Sat, Jul 21, 2012 at 06:01:36PM +0200, Aleksandar Kuktin wrote:
 On Fri, 20 Jul 2012 23:10:25 +0100
 Ken Moffat zarniwh...@ntlworld.com wrote:
 
   Personally, I would never trust a BIOS writer to do things
  correctly, nor a manufacturer of affordable motherboards to do
  things straightforwardly - on one of my current boxes, the connector
  where I happened to connect the DVD drive uses a different SATA
  driver from the other connectors  ;)
 
 You must have been very happy when you figured it out. ;) LOL
 

 8) : your LOL is the relevant comment
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


[lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-20 Thread Jeremy Henty

Can I be sure that GRUB2's hd0, hd1 etc. will always correspond to the
same  physical SATA  connectors  on the  motherboard,  no matter  what
hardware I  plug in?  (I know  from experience that /dev/sda  does not
always map  to the same  connector.)  If not, how  can I find  out the
mapping after booting from a live CD?  Or can I drop into the BIOS and
asssume that it lists the drives in hd0, hd1 ... order?

Regards,

Jeremy Henty
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-20 Thread Bruce Dubbs
Jeremy Henty wrote:

 Can I be sure that GRUB2's hd0, hd1 etc. will always correspond to the
 same  physical SATA  connectors  on the  motherboard,  no matter  what
 hardware I  plug in?  (I know  from experience that /dev/sda  does not
 always map  to the same  connector.)  If not, how  can I find  out the
 mapping after booting from a live CD?  Or can I drop into the BIOS and
 asssume that it lists the drives in hd0, hd1 ... order?

I can't really answer your question for sure, but on my motherboard, I 
have four SATA sockets.  In adding a new drive, the designation, sdb, 
sdc, etc, seemed to go with the particular socket.   The BIOS also 
seemed to map to the particular socket too.

I would start with the assumption that the mapping is fixed until I had 
evidence otherwise.

   -- Bruce

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Q: Is the map between physical SATA disks and GRUB2's hdn fixed?

2012-07-20 Thread Ken Moffat
On Fri, Jul 20, 2012 at 09:16:13PM +0100, Jeremy Henty wrote:
 
 Can I be sure that GRUB2's hd0, hd1 etc. will always correspond to the
 same  physical SATA  connectors  on the  motherboard,  no matter  what
 hardware I  plug in?  (I know  from experience that /dev/sda  does not
 always map  to the same  connector.)  If not, how  can I find  out the
 mapping after booting from a live CD?  Or can I drop into the BIOS and
 asssume that it lists the drives in hd0, hd1 ... order?
 
 I was going to reply to Bruce's reply, noting that over the years
I've seen drives move around across kernel versions.  Then I
realised that you were really talking about grub (so, whichever
drive is /dev/sda as far as the kernel is concerned has little or no
correspondence with what grub thinks).

 If you have to boot to a live CD to fix things up, I would run
grub-mkdevicemap to see what it reports.  Of course, if you have to
reinstall grub, you install it to /dev/sda or wherever, using what
the current kernel thinks the drives are called [ see dmesg ].

 Personally, I would never trust a BIOS writer to do things
correctly, nor a manufacturer of affordable motherboards to do
things straightforwardly - on one of my current boxes, the connector
where I happened to connect the DVD drive uses a different SATA
driver from the other connectors  ;)

 For the non-root filesystems, in /etc/fstab I use LABEL= [ man
e2label - not sure if that would work with btrfs or xfs ].

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page