Unmount busy filesystem












0















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"
ID="sles_sap"
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)









share|improve this question

























  • yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

    – Gefolge
    Dec 24 '18 at 10:23











  • One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

    – xenoid
    Dec 24 '18 at 10:36











  • I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

    – Gefolge
    Dec 24 '18 at 10:52













  • my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

    – Gefolge
    Dec 24 '18 at 11:08


















0















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"
ID="sles_sap"
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)









share|improve this question

























  • yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

    – Gefolge
    Dec 24 '18 at 10:23











  • One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

    – xenoid
    Dec 24 '18 at 10:36











  • I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

    – Gefolge
    Dec 24 '18 at 10:52













  • my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

    – Gefolge
    Dec 24 '18 at 11:08
















0












0








0








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"
ID="sles_sap"
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)









share|improve this question
















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"
ID="sles_sap"
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)






linux filesystems umount






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 24 '18 at 11:07







Gefolge

















asked Dec 24 '18 at 8:26









GefolgeGefolge

349217




349217













  • yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

    – Gefolge
    Dec 24 '18 at 10:23











  • One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

    – xenoid
    Dec 24 '18 at 10:36











  • I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

    – Gefolge
    Dec 24 '18 at 10:52













  • my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

    – Gefolge
    Dec 24 '18 at 11:08





















  • yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

    – Gefolge
    Dec 24 '18 at 10:23











  • One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

    – xenoid
    Dec 24 '18 at 10:36











  • I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

    – Gefolge
    Dec 24 '18 at 10:52













  • my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

    – Gefolge
    Dec 24 '18 at 11:08



















yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

– Gefolge
Dec 24 '18 at 10:23





yes. none of them works. How can I check respawned processes? If there is one of them, how can't I see this processes or open files? It's so weird.

– Gefolge
Dec 24 '18 at 10:23













One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

– xenoid
Dec 24 '18 at 10:36





One thing that doesn't show in lsof is mount points. So, if you have mounted something to a directory in that filesystem, or mounted a file from that FS somewhere else (mount -o loop ...) they won't show in lsof but prevent umounting.

– xenoid
Dec 24 '18 at 10:36













I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

– Gefolge
Dec 24 '18 at 10:52







I cannot see anything that mounted to /backup or under of /backup at neither fstab nor df -h command.

– Gefolge
Dec 24 '18 at 10:52















my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

– Gefolge
Dec 24 '18 at 11:08







my question format has been broken :) it doesn't show code blocks. I'm so lucky today. (ok that was my fault. i fixed it.)

– Gefolge
Dec 24 '18 at 11:08












1 Answer
1






active

oldest

votes


















1














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







share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1387322%2funmount-busy-filesystem%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    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







    share|improve this answer






























      1














      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







      share|improve this answer




























        1












        1








        1







        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







        share|improve this 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








        share|improve this answer














        share|improve this answer



        share|improve this answer








        answered Dec 24 '18 at 11:29


























        community wiki





        Kamil Maciorowski































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1387322%2funmount-busy-filesystem%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...