Linux umount Command: Unmount a Filesystem Safely
umount detaches a mounted file system from the directory tree. It is used to unmount USB storage devices or temporary mounts, and the command name is unmount, not umount.
What is the umount command?
Before unmounting, you must ensure that all writes to the file system are complete and that no processes are using the files. If it is in use, you usually get a target is busy error. You can specify either the mount point or the device, but if connected in multiple places, the mount point is clearer.
Basic syntax
umount [option] mount_point|device
The installed implementation and options may vary depending on the distribution. Check the current system's description with man umount.
Examples
Check the target for unmounting
Check the device and the actual mount point.
findmnt /mnt/data
Normal unmounting
Move the current shell's working directory out of the target and then unmount.
sudo umount /mnt/data
Check unmount results
Check whether the mount at the specified path has disappeared.
findmnt /mnt/data
Check Whether Unmounting Was Successful
umount detaches a filesystem from the directory tree. If there are processes using the target path, it may fail with an error like target is busy.
findmnt /mnt/data sudo umount /mnt/data findmnt /mnt/data
If the unmount is successful, umount usually does not print anything, and the last findmnt will not show the corresponding mount entry. The mount point directory may remain.
Forcibly detaching files that are in use can risk data loss, so first check the working directory and open files. lsof or fuser can be helpful. Before disconnecting external storage devices, make sure any write operations are completed.
Main Options and Format
| Options/Format | Description |
|---|---|
-R |
Recursively unmount child mounts under the specified mount point. |
-l |
Lazy unmount. It may not be completely cleaned up until it is no longer in use. |
-f |
Attempt forced unmount on certain network file systems. |
-t format |
Only targets the specified file system type. |
Precautions when using
If umount gives a busy error, check the current shell location and files/processes in use. -l is not a safe default option that immediately resolves the problem, and -f also carries the risk of data loss. Make sure any important writes are completed before unmounting and physically remove the device.
Frequently Asked Questions
Why does umount show 'target is busy'?
This is because the process's current directory or open files are using the file system. Check the users and try again after they have finished their tasks.
Official Documentation
You can check the exact behavior of the options and implementation-specific differences in the official documentation related to umount.









