Linux errno 16 EBUSY — Device or Resource Busy
Errorerrno
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
Tags
linuxerrnoebusydevice-busyumount
More in Errno
linux-errno-1-epermLinux errno 1 (EPERM) — Operation Not Permitted
Warninglinux-errno-2-enoentLinux errno 2 (ENOENT) — No Such File or Directory
Warninglinux-errno-5-eioLinux errno 5 (EIO) — Input/Output Error
Errorlinux-errno-11-eagainLinux errno 11 (EAGAIN) — Resource Temporarily Unavailable
Informationallinux-errno-12-enomemLinux errno 12 (ENOMEM) — Out of Memory
Criticallinux-errno-13-eaccesLinux errno 13 (EACCES) — Permission Denied
WarningFrequently Asked Questions
A process has open files or its current directory on that filesystem. Use lsof or fuser to identify which process.