Cannot cleanup ghost mount points
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.
Related videos on Youtube
jersey bean
Updated on September 18, 2022Comments
-
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 about 8 yearsdid you try deleting them from
/etc/mtab
? -
Jesse K about 8 yearsRelated, do they exist in
/etc/fstab
? -
ott-- about 8 yearsTho you can't see those dirs, there may be one or more processes using them. Try if they are shown with
fuser /mnt
orlsof /mnt
. -
ott-- about 8 yearsThat above should be
lsof +D /mnt
andfuser -m /mnt
. -
jersey bean about 8 yearsI did remove them from fstab. But had no idea about mtab file. I removed them from there and that did the trick! thanks!
-