"Directory not empty" error occurs at the first attempt to remove an NFS share directory.
Issue
- It needs to delete twice the directory which under NFS share and shows "Directory not empty" error.
e.g.
# mkdir test
# cd test/
# cat /etc/yum.conf > file1
# cat /etc/yum.conf >> file1
# cd ..
# rm -rf test/
# rm: cannot remove 'test/': Directory not empty
# cd test/
# ls -hl # empty
# cd ..
# rm -rf test/
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.