July 23, 2025

Fedora 42 -- Use uuid in fstab

I have (or had) 3 M.2 solid state disks in my system. On a recent series of reboots I had the unhappy experience that these seem to get randomly assigned device names (nvme0n1 versus nvme1n1, etc.).

This leads to wasted time and misery. Who knows why the driver is not deterministic, but we can use the "uuid" scheme to get things right.
To get the uuid information:

su
blkid
/dev/nvme0n1p1: UUID="bc800794-9f48-4eba-a3e8-b5f6f05d892c" BLOCK_SIZE="4096" TYPE="ext4"
/dev/nvme1n1p1: UUID="7f7a12ae-7ddd-4791-9832-2b69b9a93c70" BLOCK_SIZE="4096" TYPE="ext4"
Then I use the UUID values from the above to change my /etc/fstab as follows:
#/dev/nvme0n1p1         /u2                       ext4    defaults        1 1
#/dev/nvme1n1p1         /u1                       ext4    defaults        1 1
UUID=bc800794-9f48-4eba-a3e8-b5f6f05d892c /u2     ext4    defaults        1 1
UUID=7f7a12ae-7ddd-4791-9832-2b69b9a93c70 /u1     ext4    defaults        1 1

Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org