Cannot cleanup ghost mount points

8,560

Solution 1

Hmmm....I'd be surprised if a reboot would not cure this problem.

However, if you are not into reboots you can try using the lazy unmount option that Linux provides:

 umount -l /my-mount

and that remove it from visible mount table. I've done this with success.

Solution 2

Try referring to the mounted device(s) instead

# umount -f /dev/sdf1

Or, create the mount points, then unmount, then remove the mount points.

Share:
8,560

Related videos on Youtube

jersey bean
Author by

jersey bean

Updated on September 18, 2022

Comments

  • jersey bean
    jersey bean over 1 year

    'mount' command shows several mount points across several disk devices that I had previously setup:

    $ mount
    ...
    /dev/sdf1 on /mnt/<mp1>  type xfs (rw)
    ...
    /dev/sdd1 on /mnt/<mp2>  type xfs (rw)
    ...
    

    But I cannot 'umount' any of these "ghost" mount points:

    $ umount -f /mnt/<mp1>
    mount: /mnt/<mp1>: mountpoint not found
    

    I also checked the directory was removed:

    $ ls -al /mnt
    total 4
    drwxr-xr-x.  2 root root    6 Apr  1 14:57 .
    drwxr-xr-x. 19 root root 4096 Apr  1 13:21 ..
    

    I'm root user running on CentOS7 linux:

    $ whoami
    root
    
    $ cat /etc/*release*
    CentOS Linux release 7.2.1511 (Core) 
    ...
    

    I also tried rebooting my system but those mountpoints still show up. I cannot find any process that would still be using these mounts. What gives??? Any other ideas about how to clean up these 'ghost' mount points?

    • MelBurslan
      MelBurslan about 8 years
      did you try deleting them from /etc/mtab ?
    • Jesse K
      Jesse K about 8 years
      Related, do they exist in /etc/fstab?
    • ott--
      ott-- about 8 years
      Tho you can't see those dirs, there may be one or more processes using them. Try if they are shown with fuser /mnt or lsof /mnt.
    • ott--
      ott-- about 8 years
      That above should be lsof +D /mnt and fuser -m /mnt.
    • jersey bean
      jersey bean about 8 years
      I did remove them from fstab. But had no idea about mtab file. I removed them from there and that did the trick! thanks!