1

'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?

5
  • 2
    did you try deleting them from /etc/mtab ?
    – MelBurslan
    Apr 1, 2016 at 19:51
  • Related, do they exist in /etc/fstab?
    – Jesse K
    Apr 1, 2016 at 20:57
  • 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--
    Apr 1, 2016 at 21:35
  • That above should be lsof +D /mnt and fuser -m /mnt.
    – ott--
    Apr 1, 2016 at 22:04
  • I did remove them from fstab. But had no idea about mtab file. I removed them from there and that did the trick! thanks! Apr 1, 2016 at 23:08

2 Answers 2

4

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.

1
  • I get the same error as if I try umount -f /mnt/<mp1> Apr 1, 2016 at 23:01
1

Try referring to the mounted device(s) instead

# umount -f /dev/sdf1

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

1
  • Tried that and it didn't work. As suggested above, i removed the references in /etc/mtab. That seemed to work. Apr 3, 2016 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .