Linux · Systems fluency
How does filesystem mounting work, including fstab and mount options?
Short answer
Mounting attaches a filesystem to a directory in the tree. /etc/fstab declares persistent mounts at boot, and options such as ro, noexec, nosuid, and nodev reduce risk but can break workloads if applied blindly.
The kernel needs a filesystem type, a device or remote source, and a mount point. For local disks, use UUIDs instead of device names because names can change when hardware is added. systemd generates mount units from fstab and can also manage mounts natively.
lsblk -f
mount /dev/sdb1 /mnt/data
findmnt /mnt/data
umount /mnt/dataA persistent fstab entry
UUID=abcd-1234 /data ext4 defaults,nofail 0 2- noexec blocks execution of binaries from the mount
- nosuid ignores setuid and setgid bits
- nodev blocks device files from being interpreted
- nofail lets boot continue if the mount is unavailable
- x-systemd.device-timeout bounds how long boot waits
A bad fstab entry can prevent boot or drop the system into emergency mode. Validate with mount -a and test in a maintenance window. A busy unmount means a process has a file open or a working directory inside the mount; find it with lsof or fuser.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why use UUIDs instead of /dev/sdX names in fstab?
- 2What does nofail change during boot?
- 3Why might umount report that the target is busy?
- 4When would you use noexec on /tmp?
Say it in the interview
Mounting attaches a filesystem at a directory. fstab makes it persistent at boot, and I prefer UUIDs because device names can change. Options like noexec, nosuid, and nodev reduce risk but can break legitimate workloads. I validate fstab with mount -a and keep a recovery path, because a bad entry can stop the system from booting.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Linux mock interview and get scored feedback on depth, clarity and confidence.