Cannot get rid of automounted directory /hosts/nfs-server/exportA/exportB when NFS server export permission changed
Issue
I wanted to restart automount/autofs to a clean state. But there is a autofs mount that I cannot get rid of.
First I did “systemctl stop autofs” and things like “umount -a -t autofs” and “umount -a -t nfs4”. That mostly worked but it left one directory, see below:
Actual result:
# umount /hosts/nfs-server/exportA/exportB
umount: /hosts/nfs-server/exportA/exportB: block devices are not permitted on filesystem.
Expected result:
- umount should work
Hint: Don`t be bothered to reason what a “block device” does here, this is a separate issue.
Also rest assured there is no process using that directory, otherwise the umount would fail with 'BUSY'
Environment
Red Hat Enterprise Linux
- All major versions believed to be affected
- Reproducer verified on RHEL7, RHEL8, RHEL9 kernels, as well as upstream (6.2-ish) kernels
- Seen on kernel-4.18.0-372.23.1.el8_6.x86_64
- NFS client with (or without) autofs, and the following conditions
- An NFS mount 'B' "cascaded" on top of 'A' (/mnt/exportA/exportB)
- Access to for the NFS client for both 'exportA' and 'exportB' removed on the server
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.