Monday, January 13, 2020

linux - CentOS: eror when removing file: "rm: cannot remove '.viminfo': No such file or directory"

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.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...