Kernel device names can change when disks are added, controllers are reordered, or a virtual machine boots with different storage timing. Mounting by filesystem UUID keeps a data volume tied to the intended directory even when the kernel assigns a different device name.
Each filesystem stores its own UUID in metadata on the device. blkid reads that identifier and the filesystem type, mount can resolve a UUID=… source, and the system mount table can save the same stable reference for future mounts.
The examples below use an ext4 filesystem and a persistent local data mount. Replace the device path, UUID, filesystem type, mount point, mount options, and final check field for the target filesystem, because a malformed persistent mount entry can leave the volume unavailable during boot.
$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINTS /dev/vdb1 NAME SIZE TYPE MOUNTPOINTS vdb1 64G part
Use the filesystem device, usually a partition such as /dev/vdb1, /dev/sdb1, /dev/nvme1n1p1, or a logical volume under /dev/mapper. If MOUNTPOINTS already shows a path, the filesystem is already mounted.
$ sudo blkid /dev/vdb1 /dev/vdb1: LABEL="data" UUID="fcc7979c-742b-43aa-9fe5-6a014e23496f" BLOCK_SIZE="4096" TYPE="ext4"
$ sudo mkdir -p /mnt/data
Files already present in the mount point directory stay hidden while another filesystem is mounted there.
$ sudo mount UUID=fcc7979c-742b-43aa-9fe5-6a014e23496f /mnt/data
$ findmnt -M /mnt/data -o TARGET,SOURCE,FSTYPE,OPTIONS TARGET SOURCE FSTYPE OPTIONS /mnt/data /dev/vdb1 ext4 rw,relatime
The -M option checks the exact mount point instead of walking up parent directories.
$ sudo umount /mnt/data
$ sudo cp --archive /etc/fstab /etc/fstab.bak
A malformed /etc/fstab entry can delay boot or leave the filesystem unavailable until the file is corrected.
$ sudoedit /etc/fstab
UUID=fcc7979c-742b-43aa-9fe5-6a014e23496f /mnt/data ext4 defaults 0 2
The fields are source, mount point, filesystem type, mount options, dump flag, and filesystem check order. Use 0 0 for filesystems that should not be checked by fsck at boot, and consider defaults,nofail for storage that may be absent during boot.
$ sudo findmnt --verify --verbose /mnt/data /mnt/data [ ] target exists [ ] UUID=fcc7979c-742b-43aa-9fe5-6a014e23496f translated to /dev/vdb1 [ ] source /dev/vdb1 exists [ ] FS type is ext4 Success, no errors or warnings detected
Correct the /etc/fstab line before continuing if findmnt reports an error or warning.
$ sudo mount /mnt/data
$ findmnt -M /mnt/data -o TARGET,SOURCE,FSTYPE,OPTIONS TARGET SOURCE FSTYPE OPTIONS /mnt/data /dev/vdb1 ext4 rw,relatime