[Wlug] Hard drive configuration

Chuck Anderson cra at WPI.EDU
Tue Jul 24 22:18:35 EDT 2007


On Tue, Jul 24, 2007 at 05:36:16PM -0400, Michael Long wrote:
> /dev/sdb3       /       reiserfs        acl,user_xattr 1 1
> /dev/sdb1       /boot   reiserfs        acl,user_xattr 1 2
> /dev/sda1       /raid   reiserfs        defaults 1 2
> /dev/sdb2       swap    swap    pri=42 0 0
> 
> I downloaded OpenSuSE 10.2 and attempted to upgrade the system. When 
> running either an upgrade or new install it tells me that /dev/sda3 is 
> defined as /dev/sdb3 in fstab.
> 
> Bottom line when I install opensuse 10.2 it sees my raid as sdb and the 
> system is currently setup to have it as sda. I do not understand why my 
> current configuration is the opposite of what a new install is finding. 
> Where do I go from here?

The order sda sdb sdc etc. depends on the order the SCSI buses were 
probed in.  Different kernels may find hardware in a different order, 
or modules may load in a different order causing this.  In fact, in 
Fedora 7+, they stopped using the old IDE driver and switched to the 
new ATA driver using libata.  Now all /dev/hdX devices appear as 
/dev/sdX.  The solution is to avoid using device names directly, and 
instead use filesystem labels, uuids, and/or LVM.

e.g. this will label your devices (caveat: I haven't used reiserfs or 
SuSE before so you'll probably want to google this and read more about 
it):

reiserfstune -l raid /dev/sda1
reiserfstune -l boot /dev/sdb1
reiserfstune -l root /dev/sdb3

(For Ext2/Ext3, you'd use e.g. "e2label /dev/sda1 raid")

swapoff /dev/sdb2
mkswap -L swap /dev/sdb2
swapon -L swap

Then you change your /etc/fstab like this:

LABEL=root       /       reiserfs        acl,user_xattr 1 1
LABEL=boot       /boot   reiserfs        acl,user_xattr 1 2
LABEL=raid       /raid   reiserfs        defaults 1 2
LABEL=swap       swap    swap    pri=42 0 0

GRUB/Lilo will have to be dealt with separately.  For example, my 
grub.conf (menu.lst) has this in it:

title Fedora (2.6.21-1.3194.fc7)
        root (hd0,1)
        kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VGSystem/LVRoot rhgb quiet
        initrd /initrd-2.6.21-1.3194.fc7.img

but I believe you can say "root=LABEL=root" instead.

UUID's work similarly to labels.


More information about the Wlug mailing list