I logged into rhel 7 box (a docker container) and runs as root. I tried to remove a directory and I keep getting Invalid argument error. Here is my command
[root@sandbox ~]# rm -rf /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5
rm: cannot remove `/var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5': Invalid argument
Here is the permission of that folder
[root@sandbox ~]# ls -lrth /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/
total 4.0K
drwxr-xr-x 1 root root 4.0K Nov 7 07:50 5.5.2.2.5
The folder is actually empty:
[root@sandbox ~]# ls -lrth /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5/
total 0
Trying to put the path in quote is not working either:
[root@sandbox ~]# rmdir "/var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5"
rmdir: failed to remove `/var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5': Invalid argument
Delete by using inode is not working either:
[root@sandbox ~]# ls -il /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/
total 4
98616 drwxr-xr-x 1 root root 4096 Nov 7 07:50 5.5.2.2.5
root@sandbox ~]# find . -inum 98616 -exec rm -i {} \; # doesn't throws error but the folder is still there
[root@sandbox ~]# ls /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/
5.5.2.2.5
Delete by using find is not working either:
[root@sandbox ~]# find /var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/ -type d -exec rm -Rf {} \;
rm: cannot remove `/var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5': Invalid argument
rm: cannot remove `/var/lib/ambari-server/data/tmp/solr-service/custom-services/SOLR/5.5.2.2.5': Invalid argument
How to remove that folder?