无法删除文件 rm -rf

尝试删除目录时使用 "rm -rf" 我继续接受 "目录不是空的". 困惑,我看了,为什么,似乎,我陷入困境 "僵尸" 文件。 我不知道如何删除它。 Fdisk - 我唯一的解决方案?

# rm -rf noc
rm: cannot remove directory `noc/INBOX/#msgs': Directory not empty

# rm -rf noc/INBOX/#msgs/000201E5.eml

# rm -rf noc
rm: cannot remove directory `noc/INBOX/#msgs': Directory not empty

# rm noc/INBOX/#msgs/000201E5.eml
rm: cannot remove `noc/INBOX/#msgs/000201E5.eml': No such file or directory

# cd noc/INBOX/#msgs/
# ls -la
ls: cannot access 000201E5.eml: No such file or directory
total 2248
drwx------ 2 root root 2293760 2013-08-27 21:55 .
drwx------ 3 root root 4096 2013-08-27 21:55 ..
-????????? ? ? ? ? ? 000201E5.eml

# ls -iN | cat -A
6346412 000201E5.eml$

# find . -inum 6346412 -exec rm -i {} \;
find: `./000201E5.eml': No such file or directory

# unlink 000201E5.eml
unlink: cannot unlink `000201E5.eml': No such file or directory
已邀请:

小姐请别说爱

赞同来自:



必须

开始未取消和使用

fsck

检查文件系统是否损坏。

如果这没有帮助,请尝试手动检查文件系统。



unlink

该团队只需调用系统

unlink()

功能。 因为他归还了一个错误

No such file or directory

, 您可以从目录结构说到该文件时开始看看。


ls

用途

readdir()

调用并在尝试读取目录中的记录时返回错误。 你需要使用

getdents()

直接呼叫阅读目录。 幸运的是,有一个完整的例子

man 2 getdents

您可以在不改变任何内容的情况下编译和使用。

要回复问题请先登录注册