jump to navigation

Hard Link Migration using USMT October 12, 2010

Posted 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.

Hard Links

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:

C:\>mkdir test1

C:\>mkdir test2

Now, write a file into the first folder:

C:\>Echo “Hello world!” > .\test1\test1.txt

Verify the file is readable:

C:\>type .\test1\test1.txt

“Hello world!”

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”.

C:\>type test2\test2.txt

“Hello world!”

You are reading the original through a hard link!

Now delete the first file:

C:\>del test1\test1.txt

Is the file gone? Let’s check:

C:\>type .\test1\test1.txt

The system cannot find the file specified.

Looks gone to me…let’s check the second file:

C:\>type test2\test2.txt

“Hello world!”

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



1. marc - March 15, 2012

thanks, great explication.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: