Hard Link Migration using USMT October 12, 2010Posted by Dave Field in USMT.
Okay, so you’ve probably heard about how USMT can now migrate files without actually removing them from your computer…
You hadn’t? Well, let me be the first to tell you, and show you a short test you can do to prove this capability to yourself.
The NTFS file system supports a method of linking files that will be familiar to those with backgrounds in UNIX or Linux. These file system structures are called links. Essentially, they are aliases that point at a physical file stored somewhere else on a storage volume. The file can be accessed from either location, just as if it was stored there. The exact mechanism by which this is accomplished is different in NTFS, but the feature looks and acts the same.
How USMT uses Hard Links
When the User State Migration Tool (USMT) uses hard links, it creates a folder on the file system and writes links in it to files that are to be migrated to the new operating system. When the new operating system is installed, scripts can delete the original folders, clearing space on the disk for the new OS. As long as the folder created by USMT is not deleted, either directly or by formatting the volume, the files are preserved by the hard links. When the OS installation is completed, USMT runs again, restoring the original file links and removing the hard link folder.
Does this really work?
Try this short test. On a command prompt, issue the commands below and observe the output:
Create two folders for the test:
Now, write a file into the first folder:
C:\>Echo “Hello world!” > .\test1\test1.txt
Verify the file is readable:
Now make a hard link to a filename in the second folder:
C:\>mklink /H c:\test2\test2.txt c:\test1\test1.txt
Hardlink created for c:\test2\test2.txt <<===>> c:\test1\test1.txt
Verify that you can read the second “file”.
You are reading the original through a hard link!
Now delete the first file:
Is the file gone? Let’s check:
The system cannot find the file specified.
Looks gone to me…let’s check the second file:
More in using USMT to migrate users
Well, that’s about it. USMT preserves your data right on the disk even as the new operating system is installed. You’ve seen it with your own two eyes, so you know it works. Now take USMT for a spin. You can find out more about USMT in Tim Mintner’s post: Understanding USMT with MDT 2010