It looks like I have a folder containing a folder with empty file name.
$ ls -alF Antonin_Dvorak/
total 12
drwx------ 3 VUW\me VUW\domain users 4096 Jan 22 2015 /
drwx------ 3 VUW\me VUW\domain users 4096 Jan 22 2015 ./
drwx------ 3 VUW\me VUW\domain users 4096 Aug 25 11:10 ../
It does show up as empty in python.
$ python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir()
['']
>>> len(os.listdir('Antonin_Dvorak')[0])
0
When I switch into the directory and run ls
, I get an error
$ cd Antonin_Dvorak
$ ls
ls: cannot access '': No such file or directory
$ ls -alF
ls: cannot access '': No such file or directory
total 8
d????????? ? ? ? ? ? /
drwx------ 3 VUW\kaipingga VUW\domain users 4096 Jan 22 2015 ./
drwx------ 3 VUW\kaipingga VUW\domain users 4096 Aug 25 11:10 ../
I assume that at some point, the file name may have been an album/music title containing cyrillic characters, but in the meantime moving the folder to a different fs, moving it to trash, and a distribution upgrade happened. The filesystem containing this folder is
$ mount | grep grep $(pwd | head -c 9)
/etc/auto.master.d/issc_nfs_homedir.conf on /vol/home type autofs (rw,relatime,fd=6,pgrp=1310,timeout=300,minproto=5,maxproto=5,direct)
vuwunix01:/vol/vfiler_vuwunix01_data01/users on /vol/home type nfs4 (rw,nosuid,relatime,vers=4.0,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=krb5,clientaddr=132.229.239.78,local_lock=none,addr=132.229.18.60)
I do not want to recover the content, I just want to delete that whole Antonin_Dvorak folder.
$ cd ..; rm -rf Antonin_Dvorak/
rm: cannot remove 'Antonin_Dvorak/': Directory not empty
I do not have root access to this machine at the moment, and note that this is on a network share. What should I do?
Wait, what? I'll edit this into the question body, but:
$ ls -ial Antonin_Dvorak/
total 12
24005685 drwx------ 3 VUW\kaipingga VUW\domain users 4096 Jan 22 2015
24005685 drwx------ 3 VUW\kaipingga VUW\domain users 4096 Jan 22 2015 .
47956345 drwx------ 3 VUW\kaipingga VUW\domain users 4096 Aug 25 11:10 ..
$ #So, no surprise here:
$ find . -maxdepth 1 -type d -inum 24005685 -delete
find: cannot delete ‘./Antonin_Dvorak’: Directory not empty
It's not just a nameless random folder. It's a nameless hard link to the folder itself??
fsck
. Does that get rid of the problem? – Hauke Laging Aug 25 '17 at 09:37fsck
without root access. – Kusalananda Aug 25 '17 at 09:38rm -rf
– mrc02_kr Aug 25 '17 at 09:39rm -r
doesn't get rid of it I suppose nothing except forfsck
will. – Hauke Laging Aug 25 '17 at 10:09.
and the unprintable entry. – Jeff Schaller Aug 25 '17 at 12:26