这是一个solaris机器(unix)
我有一个文件夹包含一些子文件夹,但没有文件。
root # ls -al `find trash` trash: total 6 drwxrwxrwx 3 root root 512 Aug 6 07:37 . drwxr-xr-x 9 ---- ---- 1024 Oct 8 06:20 .. drwxrwxrwx 3 root root 512 Aug 6 07:37 src trash/src: total 6 drwxrwxrwx 3 root root 512 Aug 6 07:37 . drwxrwxrwx 3 root root 512 Aug 6 07:37 .. drwxrwxrwx 3 root root 512 Aug 6 07:37 tob trash/src/tob: total 4 drwxrwxrwx 3 root root 512 Aug 6 07:37 . drwxrwxrwx 3 root root 512 Aug 6 07:37 ..
我尝试删除它,但失败:
root # rm -rf trash rm: Unable to remove directory trash/src/tob: File exists rm: Unable to remove directory trash/src: File exists rm: Unable to remove directory trash: File exists
我尝试寻找挂载点但失败:
root # mount | grep `pwd`
我试图寻找与pwd运行的进程,但失败:
root # fuser -u `find trash` trash: trash/src: trash/src/tob:
有没有任何线索如何删除此文件夹,而不格式化磁盘。 我仍然是unix的新手,所以如果你正在寻找更多的信息,请告诉我这个命令。
可能有些进程在rm删除之后直接重新创build。 这是一个处理它的博客文章 。
删除这个文件只能用另一个replace它。 有两种解决scheme:手动删除NFS服务器上的文件,或者(如果您没有这种types的访问权限)则终止其进程。
如果该文件不在NFS上,则build议检查哪个进程具有该文件的句柄,并且仍然适用。 请检查:
fuser -u <file>
杀死进程后,你应该能够删除目录。