I have to copy directory structure from one local NTFS disk to another (Windows 7+) and preserve hard links that exist within this directory structure.
An acceptable solution would be to replace hard links with (relative) symbolic links before copy, but I'm not sure if it is practicable either.
What are the options here?
Answer
Tool To Copy Hard Links Across Separate Disk Partitions
LN - Command Line Hardlinks
Command: ln --copy x:\dir\dir2 y:\dir\newdir
In the above example the directories and files below x:\dir\dir2 are copied to y:\dir\newdir, and all hardlinks/junctions/symbolic links within x:\dir\dir2 are copied/tied to their new locations under y:\dir\newdir.
Resource: http://schinagl.priv.at/nt/ln/ln.html
Download: http://schinagl.priv.at/nt/ln/ln.html#contact
Note: It appears you just download this software for your CPU architecture from the ZIP file, as well as the vcredist (Visual C++ Redistributable) and install it. Then just extract the files and folders from the ZIP file to a new folder somewhere (.e.g C:\Temp
). In command line, just go to that [directory] folder and then run the needed commands for your drive locations as the above example shows. Running ln --help
shows help detail but the above command example is supposed to copy the hard links
per the documentation.
Link Shell Extension
Resource: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html
Download: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html#contact
Sections or Functions of Interest with this Software
Smart Mirror
Clone
Smart Copy
ln - Command Line Hardlinks - Download Screen Shot
Link Shell Extension - Download Screen Shot
INTERESTING NOTES
It appears hard links
are locked to the same disk partition for their file pointers, etc. and cannot be used across multiple partitions. Also, hard links
on NTFS partitions are part of the Master File Table
records (or attributes for the counts at least) so copying these to an existing disk that has it's own MFT
would seem like a problem if you don't clone byte-for-byte at the partition level at least.
Comments
Post a Comment