Linux errno 16 EBUSY — Device or Resource Busy
About Linux errno 16 EBUSY
Linux errno 16 (EBUSY) indicates a device or resource is in use and cannot be modified, common when unmounting filesystems or removing loaded modules. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: EBUSY is errno 16 on Linux systems. Most common when trying to unmount a filesystem with open files. Also occurs when removing a kernel module that is in use. Can happen when deleting a directory that is a mount point. The resource is locked by another process and cannot be released. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Process has open files on a filesystem being unmounted. Shell current directory is on the filesystem being unmounted. Kernel module is loaded and in use by another module or device. Swap partition active and cannot be removed. Loop device still attached to a file. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Find processes using the filesystem: lsof +f -- /mount/point or fuser -m /mount/point. Kill or move processes off the filesystem, then retry umount. Use umount -l (lazy unmount) to detach the filesystem from the hierarchy. For kernel modules, check dependencies: lsmod | grep module_name. For loop devices: losetup -d /dev/loopX to detach. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
What does 'target is busy' mean when unmounting?
A process has open files or its current directory on that filesystem. Use lsof or fuser to identify which process.
Overview
Linux errno 16 (EBUSY) indicates a device or resource is in use and cannot be modified, common when unmounting filesystems or removing loaded modules.
Key Details
- EBUSY is errno 16 on Linux systems
- Most common when trying to unmount a filesystem with open files
- Also occurs when removing a kernel module that is in use
- Can happen when deleting a directory that is a mount point
- The resource is locked by another process and cannot be released
Common Causes
- Process has open files on a filesystem being unmounted
- Shell current directory is on the filesystem being unmounted
- Kernel module is loaded and in use by another module or device
- Swap partition active and cannot be removed
- Loop device still attached to a file
Steps
- 1Find processes using the filesystem: lsof +f -- /mount/point or fuser -m /mount/point
- 2Kill or move processes off the filesystem, then retry umount
- 3Use umount -l (lazy unmount) to detach the filesystem from the hierarchy
- 4For kernel modules, check dependencies: lsmod | grep module_name
- 5For loop devices: losetup -d /dev/loopX to detach