无法删除持久性愚蠢文件

无法删除持久性愚蠢文件

Linux Mint 18.3(基于 Ubuntu Xenial)

这是一台带有 W10 的双启动机器,这可能意义重大

我正在尝试删除一些后台作业。使用rm -rf top-level-dir不起作用:我收到一条意外消息,提示“目录不为空”。

深入研究有问题的目录,我得到:

mike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/mike/.local/share/gvfs-metadata $  ls -lsa
total 13 
// TOTAL THIRTEEN??? WHY IS ONLY ONE FILE LISTED?
8 drwxrwxrwx 1 root root 8192 Oct 11 23:35 .
4 drwxrwxrwx 1 root root 4096 Oct 11 23:35 ..
1 -rwxrwxrwx 0 root root  200 May 27  2018 computer:
// OH DEAR, THE FILENAME ENDS WITH A COLON: LOOKS OMINOUS
// HERE I'M TRYING TO REMOVE THIS ONE FILE
mike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/mike/.local/share/gvfs-metadata $  rm computer:
rm: cannot remove 'computer:': No such file or directory
mike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/mike/.local/share/gvfs-metadata $  cat computer\: 
�meta&op�� [
�&0Khnemo-list-view-sort-columnnemo-list-view-sort-reversednemo-list-view-zoom-level���[
�'/���1falsenamemike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/gvfs-metadata $  e
// HERE I'M TRYING TO MV IT TO A MORE SENSIBLE NAME (NOT ENDING IN COLON)
mike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/mike/.local/share/gvfs-metadata $  mv computer: spot
mv: cannot stat 'computer:': Input/output error

我切换到root:

mike@M17A /media/Shared/backintime/backintime/M17A/root/1/20180731-120001-297/backup/home/mike/.local/share/gvfs-metadata $  su
Password: 
M17A gvfs-metadata # ls -lsa
ls: cannot access 'computer:': Input/output error
total 12
8 drwxrwxrwx 1 root root 8192 Oct 11 23:44 .
4 drwxrwxrwx 1 root root 4096 Oct 11 23:35 ..
? -????????? ? ?    ?       ?            ? computer:
// WELL I APPEAR TO HAVE DONE SOMETHING TO THIS "FILE" ... BUT WHAT?
M17A gvfs-metadata # rm computer
rm: cannot remove 'computer': No such file or directory
M17A gvfs-metadata # rm computer:
rm: cannot remove 'computer:': Input/output error
M17A gvfs-metadata # mv computer: spot
mv: cannot stat 'computer:': Input/output error

答案1

这是一个古老的解决方案,这意味着只有像我这样的老家伙才记得它。

查找文件的 inode ls -i。假设它是 1611645009。然后在您提到的目录中执行命令 find $NAME_OF_DIRECTORY -inum 1611645009 -exec /bin/rm {} \;

如果这还不行,那我也很困惑。

相关内容