2

In small scale Linux infrastructure environment which link to the file is more helpful, hard or soft link?

As a beginner in Linux administration, I have found that most Linux admins tend to use soft links over hard link. Even though the link may be dangling if the file name gets manipulated. Is there any special or a specific reason towards that?

1

More useful is a matter of opinion, both hard and soft links have very valid use cases but I usually create softlinks:

Directories

You can only create hard links to files and not to directories.
And then since creating hard links frequently fails creating softlinks has become a habit.

Back-ups

I have had issues with back-up software that does not recognise a hard link as such and then your backup might:

  • store a full copy of the linked file for each hardlink rather than the hardlink.

and even when the hardlink was recognised as such restoring it can be a challenge as:

  • the target of the hardlink must be still/already be present or the restore fails1

or when it wasn't archived as a hardlink:

  • your restore will result in files that are no longer linked.
| improve this answer | |

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.