Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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