🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

💡 Disk & Storage April 3, 2026 10

Linux Command: umount

Unmount a filesystem

Terminal — Disk & Storage
Command
$ sudo umount /mnt/usb

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|DEVICE

Key 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/usb

Unmount by device

sudo umount /dev/sdb1

Lazy unmount

sudo umount -l /mnt/busy

Pro 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 →

Share this tip