Mounts¶
12 cards — 🟢 4 easy | 🟡 4 medium | 🔴 4 hard
🟢 Easy (4)¶
1. What command shows all current mounts in a tree view?
Show answer
findmnt — it displays all mounts in a hierarchical tree with source device, filesystem type, and options.2. How do you find the UUID of a block device?
Show answer
Use blkid or lsblk -f. Both show UUID, filesystem type, and label for all block devices.3. What are the six fields in an /etc/fstab entry?
Show answer
Device (UUID/path), mount point, filesystem type, options, dump flag (0/1), and fsck pass order (0/1/2).4. What does umount -l (lazy unmount) do?
Show answer
It immediately detaches the filesystem from the mount point but defers cleanup until all references to it are released. Useful when a normal umount returns "device is busy."🟡 Medium (4)¶
1. What happens if an fstab entry lacks the nofail option and the device is unavailable at boot?
Show answer
The system blocks during boot waiting for the device, potentially rendering the server unbootable. Adding nofail tells systemd to continue boot even if the mount fails.2. What is the difference between hard and soft NFS mount options?
Show answer
hard (default) retries indefinitely — processes hang until the server returns. soft gives up after retrans retries and returns an I/O error to the application.3. How do you find which processes are preventing a filesystem from being unmounted?
Show answer
Use fuser -vm /mount/point to list processes with open files, current directories, or executables on the filesystem. Alternatively, lsof +D /mount/point shows all open file descriptors.4. Why must NFS entries in fstab include the _netdev option?
Show answer
Without _netdev, systemd attempts to mount the NFS share before the network is up, causing the mount to fail or hang during boot.🔴 Hard (4)¶
1. How do you create a read-only bind mount, and why does it require two steps?
Show answer
First: mount --bind /src /dest. Then: mount -o remount,bind,ro /dest. The initial bind mount ignores ro in the options — you must remount to enforce read-only. Bind mounts are heavily used in containers for volume mounts.2. When would you remount a filesystem read-only on a running system, and how?
Show answer
Use mount -o remount,ro /path when the filesystem shows corruption (prevent further damage), before taking an LVM snapshot, or during emergency disk diagnostics. This avoids a full unmount when processes hold references.3. Describe the recovery procedure when a bad fstab entry prevents a Linux server from booting.
Show answer
Boot into single-user mode or a rescue disk. Remount root read-write with mount -o remount,rw /. Edit /etc/fstab to comment out or fix the bad entry. Reboot normally. Prevention: always run mount -a to test fstab changes before rebooting.4. How do you diagnose a hung NFS mount on a Linux client?