无法删除Linux目录 – 无限recursion

我们在支持我们的版本控制服务器的RHEL6虚拟机上安装了一个NFS挂载 – 最近,其中一个存储库变得有些疯狂,这就是我在服务器上发现的:

ls -latri repo.git/refs/heads/ total 28 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 . 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 5551209 drwxr-xr-x. 3 git git 4096 Jun 1 22:09 .. 

当我针对目录运行tree ,似乎是无限recursion – 例如:

 repo.git/refs/heads/ ├── │  ├── │  │  ├── │  │  │  ├── │  │  │  │  ├── │  │  │  │  │  ├── │  │  │  │  │  │  ├── │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  ├── │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  ├── 

我试图通过它的inode ref删除版本库:

 [root@node repo.git/refs]# ls -latri total 16 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 heads [root@node repo.git/refs]# find . -inum 5551210 -exec rm -rf {} \; rm: cannot remove `./refs/heads': Directory not empty find: `./refs/heads/': No such file or directory find: `./refs/heads/': No such file or directory 

我有点茫然,在这里做什么 – ls -latri命令的inode信息似乎表明在'heads'目录中有2个目录是硬链接到目录的目录?

任何关于如何清理这个问题的想法都是非常受欢迎的 – 我想我已经解决了它造成的应用程序问题,但文件系统的更大的问题需要sorting。

谢谢!

编辑:额外的输出位:

没有隐藏的字符:

 [root@node repo.git/refs]# ls -latrib heads/ total 28 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 . 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 5551209 drwxr-xr-x. 3 git git 4096 Jun 1 22:09 .. 

但是当我真的脑袋里时,这里有一些有趣的输出:

 [root@node repo.git/refs/heads]# ls -latrib ls: cannot access : No such file or directory ls: cannot access : No such file or directory total 12 ? -?????????? ? ? ? ? ? ? -?????????? ? ? ? ? ? 5551210 drwxr-xr-x. 2 git git 8192 Jun 1 21:21 . 5551209 drwxr-xr-x. 3 git git 4096 Jun 1 22:09 .. 

首先:Git既不是原因,也不是解决一个问题的方法,这个问题performance为ls无意义输出。 停止在文件系统上使用Git或其他工具,并卸载它,以避免伤害。

这看起来像是一个破损的文件系统或一个破损的挂载。 尝试卸载并重新安装客户端上的文件系统。 尝试完全重新启动客户端。 尝试在另一个客户端上执行相同的挂载。 每次检查ls输出是否正常。 这将帮助您诊断问题是否在NFS服务器端。 如果ls输出继续看起来一样,那么调查和修复文件系统( fsck或其他)和/或NFS服务(重新启动NFS相关的daemoons;如果nfsd是在内核中重新启动)需要在服务器端进行。