Request for Junctions be treated consistently

Linda Walsh cygwin@tlinx.org
Wed Apr 9 05:41:00 GMT 2014


Corinna Vinschen wrote:
.
> 
> No, it's not.  There's a major difference between mount points and
> symlinks, which is, mount points are handled inside the kernel, while
> symlinks are filesystem objects.  Reparse points are very certainly
> filesystem objects.  And bind mounts in Cygwin are handled in the
> "kernel" as well.  We can't add reparse points to the mount table
> on the fly.
---
Windows Internals V5, p965

A reparse point is a block of up to 16kb of application defined reparse data
and a 32-bit repase tag that are stored in the $REPARSE_POINT attribute
of a file or directory.  Whenever an application creates or deletes a reparse
point, NTFS updates the \$Extend\$Reparse metadata file, in which NTFS stores\
entries that identify the file record numbers of files and directories that
contain reparse points.  Storing the records in a central location enables NTFS
to provide interfaces for applications to enumerate all a volumes reparse
points, **such** as **mount* *points**.  The $Extend$Reparse file uses the
general indexing facility of NTFS by collating the file's entries (in an
index named $R) by reparse point tags.
-----
On p669, mounts are covered -- the bottom paragraph says mount points are reparse
points that store a volume name as the reparse data.

Theoretically, there should be a cental resource that would enable you to know
all the reparse points that are associated with mountpoints that wouldn't have
to be added "on the fly", but could be added to /etc/fstab on cygwin-initialization.

To further the case for linkd being a type of mount:

I created 2 links to C:\Users -- one with linkd, the other with mklink /d:
C:\tmp\test>dir
  Volume in drive C is System Disk
  Volume Serial Number is E889-68E4

  Directory of C:\tmp\test

04/08/2014  10:35 PM    <DIR>          .
04/08/2014  10:35 PM    <DIR>          ..
04/08/2014  10:35 PM    <SYMLINKD>     foo [C:\Users]
04/08/2014  10:33 PM    <JUNCTION>     Users [C:\Users]
----------
Using the fsutil reparsepoint query we can look at the two objects:
>fsutil reparsepoint query foo
Reparse Tag Value : 0xa000000c
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Symbolic Link

Reparse Data Length: 0x00000034
Reparse Data:
0000:  10 00 18 00 00 00 10 00  00 00 00 00 43 00 3a 00  ............C.:.
0010:  5c 00 55 00 73 00 65 00  72 00 73 00 5c 00 3f 00  \.U.s.e.r.s.\.?.
0020:  3f 00 5c 00 43 00 3a 00  5c 00 55 00 73 00 65 00  ?.\.C.:.\.U.s.e.
0030:  72 00 73 00                                       r.s.
----
Foo is a Symbolic Link.
---

>fsutil reparsepoint query Users
Reparse Tag Value : 0xa0000003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 24
Print Name offset:     26
Print Name Length:     16
Substitute Name:       \??\C:\Users
Print Name:            C:\Users

Reparse Data Length: 0x00000034
Reparse Data:
0000:  00 00 18 00 1a 00 10 00  5c 00 3f 00 3f 00 5c 00  ........\.?.?.\.
0010:  43 00 3a 00 5c 00 55 00  73 00 65 00 72 00 73 00  C.:.\.U.s.e.r.s.
0020:  00 00 43 00 3a 00 5c 00  55 00 73 00 65 00 72 00  ..C.:.\.U.s.e.r.
0030:  73 00 00 00                                       s...
----
But the one created with 'linkd' is called a Mount Point.

Does that help clarify the differences between linkd and mountvol vs.
reparse points created by 'mklink'?









--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list