mount is the Linux command that attaches a filesystem to a directory, called the mount point, so that its files become part of the single directory tree rooted at /. In the Linux filesystem model there are no drive letters: every disk partition, network share, disk image or virtual filesystem becomes reachable only after it has been mounted somewhere in the hierarchy.
The mount command, provided on most distributions by the util-linux package, is a user-space front end to the kernel’s mount() system call. Run without arguments, it lists the filesystems that are currently attached; run with a device and a directory, it asks the kernel to connect a filesystem driver to that location with a chosen set of options.
How the mount command attaches a filesystem
When a user runs mount /dev/sdb1 /mnt/data, the command identifies the filesystem type, either from the -t option or by probing the device signature through libblkid, and then calls the kernel. The kernel loads the matching filesystem driver, such as ext4, XFS or Btrfs, reads the superblock and creates a mount entry that links the root of the new filesystem to the target directory.
From that moment, any path below /mnt/data resolves into the mounted filesystem rather than into the directory that existed there before. The original contents of the mount point are hidden, not deleted, and they become visible again after the filesystem is detached with umount. The kernel records every active mount in its mount table, which is exposed through /proc/self/mountinfo and the more familiar /proc/mounts.
The common invocation forms are summarized in the following table.
| Invocation | Effect | Typical use |
|---|---|---|
mount | Lists all current mounts | Quick inspection |
mount /dev/sdb1 /mnt/data | Mounts a device on a directory | Attaching a disk |
mount -t nfs host:/export /mnt/nfs | Mounts a network share | Shared storage |
mount -o loop image.iso /mnt/iso | Mounts a file as a block device | Reading disk images |
mount -a | Mounts everything in fstab | Boot and testing |
mount -o remount,ro / | Changes options in place | Maintenance and recovery |
Mounting ordinary block devices requires root privileges or the CAP_SYS_ADMIN capability. Unprivileged users can mount only entries marked with the user or users option in /etc/fstab, through FUSE-based tools, or inside user namespaces where the kernel permits it for selected filesystem types.
Mount options and what they control
Mount options passed with -o define how the kernel treats the filesystem, and they are a central tool for both performance tuning and security hardening. Some options are generic and apply to any filesystem, while others are filesystem-specific and are interpreted only by the driver in question.
| Option | Meaning | Main consideration |
|---|---|---|
| ro / rw | Read-only or read-write access | Read-only protects data during recovery |
| noexec | Blocks execution of binaries | Hardens /tmp and removable media |
| nosuid | Ignores setuid and setgid bits | Prevents privilege escalation |
| nodev | Ignores device files | Standard on user-writable mounts |
| noatime / relatime | Limits access-time updates | Reduces write load |
| defaults | rw, suid, dev, exec, auto, nouser, async | Baseline for fstab entries |
| uid= / gid= | Sets file ownership | Needed for FAT and exFAT |
Since kernel 2.6.30, relatime is the default access-time behavior on most systems, updating access times only when they are older than the modification time or more than a day old. Choosing noatime saves additional writes, but it can break the rare tools that rely on access times, such as some mail clients that detect new messages this way.
The mount command in relation to fstab, systemd and related tools
The mount command is the manual, immediate interface to the kernel’s mount mechanism, while several other components automate or complement it. Understanding their division of labor prevents configuration errors that appear only after a reboot.
| Tool or file | Role | Relationship to mount |
|---|---|---|
| /etc/fstab | Declares persistent mounts | Read by mount -a and at boot |
| systemd mount units | Manage mounts as services | Generated from fstab or written directly |
| umount | Detaches a filesystem | Reverse operation |
| findmnt | Displays the mount tree | Clearer output than plain mount |
| lsblk / blkid | Identify devices and UUIDs | Supply arguments for mount |
| FUSE tools | Mount user-space filesystems | Use the same kernel tree |
On distributions that use systemd, the systemd-fstab-generator converts each fstab line into a mount unit at boot, which allows dependencies, timeouts and automounting. A bind mount, created with mount --bind, attaches an existing directory at a second location and is heavily used by container runtimes, while OverlayFS stacks several directories into one merged view.
Using mount safely in practice
Reliable use of the mount command depends on identifying devices correctly and testing persistent configuration before rebooting. Device names such as /dev/sdb can change between boots when hardware is added or detected in a different order, so persistent configuration should reference a filesystem UUID or label, obtained with blkid or lsblk -f.
| Situation | Recommended practice | Reason |
|---|---|---|
| Adding a permanent data disk | Use UUID= in fstab, then run mount -a | Stable naming and early error detection |
| Optional external drive | Add nofail to the fstab entry | Boot continues if the drive is absent |
| Investigating a damaged disk | Mount read-only with -o ro | Avoids further writes |
| Mount point reports busy | Find users with lsof or fuser -m | Explains why umount fails |
| Network share at boot | Add _netdev or use automount | Waits for networking |
Before editing /etc/fstab, a careful administrator keeps a root shell open and runs `mount -a` or `findmnt –verify` immediately after the change. A single typo in a required entry can drop the system into emergency mode at the next boot, which is far harder to fix on a remote server without console access.
Common errors and misconceptions
Several recurring mistakes stem from misunderstanding what mounting does to the directory tree. The list below covers the problems that experienced Linux administrators encounter most often.
- Writing data before the disk is mounted: files saved into an unmounted mount point land on the root filesystem and seem to disappear once the disk is attached.
- Wrong filesystem type: messages such as “wrong fs type, bad option, bad superblock” often mean a missing driver or helper such as
mount.nfs. - Assuming remount changes everything: some options cannot be changed with
remountand require a full unmount. - Forcing a busy unmount:
umount -lperforms a lazy unmount that hides the problem rather than releasing open files. - Treating mount output as authoritative in containers: each mount namespace has its own table, so the host and a container see different trees.
A plain-language summary
A Linux computer keeps all of its files in one big folder tree. When a new disk, USB stick or network folder is connected, it does not appear by itself. The mount command connects that storage to a chosen folder, and from then on its files show up there.
It is like plugging a hallway into an existing house: the new rooms only become reachable once the door is attached. The key point is that nothing is usable until it is mounted, and it should be unmounted before unplugging to keep data safe.
An example from practice
A systems administrator adds a 4 TB disk to a file server to hold nightly backups. After creating an ext4 filesystem on /dev/sdc1, the administrator runs blkid to read its UUID, creates the directory /srv/backup and tests the setup with mount /dev/sdc1 /srv/backup. The df -h output confirms the new capacity is available at the expected path.
To make the mount permanent, the administrator adds an fstab line using UUID=, the options defaults,noatime,nofail and filesystem check order 2. After unmounting the disk, running mount -a reattaches it without errors, which proves the entry is valid before any reboot. When the server later restarts during maintenance, the backup volume comes up automatically, and the nofail option ensures that a failed disk would not block the boot process.