What is the difference between NTFS hard links and directory junctions?
-
The title says it all... what's the difference? When do I use one and when do I use the other? Added: Note that http://en.wikipedia.org/wiki/NTFS_junction_point, http://en.wikipedia.org/wiki/Hard_link and http://en.wikipedia.org/wiki/NTFS_symbolic_link are three separate things on NTFS.
-
Answer:
NTFS data files are stored with all their attributes as an "inode" with an ID, and filenames point to the inode. All files have one+ hardlink. some tools can create extra names (hardlinks) which point to the same inode, which has a counter of the number of names pointing to it. If the number goes to zero, the OS deletes the file, the inode. Special tools, like LN can create additional filenames which point to existing inodes, using a filename that points to them. Note that all the file attributes, including dates and times are stored with the inode, not the filename. (Extra) hardlinks are useful when you want different names to point to the same data, read or write. They save space and overhead. However, they clobber programs which assume different names point to different data. e.g, if you replace references to duplicate files by hardlinks to a single file, then you have removed any backup you have! The windows OS is one program which assumes different names point to different sets of bits. Hardlinks have to be on the same physical and logical volume. They are useful for: reducing path lengths since Windows just supports 256 characters or so. reducing storage space of duplicate data files - eg, you could have multiple backups of a partition with multiple complete directory trees, but with hardlinks for files which have not changed since the previous backup. Junction points are messier and use Reparse Points (which I do not understand). They can point to different physical or logical volumes but they have to be on the same computer. They apparently can be used like hardlinks for directories, allowing a second name for the same destination, but limited to a single computer, rather than just a single volume. Useful for reducing path lengths, or simplifying working with several programs with hardcoded directory names. Same caveats, too! Many programs assume different names = different files. And then there are symbolic links (which can go across networks), shortcuts and PIFs and .....
Vilx- at Super User Visit the source
Other answers
Hard link is just another name for a file. If you have file named A.txt and you have link L.txt, once you delete A.txt, you will still have access to it's data through L.txt. Only when both are deleted file is gone. On other hand, you have a so called soft-link (junction if it is folder or symbolic link if it is file). In that case, when you delete A.txt, file is really gone. Deleting L.txt has no effect on file what-so-ever. Hard links can only be used on same partition as originating file and soft-links can be used across partitions. P.S. File and folder are mostly interchangeable as far as NTFS goes.
Josip Medved
Related Q & A:
- What Is The Difference Between Magicjack And Magicjack Plus?Best solution by Yahoo! Answers
- What is the difference between Soft Bouncing and Hard Bouncing?Best solution by Yahoo! Answers
- What's the difference between Current (I) and Potential Difference (V?Best solution by diffen.com
- What does it mean to be unresponsive? What's the difference between unresponsive and unconscious?Best solution by answers.yahoo.com
- What kind of bug bite is hard and swollen?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.