0

I have a file named .viminfo in home directory. I can see that the file is there by ls -lh:

$ ls lh
...
drwxr-xr-x.  2 mt1022  1091 4.0K Oct 12  2016 .vim
-??????????  ? ?         ?        ?            ? .viminfo
-rw-r--r--.  1 mt1022  1091  305 Nov  9  2013 .vimrc
...

However I cannot delete this file:

$ rm .viminfo
rm: cannot remove '.viminfo': No such file or directory

I saw somewhere that such files are corrrupted can be deleted by inode number. However, when I run ls -i I got the following output for the file:

145563901919042729 .cpan            144115239380596661 .vim     
145563901918974272 .cpanm                            ? .viminfo 
145564136279985406 .dask            144115238810163333 .vimrc  

I also tried sudo chmod g+x .viminfo (answer to a very similar post on this site). I still got no such file or directory error.

My question is How to delete such a corrupted file?


additional info that might be helpful:

  1. The file is stored on a lustre file system.
  2. The file was normal before and become corrupted after a recent sudden power outage.
  3. The file is not fixed during fsck.
mt1022
  • 101

1 Answers1

1

The question marks in the ls output indicate that it could not stat() the directory entry.

You can also see those if you try to list a directory for which you have r(ead) but not x (search) permission. However, in that case, it would not report I/O error.

In your case it seems to me like there is some disk or filesystem corruption.

Try checking dmesg or /var/log/messages for more information.

Itai Ganot
  • 10,976