How does /etc/fstab work and what are important mount options?

Answer

/etc/fstab defines filesystems to be mounted automatically at boot. Each line has six fields: device mountpoint fstype options dump pass. The device can be a path (/dev/sda1) or UUID (UUID=abc123) — always prefer UUIDs as they are stable across reboots and disk reorders. Important mount options: defaults (rw, suid, dev, exec, auto, nouser, async), noexec (prevents executing binaries — use on /tmp for security), nosuid (ignores setuid bits), noatime (disables access time updates — significant performance improvement for databases and high-traffic filesystems), ro (read-only), _netdev (wait for network before mounting — for NFS). Test fstab changes with mount -a before rebooting. The pass field (0/1/2) controls fsck order on boot.