$linuxjunkies
>

umount(8)

Unmount file systems from the directory tree.

UbuntuDebianFedoraArch

Synopsis

umount [OPTION]... MOUNT_POINT|DEVICE

Description

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

FlagWhat it does
-a, --allunmount all mounted file systems (filtered by -t and -O)
-l, --lazylazy unmount—detach file system immediately, clean up later when idle
-f, --forceforce unmount even if file system is busy (use with caution)
-t TYPE, --types TYPEunmount only file systems of given type (e.g., ext4, nfs, tmpfs)
-O OPTIONS, --options-ignore OPTIONSskip file systems with specified options in fstab
-n, --no-mtabdo not update /etc/mtab (useful when it's read-only)
-r, --read-onlyif unmount fails, try to remount read-only instead of failing
-v, --verboseprint verbose messages about unmounting operations

Examples

unmount the USB drive mounted at /mnt/usb

sudo umount /mnt/usb

lazy unmount an unresponsive NFS mount—detach immediately, clean up later

sudo umount -l /mnt/stale_nfs

unmount a device by its device name instead of mount point

sudo umount /dev/sdb1

unmount all ext4 file systems

sudo umount -a -t ext4

force unmount a file system (risky; may cause data loss if files are open)

sudo umount -f /mnt/broken

attempt unmount; if busy, remount as read-only instead

sudo umount -r /mnt/readonly_fallback

Related commands