GrepBoard/Manuals
605 manuals ·

"umount: target is busy" — find the process holding the mount

·Tested on Ubuntu 24.04 · util-linux 2.39.3 · lsof 4.95.0 · psmisc 23.7 · 2026-10·Test scope ↓·6 steps

"umount: target is busy" means a process has its working directory or an open file on that mount. Find it with fuser -vm or lsof +f, stop it, avoid umount -l.

output
umount: /mnt/data: target is busy.

Some process has its working directory (cwd) inside that filesystem or holds a file open there, so it cannot be detached. The umount(8) man page lists the same cases: open files, a working directory, or a swap file in use (umount(8)). Find the process, end it cleanly, and the unmount goes through.

[1] Confirm the target with findmnt. Use the exact mount point path.

console
# findmnt /mnt/dataTARGET    SOURCE FSTYPE OPTIONS/mnt/data tmpfs  tmpfs  rw,relatime,size=8192k,inode64

[2] Check your own shell first. If your terminal is cd'd somewhere under /mnt/data, that shell is the culprit. Run cd / and try again.

[3] Find processes using the filesystem with fuser -vm. -m covers the whole filesystem that contains the path. If a minimal Ubuntu server lacks it, it is in the psmisc package.

console
# fuser -vm /mnt/data                     USER        PID ACCESS COMMAND/mnt/data:           root     kernel mount /mnt/data                     root      407158 ..c.. sleep                     root      407159 F.... sleep

Ignore the kernel mount line; that is the mount itself. In ACCESS, c means the process's working directory is there, and F means it holds an open file.

[4] Use lsof +f -- to see which files. +f makes lsof treat the path as a filesystem.

console
# lsof +f -- /mnt/dataCOMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAMEsleep   407158 root  cwd    DIR   0,50       60    1 /mnt/datasleep   407159 root    3w   REG   0,50        6    2 /mnt/data/app.log

cwd in FD is a working directory; 3w is file descriptor 3 open for writing. Ending only one of them is not enough. In the test, after the process holding the working directory exited, umount failed the same way again, and lsof still showed the process with app.log open.

[5] End those processes the normal way. For a service, systemctl stop <service>; for someone's shell, ask them to leave; kill <PID> only what remains. Once all are gone, the unmount works.

console
# umount /mnt/data && findmnt /mnt/data; echo "exit=$?"exit=1

findmnt printing nothing and returning 1 means the mount is gone.

[6] Treat umount -l (lazy) as postponing the problem, not fixing it. The mount vanishes from the list at once, but processes keep writing inside it. The block below is a reproduction showing what happens, not a step to follow.

console
# umount -l /mnt/data && findmnt /mnt/data; echo "exit=$?"exit=1# lsof +f -- /mnt/data; echo "exit=$?"lsof: not a file system: /mnt/dataexit=1# ls -l /proc/407174/fd/3l-wx------ 1 root root 64 Oct 27 06:55 /proc/407174/fd/3 -> /app.log

With the mount detached, lsof can no longer find it, yet the process keeps writing to a file whose path now shows as /app.log. The device is not actually released, so do not pull the disk or mount the same device again in this state. The man page limits the recommended use of -l to preventing shutdown hangs caused by an unreachable network share, and says to expect a reboot soon if you use it on a network filesystem or a local filesystem with submounts.

If you already detached it lazily, the path no longer finds anything, so search by device number. The DEVICE column in lsof stays the same after the detach. Get the number before detaching from findmnt -no MAJ:MIN <mount point> or from the DEVICE column of the lsof output in [4] (in the test, 0:52, shown by lsof as 0,52).

console
# lsof +f -- /mnt/data; findmnt -no MAJ:MIN /mnt/dataCOMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAMEsleep   441394 root    1w   REG   0,52        0    2 /mnt/data/app.log  0:52

After the lazy detach, find the remaining processes by that device number. The path has changed to /app.log, but DEVICE still matches.

console
# lsof -n 2>/dev/null | awk '$6=="0,52"'sleep     441394                              root    1w      REG               0,52         0          2 /app.log

End those processes the normal way as in [5] (systemctl stop, asking the user to log out, kill <PID> last), and repeat until the count is 0. Only then pull the device or mount it again.

console
# kill 441394; sleep 1; lsof -n 2>/dev/null | awk '$6=="0,52"' | wc -l0

If you edited the /etc/fstab line before mounting again, run check fstab with findmnt before rebooting.

#umount#fuser#lsof#findmnt#mount