mount — Mount and Unmount Filesystems
Attach devices, images and network shares to the directory tree: mount, umount, /etc/fstab, bind, loop and tmpfs mounts.
mount attaches devices, partitions, images and network shares to your directory tree – only then do their contents become visible under a path. From USB sticks through ISO loops and bind mounts to NFS and SMB shares, this guide walks you through the commands you reach for daily as an administrator. Take care: mounting over a non-empty directory hides its contents, and a mistake in /etc/fstab can leave your system unbootable. Most actions require sudo.
Basic Mount & Unmount
mount <device> <mountpoint> — Mount a device to a directory.
mount /dev/sdb1 /mnt/usbmount -t <type> <device> <mountpoint> — Mount with a specific filesystem type.
mount -t ext4 /dev/sdb1 /mnt/datamount — Show all currently mounted filesystems.
mountmount | grep <pattern> — Find specific mounts.
mount | grep nfsumount <mountpoint> — Unmount a filesystem by mount point.
umount /mnt/usbumount <device> — Unmount a filesystem by device.
umount /dev/sdb1umount -l <mountpoint> — Lazy unmount: detach immediately, clean up when idle.
umount -l /mnt/stuckMount Options
mount -o ro <device> <mountpoint> — Mount read-only.
mount -o ro /dev/sdb1 /mnt/readonlymount -o rw,noexec,nosuid <device> <mountpoint> — Mount read-write with no exec and no suid.
mount -o rw,noexec,nosuid /dev/sdb1 /mnt/datamount -o remount,rw <mountpoint> — Remount an already mounted filesystem (e.g., change to rw).
mount -o remount,rw /mount -o loop <image> <mountpoint> — Mount an ISO or disk image file.
mount -o loop ubuntu.iso /mnt/isomount -a — Mount all filesystems from /etc/fstab.
mount -aBind Mounts
mount --bind <source> <target> — Bind mount: make a directory available at another location.
mount --bind /var/www /home/user/wwwmount --rbind <source> <target> — Recursive bind mount (includes submounts).
mount --rbind /dev /mnt/chroot/devmount --bind -o remount,ro <target> — Make a bind mount read-only.
mount --bind -o remount,ro /home/user/wwwtmpfs & Special Filesystems
mount -t tmpfs -o size=<size> tmpfs <mountpoint> — Mount a tmpfs (RAM-based filesystem).
mount -t tmpfs -o size=512M tmpfs /mnt/ramdiskmount -t proc proc /proc — Mount the proc filesystem.
mount -t proc proc /mnt/chroot/procmount -t sysfs sysfs /sys — Mount the sysfs filesystem.
mount -t sysfs sysfs /mnt/chroot/sysNetwork Filesystems
mount -t nfs <host>:<path> <mountpoint> — Mount an NFS share.
mount -t nfs server:/export/data /mnt/nfsmount -t cifs //<host>/<share> <mountpoint> -o user=<user> — Mount a Windows/Samba (CIFS/SMB) share.
mount -t cifs //server/share /mnt/smb -o user=admin,password=secretmount -t cifs //<host>/<share> <mountpoint> -o credentials=<file> — Mount SMB share with credentials file.
mount -t cifs //server/share /mnt/smb -o credentials=/root/.smbcredsTroubleshooting
findmnt — Show mounted filesystems in tree format.
findmntfindmnt -t <type> — Show mounts of a specific filesystem type.
findmnt -t ext4umount -f <mountpoint> — Force unmount (for unreachable NFS mounts).
umount -f /mnt/nfsfuser -m <mountpoint> — Show processes using a mount point (why umount fails).
fuser -m /mnt/usblsof +f -- <mountpoint> — List open files on a mounted filesystem.
lsof +f -- /mnt/data Conclusion
mount and umount are the backbone of filesystem management on Linux, and most actions require sudo. Before you commit entries to /etc/fstab, test them with mount -a: a typo can hang the system on the next boot, and the nofail option softens that risk. Remember that mounting over a non-empty directory only hides its contents – the data is not gone, merely obscured. When umount fails with "target is busy", lsof and fuser reveal the blocking process; as a last resort, umount -l detaches lazily.
Further Reading
- Arch Wiki: fstab – how to configure persistent and safe mounts via /etc/fstab
- man7: mount(8) – the complete reference for the mount command and its options