0

In the NTFS, directory junctions used as hard links for a directory. However, on the ext4 file system, no such equivalent exists (to accomplish this task, you have to make a symbolic link). Is there a way to make a hard link (or its equivalent) on ext4?

2

Direction junctions really aren't "hard links". NTFS has very different file system semantics, and there are a number of ways that Direction junctions are nothing like "hard links". For example, if you rename the source directory, the junction becomes invalid --- just like a symbolic link in Linux.

You haven't stated what aspects of Directory Junctions you are interested in for which symbolic links are not sufficient. If is that you want something which can be exported via NFS or CIFS, one option is to use a bind mount. This isn't precisely like a Direction junction; for example, if you move the source directory, the bind mount will still stick around. Also, a bind mount isn't a file system object, but either something that you establish for the current boot using "mount --bind ". You can also add a line in /etc/fstab which will cause the bind mount to be re-established when the system boots, however.

So the answer is the question is there is no exact equivalent in Linux for directory junctions, just as NTFS has no exact equivalent for hard links, symbolic links, or bind mounts. What I would suggest is that you post new question describing a high level description of what it is you are trying to do.

When translating a passage from one language to another, the best way to do that is not to make an exact translation of each word and string them together. A correct translation of a passage will sometimes require a paraphrase, not a series of exact translations. Similarly, you need to give a high-level description of what it is you are trying to do, because there is no such thing as an exact replacement --- just as there is no such thing as an exact replacement for the English verb "to know" in Spanish; it might be "saber", or "conocer", or perhaps something else which would be a more idiomatic translation, depending on how "know" gets used in an English sentence. (For example, in "And Adam knew Eve his wife; and she conceived" neither "saber" nor "conocer" is going to be the correct exact replacement for "know".) We need to see the full English sentence, and in some cases, the full paragraph, in order to make a proper translation.

| improve this answer | |
  • 1
    I thought NTFS hardlinks have always been pretty much exactly like Linux hardlinks; are there significant differences that I've missed? (I know that the recently-introduced NTFS symbolic links still have distinct 'file symlink' and 'directory symlink' types...) – user1686 Mar 15 at 14: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.