umount(8)
Unmount file systems from the directory tree.
Synopsis
umount [OPTION]... MOUNT_POINT|DEVICEDescription
Umount removes a mounted file system from the directory hierarchy. The MOUNT_POINT or DEVICE argument specifies which file system to unmount. A file system cannot be unmounted if it is busy (files are open, working directory is within it, or swap is active on it).
Regular users can unmount file systems if they mounted them and have appropriate permissions; root can unmount any file system. The unmount operation flushes buffered data and cleanly removes the file system.
Common options
| Flag | What it does |
|---|---|
-a, --all | unmount all mounted file systems (filtered by -t and -O) |
-l, --lazy | lazy unmount—detach file system immediately, clean up later when idle |
-f, --force | force unmount even if file system is busy (use with caution) |
-t TYPE, --types TYPE | unmount only file systems of given type (e.g., ext4, nfs, tmpfs) |
-O OPTIONS, --options-ignore OPTIONS | skip file systems with specified options in fstab |
-n, --no-mtab | do not update /etc/mtab (useful when it's read-only) |
-r, --read-only | if unmount fails, try to remount read-only instead of failing |
-v, --verbose | print verbose messages about unmounting operations |
Examples
unmount the USB drive mounted at /mnt/usb
sudo umount /mnt/usblazy unmount an unresponsive NFS mount—detach immediately, clean up later
sudo umount -l /mnt/stale_nfsunmount a device by its device name instead of mount point
sudo umount /dev/sdb1unmount all ext4 file systems
sudo umount -a -t ext4force unmount a file system (risky; may cause data loss if files are open)
sudo umount -f /mnt/brokenattempt unmount; if busy, remount as read-only instead
sudo umount -r /mnt/readonly_fallback