How Not to Lose Disks

How Not to Lose Disks

Have you ever upgraded a machine, only to find that during the upgrade, your device names got rearranged, so that your filesystems aren’t where they used to be, and you can’t mount anything?

This happened to us at work: we upgraded a fileserver with a hundred or so filesystems on a SAN. The driver software silently shuffled the devices around, so after the upgrade, nothing got mounted where it beloned. We had to ask the users to look through the filesystems and tell us where they should have been mounted.

To prevent this sort of thing in the future, we adopted a simple trick: on each filesystem, create a file called mountpoint that says where the filesystem ought to be mounted.

Yes, this is pretty much the same as labeling each partition, as some OSes allow you to do. Except that it’s arguably more robust, because you don’t need to rely on different versions of the OS being able to read the partition label. Besides, it’s simpler, and survives backups, replication, and so forth.

Automating all of this is left as an exercise for the student.