How to move your Windows 7's User directory to your data drive

Use this at your own risk. If you try this and you break your system, I am not responsible. :-)

I recently built a new computer and opted for an 120GB SSD for Windows 7 Pro and programs with a separate 1TB HDD for data.

After installing the OS, all my programs, and setting up my machine to my liking, I realized that a huge chunk of data wasn't on my "data" drive. We all should know that SSD's do not have a great reputation when it comes to reliability. So, my C:/Users folder had to be moved.

I Googled a bit, found a couple articles on doing just that, followed the directions perfectly, then spent the next 3 hours trying to boot back into Windows. Fun.

I managed to get System Restore to work (it wasn't as easy as it should have been) and I was now back where I started (~3 hours later), but still not ready to give up. I decided to give it one more try and this is what worked:

READ THIS ALL THE WAY THROUGH BEFORE DOING ANYTHING!!!

  1. Create a System Restore point (don't skip this step):
    1. Click the Start button, right click on Computer, click Properties.
    2. Select the System Protection tab, click Create.
    3. Type a description and click Create.
  2. Name your drives something obvious:
    1. Click the Start button, right click on Computer, click Manage.
    2. In the left panel, expand Storage, select Disk Management.
    3. (optional) If you want to rename the drive for your optical drive (CD, DVD, BD) you'll want to do that now:
      1. Place a disk in the drive now.
      2. Right click its entry in the right-side pane.
      3. Select Change Drive Letter and Paths.
      4. Click Change and select the new drive letter (I chose "O", for "Optical").
      5. Click Yes In the "Some programs that rely on drive letters might not run correctly" dialog.
    4. Right click on your SSD (probably C:), click Properties, and type in a description, e.g., "OS and Programs" and click OK.
    5. Right click on your HDD, click Properties, and type in a description, e.g., "Data", and click OK. If you want to change the drive letter do so now (I chose "D", for "Data").
  3. Boot into Windows 7's System Recovery Command Prompt:
    1. Insert your Windows 7 installation disk into your optical drive and restart your computer.
    2. When/if prompted press a key to boot from the disk (you may need a PS/2 keyboard for this).
    3. At the "Install Now" screen choose "Repair your computer". You might be asked if you want to "Repair and Restart", select No.
    4. Make sure Windows 7 is listed as the installed OS and that it is selected then select Next.
    5. In the list of recovery tools choose "Command Prompt".
  4. You should now be located at the virtual Windows drive (probably X:) in the command prompt.
    • NOTE: My actual Windows drives are: C = SSD (OS and Programs) and D = HDD (Data)
    • NOTE: My virtual drives in System Restore are: X = Virtual Windows, D = SSD, and E = HDD
  5. Your drive letters may differ from mine, adjust these instructions accordingly. To check what's what:
    1. type:  wmic logicaldisk get name press Enter
    2. for each letter do the following:
    3. type:   D: press Enter (D is any one of the drive letters from this section's first step.)
    4. type:   vol press Enter
    5. The first line will tell you what the drive is, e.g., "Volume in drive D is OS and Programs"
    6. Repeat steps 3-5 for each letter and take note of what drive is what
  6. Backup and copy your Window's C:\Users directory to your D:\ HDD:
    1. type: robocopy /copyall /mir /xj D:\Users E:\Users (D is my virtual SSD and E is my virtual HDD), press Enter
    2. Make sure no files failed to copy (FAILED and SKIPPED columns should = 0). If you have any failed or skipped files you should probably stop now. :-/
    3. type: D: press Enter (D is my virtual SSD)
    4. type: cd / press Enter
    5. type: rename Users UsersOld press Enter
  7. Create a "Super Shortcut" (aka Junction/symlink) for your actual C:/Users to point to D:/Users
    1. The is the confusing part. We'll be creating a link on our virtual SSD to point to our actual HDD. Because my actual HDD's drive letter is the same as my virtual SSD's drive letter the following command looks wrong, but it's not.
    2. type: mklink /J D:\Users D:\Users
      • IMPORTANT!!! 
      • The first D:\Users is referring to my virtual SSD's drive letter.
      • IMPORTANT!!! The second D:\Users is referring to my actual HDD's drive letter.
    3. Press Enter
    4. Verify the shortcut was created by typing: dir C:. You should find Users [D:\Users] in the list.
    1. type: exit press Enter
  8. Restart (you'll probably want to remove the Windows 7 installation DVD during POST)
  9. Keep the C:/UsersOld directory around for a while just in case. :-)

 

This is what worked for me and so far I haven't seen any issues. Let me know if you have any trouble.

The above is a culmination of the following similar articles (and their comments), all of which were flawed on their own:

 

If the above does break your system you may not be able to use System Restore directly. The following steps from this article may help you recover:

  1. DON'T use system restore yet, it doesn't know what you've done with your user profiles and therefore can't repair the permissions on them.
  2. Isolate the copy of your user profiles from the NTFS junction: move D:\Users D:\Users2
  3. Delete the NTFS junction: rmdir D:\Users
  4. Copy your user profiles back over to your boot drive: robocopy /mir /xj D:\Users2 E:\Users
  5. Now use system restore [via Install DVD or Safe Mode], either to the point you created in the instructions or an earlier point. This will repair the permissions on your user profiles.
  6. Reboot and you should be able to login…

Comments for this blog entry