Assume we have one regular file and two symolic links connected to it. I heard that sometimes it's not possible to replace symbolic links with hard links, but I don't know when.


You can only create hard links between files in the same filesystem, whereas symlinks can point to absolutely anything (including stuff that doesn't exist at all).

Also you can't create hard linked directories on Linux, but you can do that with symlinks.

There's a corner case: you can only have up to a given number of hard links for a given "file". Don't know the exact limits (probably filesystem dependant). There is no such restriction on how many symlinks point to a given name.

  • Link limits I have see are in the range of 32k. The limit is not likely to apply in normal cases. Symlinks do use an Inode on most filesystems, so inode limits become an issue. Hardlinks do not create another inode. – BillThor Apr 18 '11 at 16:08
  • Well there's the weird case of NTFS that's limited to ~2^10 but I'm not sure if feature is actually usable mounted on Linux. Good point about inodes. – Mat Apr 18 '11 at 16:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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