# best way to handle disks whos device nodes move

## braindead0

I've got an LSI Megaraid card, setup Gentoo on a HD connected to the built in sata3 on my mobo... Figured I'd get it all setup and recognizing the LSI card before setting up the RAID disk....  

When I setup the RAID virtual disk, i was unable to boot... it took over /dev/sda and move my boot drive to /dev/sdb.  

My first thought was just boot up the min install CD, chroot and re-setup for the boot drive being /dev/sdb... however when I boot to the install CD my main drive is /dev/sda

All of the udev rule writing stuff I immediately found was old (udevinfo doesn't exist anymore I think), so I'm not 100% confident on my ability to write up udev rules for this.. I've done them before but just for external USB drives and the like.

I'm tempted to reference partitions in fstab and lilo.conf via /dev/disk/by-id/ which gets kinda long of course but should alleviate the problem.  

Or is that crazy?

----------

## ianw1974

From a lot of what I read the UUID business of partitioning is the ideal way to get around this, because then if the device gets recognised differently as it did in your case, it would still get mounted by the UUID, than if it was being referenced as /dev/sda or /dev/sdb.  So not crazy  :Smile: 

----------

## braindead0

excellent... so maybe I'm not crazzeeee at all!.. or maybe I am.. but in this instance it's okay  :Wink: 

Just noticed your last name.. I'm a Walker also!!!  

not that it's very unusual..though

----------

## braindead0

turns out this does not work.  I'm guessing that the boot process actually looks at the block device nodes (as it can't find (8,3) which is for me /dev/sda3).

I worked around the problem be adding root=/dev/sdb3 during boot.. and then changing my lilo configuration to reference /dev/sdb with /dev/sdb3 as root.

I've compiled the MegaRAID driver into my kernel, perhaps that's why it takes over /sda and the gentoo CD doesn't (being all modularized).

Perhaps this has something to do with the new EUFI (or UEFI.. or whatever) BIOS...  

Rather annoying..

----------

## HeissFuss

You should be able to configure grub to use uuid for the root device.

root=UUID=yourrootpartitionuuid

You'll also need to make sure your fstab uses uuid.

----------

## Kaso_da_Zmok

the discovery order decides the names if it is sda or sdb and depends when the driver was loaded.

i do use grub and initramfs with disklabel support.

if you use GPT partitions you don't even need the initramfs as you can specify the UUID of the partition and not the UUID of the fs.

GPT UUID

You can if you use gpt partitions:

```
root=PARTUUID=uuid_here
```

Note, this is the *partition* uuid, not the filesystem uuid. Different things. You can see it in gdisk under "Partition unique GUID" by pressing "i" on the relevant partition.

It will also work with lilo but you need the initrd

I suggest you put your kernel config to 

```
t3400 ~ # zcat /proc/config.gz > /usr/share/genkernel/arch/x86_64/kernel-config
```

and use genkernel to make the bzImage and initramfs with disklabel support for you.

```
t3400 ~ # genkernel --install --disklabel all
```

and then look at the two links or lilo.conf man page to specify the UUID of the root fs.

http://nil-techno.blogspot.com/2012/01/using-lilo-to-boot-disks-by-uuid.html

https://wiki.archlinux.org/index.php/Persistent_block_device_naming

http://linux.die.net/man/5/lilo.conf

The root filesystem may also be specified by a LABEL= or UUID= directive, as in '/etc/fstab'. In this case, the argument to root= must be enclosed in quotation marks, to avoid a syntax error on the second equal sign; viz.,

root="LABEL=MyDisk"

----------

