Fedora / Ubuntu fstab differences

If you're used to the…

Login

Blog History

If you're used to the traditional /dev/hdXX format the new Fedora/Ubuntu fstab entries may throw you.

Ubuntu uses UUID* which is found / set by using the vol_id utility

vol_id -u /dev/sda2
a0584727-1c8b-48df-867b-9e3b5a453ff7

The Ubuntu fstab entry for the /dev/sda2 above is

UUID=a0584727-1c8b-48df-867b-9e3b5a453ff7 / ext3 defaults,errors=remount-ro 0 1

Fedora / Redhat / Centos uses the concept of labels you add remove labels using the e2label program

e2label /dev/sda3
/boot

The Fedora fstab entry looks like this.

LABEL=/boot /boot ext3 defaults 1 2

There are many advantages to both approaches especially if the operating system enumerates the drives in a different order when it boots due to a hardware change (such as plugging in a USB hard drive or re-intalling IDE drives in a different order). With LABEL or UUID the Kernel will always correctly mount each partition to the right mount point _except_ if you have a duplicate UUID or LABEL then you're on your own.

*Universally Unique Identifier

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.