Típico error cuando se intenta desmontar un dispositivo que está siendo utilizado por alguna aplicación.
target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).)
fuser: Se puede indicar el dispositivo o el punto de montaje.
fuser -m /dev/mapper/vg_ciworker1_wd-agentHome /dev/mapper/vg_ciworker1_wd-agentHome: 19185c fuser -m /opt/bagent_home /opt/bagent_home: 19185c
fuser: Eliminar el/los proceso/s que esté/n utilizando el dispositivo que se desea extraer.
fuser -k /opt/bagent_home
lsof: Se debe indicar el punto de montaje, no el dispositivo (/dev/XXX).
lsof | grep -i /opt/bagent_home bash 19185 root cwd DIR 253,2 4096 2 /opt/bagent_home lsof 19314 root cwd DIR 253,2 4096 2 /opt/bagent_home grep 19315 root cwd DIR 253,2 4096 2 /opt/bagent_home lsof 19316 root cwd DIR 253,2 4096 2 /opt/bagent_home
NOTA: Debido a la tubería con grep es posible que se muestren otros procesos pertenecientes a los mismos programas lsof y grep. En el ejemplo anterior el proceso que impide el desmontaje del dispositivo montado en /opt/bagent_home es bash.
Forzar desmontaje de dispositivos con problemas / Sistemas de ficheros remotos con hosts caidos (smbfs / cifs, ntfs,…).
Ejemplo de punto de montaje cifs cuyo host remoto está caido.
umount //remote/data umount: /mnt/data: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
ls /mnt/data ls: cannot access /mnt/data: Host is down
lsof | grep -i "/mnt/data" lsof: WARNING: can't stat() cifs file system /mnt/data Output information may be incomplete.
Solución: usar la opción “Lazy umount”.
umount -l /mnt/data
The umount command detaches the mentioned file system(s) from the file hierarchy. A file system is specified by giving the directory where it has been mounted. Giving the special device on which the file system lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory. Note that a file system cannot be unmounted when it is 'busy' - for example, when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. The offending process could even be umount itself - it opens libc, and libc in its turn may open for example locale files. A lazy unmount avoids this problem.