Suppose these is a file foo. Then, suppose I create a hard link:

ln foo bar

I can delete bar by running rm bar. However, it looks like when there are lots and lots of hard links, using rm is as slow as when deleting the inodes themselves (i.e. the last remaining hard links). Is there an efficient method for deleting a lot of hard links that are not the last remaining links to the inodes?

  • It should not make any difference how many hard links there are, rm should just be removing the one directory entry and decrementing the inode reference count. However if all the links are in the same directory it may be that it takes a long time to update the directory because it is large. – greg-449 Nov 5 '16 at 16:01
  • What's the use of having lots and lots of links, soft or hard? – MariusMatutiae Nov 5 '16 at 16:57

Your Answer

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

Browse other questions tagged or ask your own question.