Friday, October 16, 2009

NTFS junction point

An NTFS junction point is a feature of the NTFS file system that provide the ability to create a link to a directory that is, for most intents and purposes, the same as the directory itself. This has many benefits over a Windows shell shortcut (.lnk) file, such as allowing access to files within the directory via Windows Explorer, the Command Prompt, etc. Junction points can only link to directories on a local volume; junction points to remote shares are unsupported.

Junctions points are a type of NTFS reparse point; they were introduced with NTFS 3.0, the default file system for Windows 2000 (Windows NT 5.0). The Windows 2000 and Windows XP Resource Kits include a program called linkd to create junction points; Mark Russinovich of Winternals released a tool called junction which provided more complete functionality. Windows NT 6.0 and later operating systems include an mklink command-line utility for creating junction points.By setting a junction point that points to a directory containing a particular version of a piece of software, it may be possible to add another version of the software and redirect the junction point to point to the version desired.

An obscure, not very well known OS feature since Win 2000, the NTFS Junction is basically like a virtual or mapped folder so that you can have one folder in multiple locations at the same time, but in reality are just one folder, with one file collection. This is done at the kernel level, so it's invisible to all applications, including IIS, and Visual studio.

An NTFS reparse point is a type of NTFS file system object. It is available with the NTFS v3.0 found in Windows 2000 or later versions. Reparse points provide a way to extend the NTFS filesystem by adding extra information to the directory entry, so a file system filter can interpret how the operating system will treat the data. This allows the creation of junction points and NTFS symbolic links and is a key feature to Windows 2000's Hierarchical Storage System. They also can act as hard links, but aren't limited to point to files on the same volume: they can point to directories on any local volume.

Since the contents of a junction do not take up any space (they simply point to the original files in the original directory) if you need to have multiple points of entry to a large directory, junction points will serve that purpose well. Do not confuse junction points with a copy of something as it simply points to the original. If directories need to be modified separately a junction cannot be used as it does not provide a distinct copy of the directory or files within.

Windows Vista supports a new symbolic link capability that replaces junction points in Windows 2000 and Windows XP. They are designed to aid in migration and application compatibility with UNIX operating systems. Unlike a junction point, a symbolic link can also point to a file or remote SMB network path. Additionally, the NTFS symbolic link implementation provides full support for cross-filesystem links. However, the functionality enabling cross-host symbolic links requires that the remote system also support them, which effectively limits their support to Windows Vista and later Windows operating systems.

NTFS junction point

No comments:

Post a Comment