1 Understanding NTFS Hard Links, Junctions and Symbolic Links Author: Conrad Chung, 2BrightSparks Introduction Microsoft ha tool s in its NTFS operating file systems since Windows NT 4.0 and s implemented linking ese links provide a convenient method for users to a ccess their data. Over the years . Th Windows 2000 continued to improve Microsoft tool s which can now be used to link files and/or directories these together he latest form of file link was introduced in Windows Vista and continues to form part of . T their latest operating system . In this article we will look at what these file links are and how they differ from one another. What are NTFS Hard Links, Junction s and Symbolic Links? Ha rd links, junction points and symbolic links are linking processes used by Windows to associate other files, directories or volumes. One of the methods to create file links is to use the command line program : mklink : mklink /H linkNam e target To create a hard link : mklink /J linkName target To create a junction To create a symbolic link : mklink /D linkName target The following sections describes each type of file link in detail. Hard Links A hard link is a file represents another file on the same volume without actually duplicating th e data that of tha t file. More than one hard link can be created to point at the same file. Hard links cannot link to a file that is on a different partition , volume or drive . Hard links on directo ries are not supported as it would lead to inconsistenc ies in parent directory entries . Although a hard link is essentially a mirrored copy of the target file that it is pointing to, no additional hard drive space is required to store the hard link file. If a 1GB file is mirrored by 3 hard links, the total space used on the partition will only be 1GB instead of 4GB.
2 In addition, if any of the hard links or the original file (s) is/are deleted, the data will not be deleted and still be able to access it. Changes made to the data contents via any of the the rest of the other links will hard links or the original will be propagated to the rest of the other items automatically. ns Microsoft Windows operating systems that support NTFS partitio (Windows Hard links only work on NT 4.0 or later) while FAT and ReFS file systems do not work with hard links . An example of using hard links is when a user needs to have a file stored in two different folders. He could copy the file to the other folder and have two copies of the same file. However, twice the amount of storage space would be used. Also, if file contents of one file is changed, the other file will be outdated unless the newer file is copied over to replace it. Both issues could be solved with the use of hard lin ks. Junctions t directory, unlike a Sometimes referred to as soft links, the function of a junction is to reference a targe which points to a file. Junction partitions hard link s can be created to link directories located on different or volume, but only locally on the same computer. It does this through the implementation of the NTFS Redirected targets in junctions are defined by an absolute path . An feature called reparse points. absolute path refers to a path which will contain the root element and the complete directory list that is required to locate the target. For example, \ Main\ Folder \report is an absolute path. All of the information required to locate the target is contained in the path string. Like hard links, directory junct ion s do not take up additional space even though they are stored on the drive partition; their function is to point to the original files in the original directory. Thus, it should be noted that if the target is deleted or renamed, all junctions whi ch point to the target will break , moved -existing directory. Content changes from any of the junction links or the and continue to point to a non target will automatically propagate to the rest. in which junctions are often Junctions are only compatible with Windows 2000 or later. An example , where the name “C: used is on Windows Vista \Documents and Settings” is a junction that points to C: \Users. Thus, older programs that reference hard -coded legacy file paths can continue to work in Vista. Symbolic Links Symboli c links were recently introduced in Windows Vista/Windows Server 2008 or later. A n NTFS symbolic link is a file system object that points to another file system object. In simpler terms, it is a ny file or folder either on the local more advanced type of shortcut. Symbolic links can point to a computer or using a SMB path to point at targets over a network (the target machine on the remote end needs to run Windows Vista or later) . They do not use any disk space . A symbolic link could use either a relative path or an absolute path to point to its target . A relative path has to be combined with another path in order to p roperly access the target file. For a detailed explanation between the difference of absolute and relative paths, please refer to this link: http://msdn.microsoft.com/en -us/library/aa363878(v=vs.85).aspx
3 Symbolic links are transparent to users – they appear as normal files or directories. All applications will will be able to recognize both the link and the target. Like junctions, symbolic links become a stale link if es not check to see if the target exists. . The operating system do the target is moved, renamed or deleted Comparison table of hard link, junction and symbolic link Junction Symbolic Link Hard Link Windows 2000 & Windows NT4 or later Supported OS Windows Vista or later or later Windows XP local or – Any path the Storage requirement Files Directories (paths) must must be on remote, relative or on local computer for target same volume be absolute SMB file or path The original file and Windows Vista or later: When a hard other hard links target is unchanged. link/junction/symbolic it remains. pointing to Target is unchanged & , XP Windows 2000 link is deleted using If all associated links 2003: target & sub - Windows Explorer ... are removed, the are deleted folders data is deleted The target is moved... Hard link stays valid Junction turns invalid Symbolic link turns invalid Not allowed; path Relative path allowed? Not applicable becomes absolute Allowed when saved Works on files? Yes No Windows Vista or later Works on folders? No Yes Windows Vista or later
4 Example s of a hard link and junction
5 Configuration Settings in Sync Back file links SE & SyncBackPro that use the backup and synchronization programs , users are provided with some In – SyncBackPro/SE/Free settings to choose how they want the program to handle these links if encountered during a profile run. Copy/Delete > Folders > Ignore NTFS junction points (reparse points) – Configurable in all 3 Expert > models of SyncBack, this setting is recommended and turned on by default. Junctions and symbolic links are ignored during profile runs with it Thi s setting supports both enabled, but hard links are not ignored. NTFS and ReFS file systems. could It should be noted that if this setting is disabled, SyncBackPro/SE/Free copy the files stored within the two different paths (the original path and the link path) twice and create two real folders of those names on the Destination. Expert > Copy/Delete > Advanced > Copy symbolic links as -is instead of copying the file the link points to – When this setting is enabled, the program will copy only the symbolic link and not the file that the s to. This means the link on the destination will be pointing to the same file the source link is link point pointing to. Thus users who enable this setting need to ensure the symbolic links are using relative paths -requisites to instead of absolute paths. This setting is only available in SyncBackSE and SyncBackPro. Pre use this setting are: This option is only available on Windows Vista and newer, when the Standard Windows File Copy method is being used, and is only used when copying between NTFS or ReFS file system s. Please also note that this setting will not work (and is disabled) over FTP, Cloud, To Email, etc . and the profile cannot have compression enabled as symbolic links must be stored ‘natively’ on the drive. Summary Now you have the basic knowledge on how hard links, junctions and symbolic links work in a NTFS Windows operating system , you are hopefully in a better position to recognize issues relating to them .
United States Department of The Fire and Fuels Extension Agriculture to the Forest Vegetation Forest Service Forest Management : Updated Model Simulator Service Center Fort Collins, CO Documentation 2...More info »