0

This is a solaris machine (unix)

I have a folder contains some subfolders, but there is no file in it.

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 ..

I try to remove it but fail:

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

I try to look for mount point but fail:

root # mount | grep `pwd`

I try to look for process running with pwd in it but fail:

root # fuser -u `find trash`
trash:
trash/src:
trash/src/tob:

Is there any clue how should i delete this folder, without formatting the disk. I'm still a newbie to unix, so please tell me also the command if you are looking for more information.

3

Probably some process is recreating the tob file directly after rm deletes it. Here's a blog post on handling it.

Removing this file only replaces it with another. There are two solutions: manually delete the file on the NFS server, or (if you don't have that type of access) kill its process.

If the file is not on NFS, the advise to check which process has a handle to the file, and kill it still is applicable. Check with:

fuser -u <file>

After killing the process you should be able to delete the directory.

  • 3
    you might want to edit the important parts of the blogpost in your own words into your answer, so the answer stays valid when the link does not work anymore. – Dennis Nolte Oct 8 '15 at 7:54
  • 1
    I added a summary of the blog post, if you disagree with my edit feel free to roll back. – Reaces Oct 8 '15 at 8:03
  • It is not on NFS, and indeed i have already shown the result of fuser -u ``find trash`` which includes the result of fuser -u trash/src/tob and showing there is no process inhibit the deletion. – orb Oct 9 '15 at 2:16
  • Tried rebooting or going to a lower runlevel? Minimizing the number of active daemons. – Anders Olsson Oct 9 '15 at 9:26
  • Yup, and they all fail me :( – orb Oct 18 '15 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.