How to Identify and Kill Processes Using the fuser Command in Linux

When you attempt to safely eject a USB flash drive or unmount a network storage volume in Linux, the kernel will often throw a violent “Device or resource busy” error. This means a rogue background process or a hidden application is secretly reading or writing data to the drive, mathematically preventing the unmount execution. If you simply pull the physical drive out, you will corrupt the entire file system. To instantly force the kernel to identify and violently terminate the exact process holding the file hostage, you must use the fuser command.

Identifying the Hostage Process

The fuser command is a deep-level diagnostic engine that mathematically scans the entire Linux file system, searching for any active CPU process that has locked onto a specific file, directory, or socket.

If you cannot eject your USB drive (mounted at /mnt/usb_drive), you must command fuser to audit the entire directory structure:

fuser -v /mnt/usb_drive

The -v (verbose) flag forces the engine to translate raw Process IDs into a highly readable, human-friendly table. The terminal will instantly output a list showing the exact user running the process, the numerical Process ID (PID), and the literal name of the command or application (e.g., bash, rsync, or nano) that is secretly accessing the drive.

Once you see this table, you instantly know exactly which program is causing the unmount failure.

Violently Killing the Process

If the rogue process is a frozen script or a crashed application that refuses to close normally, you cannot politely ask it to release the drive. You must force the kernel to execute a hard kill command.

The fuser tool has a deeply integrated, highly destructive termination mode. By appending the -k (kill) flag, you command the engine to identify the process and instantly assassinate it in the same millisecond.

fuser -k /mnt/usb_drive

The moment you press Enter, the system rips through the directory, identifies the specific Process ID holding the drive hostage, and sends a ruthless SIGKILL signal directly to the CPU. The process is instantly obliterated, the file lock is mathematically shattered, and the USB drive is completely freed, allowing you to safely unmount and eject the hardware without risking data corruption.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.