← Back to team overview

mylvmbackup-discuss team mailing list archive

Filesystem labels

 

I would like to suggest that perhaps immediately after an LVM
snapshot is made of a filesystem supporting labels, that the
label on the copy be changed.  This will help avoid possible
problems caused by having two filesystems exist simultaneously
with the same label.

For example, say the database is located on an ext3 filesystem
mounted to /database from LV /dev/vg01/lv_db where the ext3
filesystem label is "fsdb".

If the mount entry in the /etc/fstab uses labels rather than devices,
such as:

  LABEL=fsdb /database ext3 defaults 1 1

then if the system happens to be rebooted during a backup, the
reboot will not know which filesystem to mount (the original LV
or the snapshot version).

Instead, immediately after issuing the lvcreate -s command,
you could also relabel the snapshot, something like:

   e2label /dev/vg01/lv_db_snapshot  fsdb_snapshot

Now if the system crashes/reboots, the reboot will always properly
mount the correct and original database filesystem, ignoring the
snapshot version.

Of course such an operation will be dependent upon the filesystem type.


If you don't do this filesystem relabelling, then users should be warned
not to use the LABEL= syntax in their /etc/fstab.
-- 
Deron Meranda