"umount: target is busy": find what holds the filesystem, and when umount -l is safe
Fix "umount: target is busy" on Linux: find the process with lsof or fuser, leave the folder, stop services, handle NFS and bind mounts, and know when umount -l is safe.
by OhSudo ··
Checked on real software: Linux · November 2026How we check
$ sudo umount /dataumount: /data: target is busy.Something is using that filesystem: a process has a file open there, or has its current directory there. Linux refuses to unmount it, as that could lose data. So the question is who’s holding it, and very often the answer is you.
- A processoften your own shell, cd'd into ituses(fails)
- /dataa file or directory in use(breaks here)so
- umount /datatarget is busy
TL;DR
If that wasn’t it:
sudo lsof +f -- /datasudo fuser -vm /dataThen stop what they show, and try again.
1. Check your own shell first
A terminal whose current directory is inside /data keeps it busy, and it’s the most common cause. Try it in the terminal, which starts in just that situation:
Remember your other windows too: another terminal or tmux pane, an editor, or a file manager showing that folder.
2. Find the process
sudo lsof +f -- /dataCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMErsync 2143 root cwd DIR 8,17 4096 2 /datapython3 2288 app 3w REG 8,17 841234 13 /data/logs/app.logFD tells you how it’s held: cwd is a current directory, a number like 3w is an open file, and txt is a program running from there. If you can’t use lsof, fuser also works, and it’s usually installed with the psmisc package:
sudo fuser -vm /data USER PID ACCESS COMMAND/data: root kernel mount /data root 2143 ..c.. rsync app 2288 F.... python3-m means “anything on this filesystem”, and that kernel line is normal: it’s the mount itself. In ACCESS, c is a current directory, F is a file open for writing, f for reading, and e is a running program.
3. Stop it
A service? Stop it properly, as kill won’t do, because systemd may restart it:
sudo systemctl status 2288sudo systemctl stop myappA plain process? Ask it to exit:
sudo kill 2143fuser can do this for every process at once, after showing you who they are. Check the list first, as this ends everything on the filesystem:
sudo fuser -kvm /dataThen unmount:
sudo umount /dataAlso check for services you might not think of, such as Docker with its data or volumes there, PostgreSQL, swap files (swapon --show, and then sudo swapoff /data/swapfile), or an indexer or antivirus scanning it.
4. lsof shows nothing
It’s still busy, and no process holds it. Here’s what’s left:
Something’s mounted inside it. Unmount those first, deepest first:
findmnt -R /dataTARGET SOURCE FSTYPE/data /dev/sdb1 ext4└─/data/backups /dev/sdc1 ext4sudo umount /data/backupssudo umount /datasudo umount -R /data does this for the whole tree.
A bind mount or another namespace. A container’s mount can keep it alive, and it’s invisible from the host’s lsof. Find them with:
sudo grep -l '/data' /proc/*/mountinfo 2>/dev/nullfindmnt -o TARGET,SOURCE | grep dataThe number in each path is a process ID. Often it’s a container: docker ps, then stop that one. On Kubernetes, it can be a pod that still uses the volume.
LVM, RAID or encryption on top. Those hold the device rather than the mount:
lsblk5. NFS: when the server’s gone
If the NFS server has disappeared, umount may hang or report busy, and lsof itself can hang. Try these, in order:
sudo umount -f /mnt/share # force: for NFS, gives up on the unreachable serversudo umount -l /mnt/share # lazy: see belowlsof -b avoids blocking on it. Mount with soft, or at least with _netdev and x-systemd.automount in /etc/fstab, so that a missing server doesn’t stall your machine at boot.
6. umount -l: lazy unmount
sudo umount -l /dataIt removes the mount from view right away, and really finishes when the last process lets go. It’s not a way to skip finding the cause:
- Programs keep writing to the disk through files they already have open.
- The device can’t be safely unplugged or checked. It isn’t released yet, and
fsckon it can corrupt data. - A new mount on the same folder can hide that it’s still in use.
It’s reasonable for a dead NFS server, or to get out of the way before a reboot. It’s the wrong way to prepare for fsck or for removing a disk.
umount -f is not a stronger version for local disks. On ext4 or XFS, it generally does nothing more, and still reports busy.
7. Then check it worked
No output means it’s unmounted. For something that should stay that way, comment out its line in /etc/fstab, or the next boot mounts it again, or fails if the disk’s gone. To remount from fstab, use sudo mount /data. If you were unmounting to repair it after an error, see read-only file system.
Warning
Don’t pull a disk or detach a cloud volume while it’s busy, even if a lazy unmount made it look free. Data still in the cache is lost, and you may end up with a damaged filesystem. Stop the processes, unmount, then run sync and detach.
Shell, we have a problem!
Similar, but different: umount: /data: not mounted means nothing’s mounted there, so check findmnt. umount: /data: must be superuser means you forgot sudo. For problems mounting it again, see wrong fs type, bad option, bad superblock. Device or resource busy from rm or mv means the same thing, about a folder that’s a mount point. And a full disk is no space left on device: a deleted file a process still holds open keeps using space, and lsof +L1 finds it.
$ ./practice.sh
Practice this in the terminal
Open the Terminal Playground with this article’s scenario loaded. It is safe and runs in your browser.
Found this useful? Share it.
Found a mistake? Let us know at contact@ohsudo.com.