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.
  • Is that directory you on a NFS share or any other network filesystem? – Thomas Jul 29 '18 at 9:24
  • @Thomas, sorry for the delay. the file is on a local lustre file system. – mt1022 Jul 29 '18 at 11:28
  • 1
    In that case you should check your lustre stuff for errors or excessive caching of dnode entries. What this basically means is that the inode block of the file is not accessible anymore, but the directory entry got not deleted. You could try echo 3 > /proc/sys/vm/drop_caches to get rid of caches, but I doubt that will do the trick and the problem is somewhere deeper. – Thomas Jul 29 '18 at 11:37
  • @Thomas, Thanks for the suggestion. I am quite a layman of this field. I'll ask the administrator to try that when he is available. – mt1022 Jul 29 '18 at 11:44
  • 1
    Your filesystem is still corrupt. Go run lfsck. Don't try to do anything else until you've fixed it. – Michael Hampton Jul 29 '18 at 12:55
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.

  • Thanks for the suggestion. I'll try it when the admin is available. – mt1022 Jul 29 '18 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.