umount
file managementLinux/Unix
The umount command is one of the most frequently used commands in Linux/Unix-like operating systems. umount Unmount file systems
Quick Reference
Command Name:
umount
Category:
file management
Platform:
Linux/Unix
Basic Usage:
umount [options] [arguments]
Common Use Cases
Syntax
umount [options] <source> | <directory>
Options
Option | Description |
---|---|
-a, --all |
Unmount all file systems described in /etc/mtab |
-A, --all-targets |
Unmount all mountpoints for the specified device in the current namespace |
-c, --no-canonicalize |
Don't canonicalize paths |
-d, --detach-loop |
When unmounting a loop device, also free the loop device |
-f, --force |
Force unmount (in case of an unreachable NFS system) |
-i, --internal-only |
Don't call the umount.<type> helper even if it exists |
-l, --lazy |
Detach the filesystem now, clean up references later |
-n, --no-mtab |
Don't write to /etc/mtab |
-O, --test-opts <list> |
Limit the set of filesystems (use with -a) |
-q, --quiet |
Suppress 'not mounted' error messages |
-R, --recursive |
Recursively unmount a target with all its children |
-r, --read-only |
If unmounting fails, try to remount read-only |
-t, --types <list> |
Limit the set of filesystem types |
-v, --verbose |
Say what is being done |
-h, --help |
Display help text and exit |
-V, --version |
Print version and exit |
Examples
How to Use These Examples
The examples below show common ways to use the umount
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
# Unmount a file system by mount point
sudo umount /mnt/usb