Mounting disks by label; A cautionary tale
I was migrating some data to some new disks and since the drive letters would be changing once the old disks were removed, I partitioned them and then gave them label names so they could be mounted by label.
The original disks had labels like:
boot
srv
tmp
On the new disks I thought good names would be:
/boot
/srv
/tmp
(I think Redhat actually names things this way by default?)
Anyhow, to make a long story short, mount by label ignores the leading slash. When the system rebooted, as predicted the drives came up in a different order so a “mount LABEL=srv” will actually mount the first disk named either “/srv” or “srv”.
Moral of the story; it’s probably a good idea not to use any strange characters when naming disks.