Unmount busy filesystem

I'm trying to unmount a backup filesystem that I don't need anymore. When I run the "umount" command, system says:

umount: /backup: target is busy

And following commands does not work and same reason (busy) returns to me:

fuser -cuk /backup
fuser -k -9 /backup
umount -f /backup
mount -o remount /backup; umount /backup

and

lsof |grep /backup | grep -v "backup.log"

command returns nothing already. (grep -v is because ignore backup.log files. If I'm wrong I can change.)

Why I cannot umount this filesystem and how can I do?


Edit:

Commands those are I tried and outputs of them:

myserver:~ # fuser -cuk /backup
myserver:~ # fuser -k -9 /backup
myserver:~ # umount -f /backup
umount: /backup: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).)
myserver:~ # mount -o remount /backup; umount /backup
umount: /backup: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).)
myserver:~ #

OS Version:

myserver:~ # cat /etc/os-release
NAME="SLES_SAP"
VERSION="12-SP2"
VERSION_ID="12.2"
PRETTY_NAME="SUSE Linux Enterprise Server for SAP Applications 12 SP2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles_sap:12:sp2"

And when I check the I/O with "iostat" command I see the physical disk (/dev/sdx) that mounted to this filesystem, there are reading but no writing.

Mounted list:

myserver:~ # mount | grep backup
/dev/mapper/vgbackup-lvbackup on /backup type xfs (rw,relatime,attr2,inode64,noquota)
4

1 Answer

There's this question on Linux & Unix SE: umount: device is busy. Why?

Few answers:

  1. It seems the cause for my issue was the nfs-kernel-server was exporting the directory. The nfs-kernel-server probably goes behind the normal open files and thus is not listed by lsof and fuser.

    When I stopped the nfs-kernel-server I could umount the directory.

  2. the cause for my manifestation of this problem just now was a stale loopback mount. I'd already checked the output of fuser -vm <mountpoint>/lsof +D <mountpoint>, mount and cat /proc/mounts, checked whether some old nfs-kernel-server was running, turned off quotas, attempted (but failed) a umount -f <mountpoint> and all but resigned myself to abandoning 924 days' uptime before finally checking the output of losetup and finding two stale configured-but-not-mounted loopbacks

  3. For me, the offending process was a daemon running in a chroot. Because it was in a chroot, lsof and fuser wouldn't find it.

    If you suspect you have something left running in a chroot, sudo ls -l /proc/*/root | grep chroot will find the culprit (replace "chroot" with the path to the chroot).

  4. Anonymous inodes

    […]

    These are the most elusive type of pokemon, and appear in lsof's TYPE column as a_inode (which is undocumented in the lsof man page).

    They won't appear in lsof +f -- /dev/<device>, so you'll need to:

    lsof | grep a_inode

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like