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 type options dump fsck
[...]
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