target is busy 🐧 Linux

umount: target is busy / Device or resource busy

The filesystem or device can’t be unmounted or removed because a process is still using it.

Seen on: Linux

Meaning

Any open file, a shell whose current directory is inside the mount, a running container, or an active swap/loop device keeps it busy.

Common causes

  • A shell or process has its working directory inside the mount
  • Open files (logs, databases) on the mount
  • Docker/containers using it
  • NFS mount with hung I/O

⚡ Quick fix

  1. Find the users: sudo lsof +f -- /mnt/data or fuser -vm /mnt/data
  2. cd out of the directory and stop the processes
  3. Last resort: umount -l (lazy)

Detailed fix by platform

Linux

  1. bash
    sudo fuser -vm /mnt/data
    sudo lsof +f -- /mnt/data
    sudo umount /mnt/data   # or: sudo umount -l /mnt/data

How to diagnose

  1. Processes — fuser/lsof output
  2. Shells — Any terminal cd’d there?
  3. NFS — Server reachable?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.