Error Codes Wiki

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

  1. 1Find processes using the filesystem: lsof +f -- /mount/point or fuser -m /mount/point
  2. 2Kill or move processes off the filesystem, then retry umount
  3. 3Use umount -l (lazy unmount) to detach the filesystem from the hierarchy
  4. 4For kernel modules, check dependencies: lsmod | grep module_name
  5. 5For loop devices: losetup -d /dev/loopX to detach

Tags

linuxerrnoebusydevice-busyumount

More in Errno

Frequently Asked Questions

A process has open files or its current directory on that filesystem. Use lsof or fuser to identify which process.