umount: /media/usb: target is busy

Fix 'target is busy' when unmounting USB in Linux

USB won't unmount because a process is using it. Use fuser to find and kill it, or lazy unmount if you must. Real fix: close apps first.

You plug in a USB stick, copy some files, then try to unmount it with umount /media/usb and get slapped with umount: /media/usb: target is busy. This happens more often than you'd think, especially after you've opened a file manager window browsing that drive, or a terminal is sitting in a directory on the USB. I had a client last month whose entire print queue died because they yanked a USB drive that was holding a print job. Don't be that person.

Why does this happen?

The kernel won't let you unmount a filesystem that has open files or active processes using it. That's it. Something is reading, writing, or just has a handle on that drive. Maybe it's a background thumbnailer scanning images, a text editor with a file open, or a shell session with its current working directory on the USB. The error is your safety net.

The fix: find and stop the process

The real fix is to find what's holding the mount and deal with it. Don't just yank the cable – you'll risk data corruption. Here's the step-by-step that works.

  1. Identify the mount point. If you're not sure, run mount | grep usb or lsblk to see where it's mounted.
  2. Use fuser to see who's using it. This shows you the process IDs (PIDs) with open files on that mount:
    fuser -v /media/usb
    That'll print something like:
    USER PID ACCESS COMMAND
    user 1234 cwd bash
    user 5678 r-- vim
    The cwd means that process is sitting in a directory on the USB. The r-- means it has a file open for reading.
  3. Kill those processes. If it's safe, kill them with fuser -km /media/usb. That sends SIGKILL to all processes using the mount. It's blunt but effective. For a GUI app like a file manager, you might want to close it normally first.
  4. Try unmount again. Now run umount /media/usb. If it still says busy, repeat fuser to see if something else snuck in.

Sometimes the culprit is a daemon like gvfsd or tracker that indexes files. If fuser shows those, you can disable them temporarily, but often just killing the process works. On my own machine, it's almost always a leftover terminal window.

What if you absolutely must unmount now?

If you're in a pinch and data integrity isn't critical, you can do a lazy unmount. This detaches the filesystem immediately but keeps it mounted in the background until all processes close their handles. It's not ideal – you might lose unsaved data – but it prevents the 'target is busy' error:

umount -l /media/usb

I've used this when a USB drive was stuck and I needed to reboot. But I don't recommend it as a habit. It's like using a crowbar when a key would do.

Still stuck? Check these.

If you've killed everything fuser shows and it still won't unmount, here's what to check:

  • Swap files or loop devices. If the USB is formatted as ext4 with a swap file, or you've attached a loop device to it, unmounting might fail. Run losetup -a to check for loop devices and swapoff if needed.
  • NFS or Samba exports. If you exported that filesystem over the network, clients may hold it. Check exportfs -v and unexport if necessary.
  • Systemd mount units. Sometimes systemd auto-mounts drives and needs a systemctl stop first. Look for units with systemctl list-units | grep media-usb and stop them.
  • A buggy kernel module. Rare, but if none of the above helps, try sync then reboot with the drive attached – it'll unmount cleanly on shutdown.

The key is to never force it unless you have to. Killing the offending process is always better than yanking the cable. Once you've done that a few times, you'll spot the culprit instantly.

Related Errors in Linux & Unix
Codec install fails on Ubuntu 22.04 – quick fix Connection timed out SSH Connection Timed Out on Linux – Quick Fix command not found Fix 'bash: command not found' on Linux – Real Fixes Permission denied (publickey) Permission Denied (publickey) in SSH: Real Fix for Linux

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.