Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
@Izzy Both answers were great, but this one showed me how to get the label/UUID as well. Thank you both (@Izzy & @Ignacio) –  Dogbert Jul 5 '12 at 13:11
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.