mount
Overview
mount attaches a filesystem (device, network share, bind path, tmpfs, …) onto a directory in the single directory tree. Persistent mounts belong in /etc/fstab or systemd .mount units; mount itself is the live operation.
Syntax
mount [-t type] [-o options] device dir
mount # list mounts
mount -a # all fstab entriesCommon Options
| Option | Description |
|---|---|
-t type |
Filesystem type (ext4, xfs, nfs, tmpfs, cifs, …) |
-o opts |
Comma options (ro, noexec, nosuid, defaults, …) |
-a |
Mount all fstab filesystems |
-r |
Read-only |
--bind |
Bind mount a directory |
-v |
Verbose |
Key Use Cases
- Attach disks and USB volumes
- Mount NFS/CIFS shares
- Bind mounts for chroots/containers
- Temporary tmpfs workspaces
Safety
Wrong device on mkfs/mount can expose or overwrite data. Always verify with lsblk -f and blkid first. Unmount cleanly with umount before disconnecting storage.
Examples with Explanations
List
mount | column -t
findmnt
findmnt -t ext4Mount a partition
sudo mkdir -p /mnt/data
sudo mount /dev/sdb1 /mnt/data
# or by UUID (stable):
sudo mount UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/dataRead-only
sudo mount -o ro /dev/sdb1 /mnt/dataNFS
sudo mount -t nfs server:/export/path /mnt/nfsBind mount
sudo mount --bind /var/www /mnt/www-viewtmpfs
sudo mount -t tmpfs -o size=1G tmpfs /mnt/scratchFrom fstab
sudo mount -a
sudo mount /mnt/data # if listed in fstabUnderstanding Output
mount with no args lists source, target, type, and options. Prefer findmnt for tree views and JSON (findmnt -J).
Notes & Pitfalls
- Prefer UUID= or LABEL= in fstab over
/dev/sdXnames.
- “Target is busy” on umount →
lsof/fuser/findmnt.
- Systemd may auto-manage mounts; check
systemctl status mnt-data.mount.
Additional Resources
man mount
man fstab