Mounts are, sometimes, swapped at boot /usr2 becomes /tmp and /tmp becomes /usr2. This causes disaster because /tmp cleanup cron entries start acting on the /usr2 mount.
/etc/fstab
contents
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=****************** /boot ext4 defaults 1 2
/dev/mapper/rhel-swap swap swap defaults 0 0
/dev/sdb1 /data ext4 data=ordered,relatime 0 0
/dev/sdd1 /usr2 ext4 defaults 0 0
/dev/sdc1 /tmp ext4 defaults 0 0
How can I prevent the system from booting or from mounting the drives if this occurs? I'm trying to add some kind of safeguard in case the root issue occurs.
You have two options:
Since you're using an EXT filesystem you can label the partition and use the
LABEL
option in your fstab.e2label /dev/sdb1 /data
and use the label/data
rather than the partition to get consistent mounts:LABEL=/data /data ext4 data=ordered,relatime 0 0
Your current
/etc/fstab
already includes an example of it, but you also can mount partitions, volumes and disks by their unique UUID. Useblkid
to get the UUID's and include them in/etc/fstab
i.e. something like:UUID=c2ba7d33-1a1f /data ext4 data=ordered,relatime 0 0
The second option is more powerful as it works for a much larger range of file-systems and devices where e2label only works for EXT filesytems.
You can display blkid UUID in slightly more userfriendly format with
lsblk --fs