Vista upgrades NTFS to include some shiny new features, one is Transactional NTFS or "TxF". That means there's a Resource Manager for NTFS so you can batch up a whole transaction worth of file writes and if any of them go wrong - rollback. I'm having a little trouble with Transactional NTFS right now because the resource manager is shutting down because I need to run chkdsk /f on my drive and I can't, but that's a story for another day.
Philip left a comment in my recent post on improvements in junctions/reparse points/symbolic links in Vista. He said "Have you tried using the new Vista symbolic directory link support available in the command line program "mklink /d". I have successfully used it cross-drive for other directories,though I haven't tested it in your scenario."
Soinks! That's what I get for not keeping up with Junfeng Zhang's excellent blog.
Postulate: Symlink is to Junction in Windows as Symlink is to Hardlink in Unix.
Symlinks can span volumes (wicked useful) and you can also Symlink to UNC paths. Woof. Notice the Command Prompt Screenshot at Right. In this example "My Documents" is a Symlink to another drive, while Junction points locally.
I am still a little unclear about the difference. As I understand it, junctions are "reparse points" and support links to local files and directories while symlinks are built into the NTFS file system at the Kernel level and support spanning drives. Perhaps Mark Russinovich will jump in here and explain.
Here's my DOS prompt removing my non-working junction and using the new MKLINK to get My Documents onto another drive.
C:\Users\Scott>mklink
Creates a symbolic link.
MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new link
refers to.
C:\Users\Scott>junction "My Documents"
Junction v1.04 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2005 Mark Russinovich
Systems Internals - http://www.sysinternals.com
C:\Users\Scott\My Documents: JUNCTION
Substitute Name: D:\Scott\My Documents
C:\Users\Scott>mklink /d "My Documents" "d:\Scott\My Documents"
Cannot create a file when that file already exists.
C:\Users\Scott
>junction /d "My Documents"
Junction v1.04 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2005 Mark Russinovich
Systems Internals - http://www.sysinternals.com
Deleted My Documents.
C:\Users\Scott>mklink /d "My Documents" "d:\Scott\My Documents"
symbolic link created for My Documents <<===>> d:\Scott\My Documents
C:\Users\Scott>junction "My Documents"
Junction v1.04 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2005 Mark Russinovich
Systems Internals - http://www.sysinternals.com
C:\Users\Scott\My Documents: UNKNOWN MICROSOFT REPARSE POINT
C:\Users\Scott>dir "My Documents"
Volume in drive C is 70 GIGS - SYSTEM
Volume Serial Number is 88F3-D225
Directory of C:\Users\Scott\My Documents
10/02/2006 09:42 PM <DIR> .
10/02/2006 09:42 PM <DIR> ..
04/23/2005 07:02 PM 37,758 0764576100.01._SCLZZZZZZZ_.jpg
...lots of files here...
...snip...I was able to CD over to another drive transparently...
Turns out I was (half) wrong when I said that Explorer doesn't know about Junctions. It knows enough about Junctions to show the shortcut icon, but that's about it. However, Explorer DOES know enough about Symlinks to show the Target (pointed to) directory in the Properties dialog. Nice.
In Vista, all kinds of things have been moved, and are now using Junctions to point to the new locations:
Was |
Now |
Application Data |
AppData\Roaming |
Cookies |
\AppData\Roaming\Microsoft\Windows\Cookies |
Local Settings |
\AppData\Local |
My Documents |
\Documents |
NetHood |
\AppData\Roaming\Microsoft\Windows\Network Shortcuts |
PrintHood |
\AppData\Roaming\Microsoft\Windows\Printer Shortcuts |
Recent |
\AppData\Roaming\Microsoft\Windows\Recent |
SendTo |
\AppData\Roaming\Microsoft\Windows\SendTo |
Start Menu |
\AppData\Roaming\Microsoft\Windows\Start Menu |
Templates |
\AppData\Roaming\Microsoft\Windows\Templates |
Interesting stuff, I say.
Hosting By