RHCSA 5.3: Mounting by UUID or label
Mounting file systems at boot by UUID and by label, and finding a bad
/etc/fstab line without rebooting.
Before you start
The lab adds two empty 1 GiB spare disks, /dev/loop40 and
/dev/loop41. They're image files under /var/lib/le-lab/disks/,
attached again at every boot, before file systems are mounted. Use them
whole or partition them.
It also adds a line to /etc/fstab for a UUID that doesn't exist, at
/mnt/archive. That line has nofail, so it doesn't stop the boot.
Tasks
- Make an XFS file system on a spare disk (or a partition or LV on it)
and mount it on
/dataat every boot, by UUID. - Make an ext4 file system labeled
backupsand mount it on/backupsat every boot, by label. - Find the bad
/mnt/archiveline without rebooting, then remove it.findmnt --verifyshould then report no errors and no warnings.
Hints
mkfs.xfs,blkid, a lineUUID=... /data xfs defaults 0 0, thensystemctl daemon-reloadandmount -a.mkfs.ext4 -L backups, ore2label;LABEL=backups /backups ext4 defaults 0 2.findmnt --verifymarks the bad line with[E]; runsystemctl daemon-reloadafter editing/etc/fstab. Runfindmnt --verifyas root: as a normal user it can't read the devices and warnscannot detect on-disk filesystem type (Permission denied)for every line.