Article & Tutorial

Linux Mounts and /etc/fstab Explained: UUIDs, findmnt, Disk Usage and Troubleshooting

Learn Linux mounts and /etc/fstab with UUIDs, findmnt, lsblk, mount, umount, persistent mounts, disk and inode usage, deleted-open files, read-only filesystems and troubleshooting.

Linux mounts and /etc/fstab graphic showing UUIDs, findmnt, and filesystem commands
Linux mounts and /etc/fstab graphic showing UUIDs, findmnt, and filesystem commands
Contents

Linux attaches filesystems into one directory tree starting at /. Instead of drive letters, storage devices, network shares, and bind mounts appear at directory paths such as /data, /mnt/share, or /srv/app-data.

How Linux Mounts Storage

text
Disk /dev/sdb1
    |
    v
Mounted at /data
    |
    v
Applications read and write /data/...

Inspect Disks, Filesystems and Mount Points

Terminal
$ lsblk -f findmnt df -hT blkid mount | column -t
  • lsblk -f shows block devices, filesystems, labels, UUIDs, and mount points.
  • findmnt shows the active mount tree.
  • df -hT shows filesystem type and human-readable capacity.
  • blkid prints filesystem identifiers such as UUID and TYPE.
  • mount lists mounted filesystems and options.

Create a Temporary Mount

Terminal
$ sudo mkdir -p /mnt/data sudo mount /dev/sdb1 /mnt/data findmnt /mnt/data df -hT /mnt/data
Terminal
$ sudo umount /mnt/data

Why UUIDs Are Better Than /dev/sdb1

Terminal
$ sudo blkid /dev/sdb1 lsblk -f
Expected output
/dev/sdb1: UUID="4ab1-example-uuid" TYPE="ext4"

Persistent Mounts with /etc/fstab

Terminal
$ sudo mkdir -p /data
Terminal
$ sudo cp /etc/fstab /etc/fstab.backup
text
UUID=4ab1-example-uuid /data ext4 defaults,nofail 0 2
Terminal
$ sudo mount -a findmnt /data findmnt --verify

Common /etc/fstab Fields

  • UUID/device: the filesystem identifier or device path to mount.
  • Mount point: the directory where the filesystem appears.
  • Filesystem type: ext4, xfs, nfs, vfat, or another supported type.
  • Options: mount behavior such as defaults, nofail, ro, or noexec.
  • Dump: legacy backup field, commonly 0.
  • fsck order: filesystem check order, commonly 1 for root, 2 for local data filesystems, and 0 to skip.

Useful Mount Options

  • defaults
  • nofail
  • ro
  • rw
  • nodev
  • nosuid
  • noexec

Unmount: Target Is Busy

Disk Full vs Inode Full

Terminal
$ df -h df -i
Terminal
$ sudo du -xhd1 / | sort -h sudo du -xhd1 /var | sort -h

When df and du Disagree

If df reports used space that du cannot find, a deleted file may still be open by a running process. The directory entry is gone, but the space is not released until the process closes the file.

Terminal
$ sudo lsof +L1 sudo lsof | grep '(deleted)'

Read-Only Filesystem Problems

Terminal
$ findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS dmesg | tail -100 journalctl -k -b

Persistent Mount Fails During Boot

  • Wrong UUID
  • Wrong filesystem type
  • Missing device
  • Invalid option
  • Network storage unavailable
  • Mount-point typo
Terminal
$ cat /etc/fstab sudo blkid lsblk -f sudo mount -a findmnt --verify journalctl -xb

NFS Mount Example

Terminal
$ sudo apt install -y nfs-common sudo mkdir -p /mnt/share sudo mount -t nfs nfs-server:/export/share /mnt/share findmnt /mnt/share
text
nfs-server:/export/share /mnt/share nfs defaults,_netdev 0 0

Bind Mounts

Terminal
$ sudo mkdir -p /srv/app-data sudo mount --bind /data/app /srv/app-data findmnt /srv/app-data

Common Troubleshooting

Best Practices

  • Use UUIDs
  • Back up /etc/fstab
  • Run mount -a before rebooting
  • Monitor blocks/inodes
  • Use nofail deliberately
  • Plan storage growth
  • Back up data before repair/resize/formatting

Conclusion

Did this help?

Yes No

Join the discussion

0 Comments

Ask questions, add context, or share what worked.

Sign in to join the discussion

No comments yet. Start the discussion.

More from Melochip Editorial

Related articles

Stay in the loop. Get new Melochip articles

Receive Melochip article updates when new articles are available. Explicit opt-in only.

No pre-checked boxes. Unsubscribe support is part of the subscriber foundation.