Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · disks & space

umount

detach a disk safely

umount — spelt without the first n — detaches a filesystem. Before letting go it writes everything still held in memory to the disk, which is why a drive must be unmounted before it is unplugged.

"Safely remove" on a desktop is umount with a friendlier name.

Give it
Device or directory
either works
Refuses if
Something is using it
"target is busy"
Needs root
Yes
as mount does
Spelling
umount
not unmount

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

root@netflow — bashutil-linux
# umount /mnt/usb
1umount: /mnt/usb: target is busy.
2# lsof +f -- /mnt/usb
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 3310 user cwd DIR 8,17 16384 1 /mnt/usb
3# cd / && umount /mnt/usb
4# ls /mnt/usb
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
Busy means in use

A program has a file open there, or a shell is standing in the directory. Nothing was detached.

2
Finding who is using it

lsof lists the processes with something open on that filesystem. Here a shell’s current directory — cwd — is inside it.

3
Step out, then unmount

Once nothing is using the filesystem, umount succeeds silently.

4
The directory is empty again

The mount point remains, but the disk’s files are no longer reachable. Now it is safe to unplug.

Switches

A switch changes how the command behaves. These are the ones used day to day; man umount lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-l
Lazy: detach now, clean up when no longer in use.
-f
Force, for an unreachable network filesystem.
-R
Recursive: unmount everything mounted beneath as well.
-a
Unmount all filesystems.
-v
Verbose.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

sudo umount /dev/sdb1

Unmounts by device name instead of directory.

sudo umount -l /mnt/nfs

Lazy: detaches now and cleans up when it stops being used. For a hung network share.

sync

Writes all pending data to disk without unmounting.

udisksctl power-off -b /dev/sdb

Powers down a USB drive after unmounting, ready for removal.

In cybersecurity

An unclean removal loses data that the system had already told you was saved.

Writes are delayed

A copy that has "finished" may still be in memory. Pulling the drive before umount returns can leave files truncated or the filesystem damaged.

Avoid forcing it

-f and -l get past a busy mount but do not make it safe. Find and stop whatever is using it instead.

Unmount encrypted volumes when done

While an encrypted volume is mounted its contents are readable. Unmounting and closing it is what puts the protection back.

Filed under

Disks & space

Read alongside