From: Kan Yabumoto tech@xxcopy.com
To: XXCOPY user
Subject: Reparse Points and Hard Links
Date: 2009-12-30
===============================================================================
Introduction:
A "Reparse Point" is a type of NTFS file system object (implemented in
Windows 2000 and later versions) that provides extended functionality
to an NTFS volume. The most notable examples of reparse points include
junction point, volume mount point and symbolic link (plus other exotic
features like remote storage service (RSS) and single instance store
(SIS) that are not within the scope of this discussion).
Junction point (also called directory junction) and volume mount point
were introduced in Windows 2000. More recently, the symbolic links
(for directory and for file) were introduced in Windows Vista.
The common characteristic of these reparse points is that they store
a reference path (called target) and behave as if they were the
target object when accessed by most application programs.
---------------------------------------------------------------------
In Vista and Windows 7, your old friend, "C:\Documents and Settings"
is not a regular directory. Rather, it exists as a junction point
whose target is C:\Users. Similarly, the "All Users" directory
inside "\Documents and Settings" is replaced by a directory-type
Symbolic Link, "C:\ProgramData\" whose file attributes are usually
marked with the hidden and system bits. These reparse points are
presumably provided for the backward compatibility's sake.
---------------------------------------------------------------------
Microsoft's document states "Symbolic links are designed to aid in
migration and application compatibility with Unix operating system."
---------------------------------------------------------------------
You should not be confused with reparse points and the Shortcut
files (with the .LNK extension) which was introduced by Windows 95.
A shortcut is an ordinary file which is accessed like any other
file by most application programs except by Windows Explorer that
treats a shortcut as an alias of the real file.
---------------------------------------------------------------------
Aside from reparse points, hard links are officially debuted in Vista
(even though the NTFS volume had provision to support hard links from
earlier days). In the case of regular files, the file data is stored
under a unique pathname. On the other hand, using hard links, one
set of file data is stored under two or more pathnames. From the hard
link viewpoint, if the file data is associated by only one path (link),
the file is called a regular file (non-hard link). Hard links refer
to a case where the file data is accessed via multiple pathnames.
When a file with two hard links is deleted using one pathname, then,
it will become a regular file with only one pathname representing the
file data.
Behavior of Reparse points:
Unlike shortcuts (special .LNK files under Windows Explorer's control),
reparse points behaves almost like the object they represent. For
example, when an application accesses "C:\Documents and Settings",
the underlying file system automatically delivers the "C:\Users"
directory instead. While this behavior is exactly what the reparse
point mechanism is designed for for most purposes, it poses a problem
for a backup occasion.
Typically, when a source volume or directory is to be backed up, the
destination should ideally contain the same structure that was found
in the source. A reparse point in the source should be reproduced
as such in the destination. Prior to v.3.00, XXCOPY was not capable
of preserving reparse points. Rather, a reparse point in the source
would become a subdirectory in the destination. This behavior was
not only space-consuming in the destination, it is simply wrong in
the truest sense. Many traditional file copy utilities had the same
problem. That's because reparse points call for a special treatment
to be duplicated in another location.
At present, a relatively small number of programs are available to
copy and create reparse points. One such tool is MKLINK.EXE.
XXCOPY is another one.
Classifications:
For the lack of better name, we refer to the various reparse points
and hard link as J-thingies (for junction points, et al with many
command switches that start with letter J) in XXCOPY's documentation.
At present, reparse points includes only four types;
1) Symbolic Link Directory
2) Symbolic Link File
3) Junction Point that is not volume mount point
4) Volume Mount Point (a special case of junction point)
XXCOPY recognizes the following types of reparse points, hard link,
and regular file and regular directory
Type Abbr. Description
------------------------------------------------------------------
F [FIL] Regular File (not symbolic link nor hard link)
S [SYM] Symbolic Link File (a reparse point)
H [HLK] Hard Link (file data shared with another hard link)
D <DIR> Regular Directory (not a reparse point)
L <LNK> Symbolic Link Directory (a reparse point)
P <JCT> Junction Point (a reparse point)
M <MNT> Volume Mount Point (a reparse point)
J Represents all J-thingies (S)(H)(L)(P)(M)
R Represents all Reparse Points (S)(L)(P)(M)
------------------------------------------------------------------
The "Type" letters shown above will be used as the parameters
for many command switches that are relevant to J-thingies.
XXCOPY Command Switches for J-thingies:
XXCOPY v.3.00.0 introduces many new functions that deal with the
J-thingies (many of which are assigned to switches that starts with
letter J. Many of these switches takes a parameter with the
In the Windows system, reparse points behave very much like a real
directory (or a file) when they are accessed by common application
programs, including previous versions of XXCOPY. On the other hand,
in many occasions, we want such objects to be duplicated exactly as
they are.
The new XXCOPY allows you to choose either way to copy reparse points
and hard links alike. By default, the new XXCOPY (ver 3.00 or newer)
treats all J-thingies (reparse points and hard link) as such.
/JL Treats directory symbolic links as symbolic links (default).
/JP Treats junction (non-mount) points as junction pts (default).
/JM Treats volume mount points as volume mount points(default).
/JS Treats file symbolic links as symbolic links (default).
/JH Treats file hard links as hard links (default).
/JJ Treats all J-thingies as such (shortcut for /JL/JP/JM/JS/JH)
/JR Treats reparse points as such (shortcut for /JL/JP/JM/JS)
Or, you may let XXCOPY treat them as if they are a regular directory
or file by the following switches.
/JL0 Treats directory symbolic links as a regular directory.
/JP0 Treats junction (non-mount) points as a regular directory.
/JM0 Treats volume mount points as a regular directory.
/JS0 Treats file symbolic links as a regular file.
/JH0 Treats file hard links as a regular file.
/JJ0 Treats all J-thingies as a regular directory or file.
/JR0 Treats reparse points as a regular directory or file.
####### CAUTION to old XXCOPY users ###############################
The default treatments of J-thingies by XXCOPY Ver 3.00 are now
exact opposite to what they were with older XXCOPY versions.
If you want XXCOPY to behave like the old versions with respect
to the J-thingies, you need to add /JJ0 in the command line.
###################################################################
You may use the object type for file/directory selection by
the new exclusion function.
/JX<mask> Excludes one or more types of J-Thingies as well as
regular files and directories (F,D,S,H,L,P,M,J,R).
/JI<mask> Includes only the J-thingies specified.
This function is implemented as a shortcut of the
inverse function of /JX<mask>.
When XXCOPY displays a reparse point on the screen, the path of the
referenced object will be shown.
/oR Shows the reference path of a reparse point (default)
/oR0 Disables the display of the reparse point reference path
When an existing object in the destination is to be overwritten
by a different J-thingy type, the user will be prompted.
/PJ Prompts on overwrite by a different J-thingy type
/PJ0 Suppresses prompt on overwrite by different J-thingy type.
When a file whose path contains a reparse point is to be deleted,
the user will be prompted.
/PR Prompts when a file with a reparse point path is to be deleted
/PR0 Suppresses prompt on overwrite by different reparse point type.
When an elements in the full path of the source or the destination
specifiers contain a reparse point, XXCOPY will issue a warning prompt.
/WR Warns when src/dst path contains a reparse point
/WR0 Suppresses the warning for a reparse point in src/dst path
Since a reparse point directory can be created to form a cyclic
reference, it could cause a recursive meltdown (for example,
"C:\ProgramData\Application Data\" points to "C:\ProgramData\"
that forms a infinite loop of reference). XXCOPY detects such
cyclic reparse points and prevents the recursive meltdown.
XXCOPY has a command to show all occurrences of cyclic references.
/JCYCLIC Scans the source directory and lists all cyclic links
/oC Displays a cyclic link that is being skipped (default)
/oC0 Suppresses the display of cyclic links that are skipped
XXCOPY provides a bulk hardlink creation:
/MLH Makes a hard link file in dst for each file in src
/ULH Unlinks (convert hard links into regular files)
[ Table of Contents ]
[ << ]
[ Show as Detached ]
[ >> ]
|