4

I have a simple server with 6 hard disk drives (all SATA) inside of it. They are in a simple JBOD (just a bunch of disks) mode, so Linux just shows the following devices (assume each one has a single ext2 partition).

/dev/sda
/dev/sda1
/dev/sdb
/dev/sdb1
/dev/sdc
/dev/sdc1
/dev/sdd
/dev/sdd1
/dev/sde
/dev/sde1
/dev/sdf
/dev/sdf1

Now, if I were to swap two of the disks by accident during routine maintenance, the mappings between device name (ie: /dev/sdx) and the actual disk being name is swapped.

Is there a way to have fstab require additional arguments (ie: some sort of VOLUME/DISK UUID, or some kind of drive serial number) so that I can enforce a device-name-to-physical-device mapping that does not change if the drives are incorrectly wired inside the server?

Thank you.

2 Answers 2

5

Absolutely. If your partitions have a label (via e.g. e2label) then you can use LABEL=xxxx, otherwise you can use UUID=xxxx after getting the UUIDs with blkid.

1
  • @Izzy Both answers were great, but this one showed me how to get the label/UUID as well. Thank you both (@Izzy & @Ignacio)
    – Cloud
    Jul 5, 2012 at 13:11
4

Instead of /dev/sdX you can use UID= as in this example:

UUID=81658fcf-1777-457a-934e-5d9a399fdf26 /  ext4  errors=remount-ro   0   1

Then the order of devices should no longer matter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .