[lug] /etc/fstab in the modern world
P. Scott DeVos
scott at savingtree.com
Thu Oct 21 12:38:37 MDT 2004
Elyse M. Grasso wrote:
> I'm using KRUD FC2 on a dual boot system.
>
> I find RedHat's use of labels instead on devices in /etc/fstab annoying, since
> it hides potentially useful information. Is there any reason NOT to switch
> the LABEL entries back to /dev/hda? entries?
>
The reason to use labels is that on modern systems where drives may come
and go, you cannot be sure of where in /dev it will reside. The label
scheme makes it very easy to keep track of a file system even if it
moves around.
I'll give you an example. I client of mine does backups on
hot-swappable removeable SATA drives. If the backup drive is in the
slot when the computer boots, then the main drive comes up as /dev/sdb,
but if the backup drive is missing, it comes up as /dev/sda. Because
every thing is labelled and mounted by label, it doesn't matter.
I label the filesystems on the backup drives as backup, then I mount
them with
mount -L backup /mnt/backup
prior to backup.
Recently I wanted to move the /home partition to another hard drive on a
machine. After copying the data, I just did the following:
e2label /dev/hda2 old/home <==this fs was labelled /home
e2label /dev/sdb1 /home
You can check the label of a file system with
e2label /dev/hda1
for example.
One inconvenience is that I do not know how to get a list of all the
labels by /dev entry or vice-versa. If someone knows how, please let me
know!
More information about the LUG
mailing list