umount: /mnt/data: target is busy or Device or resource busy means some process is still using the filesystem or device. Linux refuses to unmount it to protect open files. The fix is to find and stop that process, not to force it.
Before you start
- Root access.
- Make sure you are not inside the mount yourself: a shell whose current directory is under the mount point keeps it busy. Run
cd /first.
Find what is using the mount
fuser -vm /mnt/dataLists processes with open files, current directories or memory-mapped files on that filesystem. Alternatively:
lsof +f -- /mnt/dataThe output shows the command, PID, user and file. Common culprits: a shell in that directory, a running backup or rsync, a database whose data lives there, Docker containers with a bind mount, or an NFS/Samba server exporting the path.
Stop the processes
- Stop services cleanly:
systemctl stop mysql,docker compose down, and so on. - For leftover shells or scripts:
kill PID, and only if necessarykill -9 PID. fuser -km /mnt/datakills every process using the mount at once. Use it only when you are sure what will be killed.
Then unmount again:
umount /mnt/dataLazy unmount as a last resort
umount -l /mnt/dataA lazy unmount detaches the mount point immediately and finishes cleanup when the last user closes its files. It is useful for hung network mounts, but processes still holding files keep writing to the old filesystem. Do not use it before removing a disk you care about.
Hung network mounts (NFS, CIFS)
If the remote server is gone, commands touching the mount freeze. Use:
umount -f -l /mnt/nfsand consider the soft and timeo mount options or systemd automount to avoid it in future.
Other "busy" cases
| Situation | Fix |
|---|---|
| Swap device or file in use | swapoff /swapfile before removing or resizing |
| LVM volume busy when removing | Unmount filesystems on it, then lvchange -an vg/lv |
| Device busy when formatting | It is mounted or used by LVM/RAID; check lsblk and dmsetup ls |
| Cannot delete a directory: busy | It is a mount point or in use; check findmnt and lsof |
| Text file busy when replacing a binary | The program is running; stop it, or replace via a new file and rename |
Check before removing a disk
findmnt /mnt/datashows nothing after unmounting.- Remove or comment out its line in
/etc/fstab, or the next boot may hang waiting for it (usenofailfor optional disks).
Busy device FAQ
Is it safe to force unmount?
Forcing can lose data being written. Stop the processes first; use lazy or forced unmounts only for dead network mounts.
Why does it say busy when nothing shows in lsof?
Kernel users such as swap, loop devices, bind mounts or exports hold it. Check swapon --show, losetup -a and findmnt.
Can a reboot fix it?
Yes, but stopping the specific process is faster and safer for running services.
