Clicking the Eject button beside your flash drive or external SSD in Ubuntu only to get blocked by “Unable to unmount — target is busy” (or umount: target is busy) means Linux still sees at least one app, open document, or forgotten Terminal tab holding a folder on that drive open. Pulling the USB cable out straight away while buffers are finishing writes risks corrupting documents, whereas tracking down the hidden holder safely takes ten seconds.
1. Check Open Files, Browser Downloads, and Minimised Windows
Nine times out of ten, Ubuntu refuses to unmount a USB drive for simple everyday reasons sitting behind other windows:
- An open Terminal tab or script: Even if you are not running commands right now, having any Terminal tab whose current working folder is
/media/yourname/USBDrivekeeps the drive locked busy. Typecd ~and press Enter inside every Terminal tab. - Hidden File Explorer tabs or previews: Check Ubuntu’s Files window to make sure no second tab or PDF/video preview window still sits inside the USB folder.
- Background browser uploads or LibreOffice locks: If you opened a Word/Excel file or uploaded a photo straight from the USB stick in Chrome or Firefox, close that specific browser tab or save and exit LibreOffice so its hidden
.~lockfile clears cleanly. - Recent file transfer still flushing write cache: Large video copies frequently finish showing the progress circle visually while Linux finishes writing the last few hundred megabytes cleanly onto slow flash chips — wait 15 seconds and click Eject once more before concluding it is stuck.
2. Spot Exactly Which App Is Locking the Drive in Terminal
When every visible window looks closed yet Ubuntu still refuses to let the drive go, ask Linux directly which process is holding onto it:
- Open Terminal (press Ctrl + Alt + T).
- Find your mounted USB path cleanly (it normally starts with
/media/):lsblk - Ask
lsoforfuserwhich program is using that exact mount folder (replace/media/$USER/MyUSBwith your real drive name):lsof +f -- /media/$USER/MyUSB - Read the left-hand
COMMANDcolumn (for examplenautilus,vlc,bash, ortracker-miner). Close that app normally — or if an unresponsive background process hangs, close only that process PID cleanly viakill PID.
3. Safely Eject Without Damaging Files (And Avoid Lazy Unmount Unless Stuck)
Once the blocking window closes, return to Ubuntu Files and click the small Eject icon beside the drive (or run sync && udisksctl unmount -b /dev/sdb1 in Terminal, replacing sdb1 with your real drive partition). Wait until the notification says it is safe to unplug before physically pulling out the USB connector — especially on BitLocker or NTFS drives shared with Windows (see also unlocking Windows BitLocker drives safely in Ubuntu and fixing USB drives not mounting in Ubuntu).