Linux Command: umount
Unmount a filesystem
umount detaches a mounted filesystem from the directory tree. It flushes any cached writes to the device before disconnecting, ensuring data integrity. umount is essential before removing USB drives, external disks, or any removable storage. Removing a device without unmounting can cause data corruption and filesystem damage. umount may fail if processes are using files on the mounted filesystem. Use fuser or lsof to find the blocking processes.
Syntax
umount [OPTION]... DIRECTORY|DEVICEKey Options
-l— Lazy unmount (detach immediately, cleanup later)-f— Force unmount (for unreachable NFS)-a— Unmount all filesystems-R— Recursively unmount
Examples
Unmount filesystem
sudo umount /mnt/usbUnmount by device
sudo umount /dev/sdb1Lazy unmount
sudo umount -l /mnt/busyPro Tips
- Never unplug a USB drive or external disk without unmounting first. Data in write cache will be lost.
- If 'device is busy': use fuser -vm /mnt to find blocking processes, or lsof /mnt. Kill them, then retry.
- umount -l detaches immediately but processes can still access cached data. It is cleaner than force unmount.
Learn more: Full umount reference →