Mount second drive as c:/Users in Windows 7

Solution 1:

It looks like Jimmie R. Houts over at serverfault has the answer I am looking for. He referenced this article with more information.

To expand on his answer, after installing Windows 7:

  1. You boot with the install media.
  2. At the screen with the "Install Now" choose "Repair your computer"
  3. You will be asked if you want to "Repair and Restart" by the System Recovery options, choose "No".
  4. Then make sure that Windows 7 is listed as one of the installed OSs available for recovery and it's selected; then press "Next".
  5. You will be given a list of recovery tools; chose "Command Prompt".
  6. In the command prompt you will be using Robocopy to copy C:\Users to D:\Users.
  7. Type robocopy c:\Users d:\Users /mir /xj
    • /mir tells robocopy to mirror the directories; this will copy all files and permissions and will delete any other files in the target directory (reference). If you already have user profiles in D:\Users and want to keep them, try /e /copyall instead; this copies everything recursively (/e), all file attributes included (/copyall), though for some reason you might have to adjust ownership permissions later anyway.
    • /xj is very important, this tells robocopy not to follow junction points. If you forget this, you will have a lot of trouble.
  8. Make sure no files failed to copy (FAILED column = 0).
  9. Remove the old Users Folder from the C: drive: rmdir /S /Q C:\Users
  10. Create an NTFS Junction that points to the new Users folder: mklink /J C:\Users D:\Users. Make sure the target, D:\Users, uses the drive letter which will be used after restarting, not as it is during the recovery command prompt session (Thanks mindless.panda, and matt wilkie).

Now restart and there you go. No further configuration or fiddling required. New user profiles will all be stored on the D: drive, as will any user-specific data. And it is achievable without any messing about in the registry, searching and replacing values, or having to mess with new profiles in any way. Totally fire and forget.

Solution 2:

Create a NTFS Junction that points to the new Users folder: mklink /J C:\Users D:\Users

For this step, make sure the target, D:\Users, uses the drive letter which will be used after restarting, not as it is during the recovery command prompt session, or you will be greeted with the error "The user profile service service failed the login. User profile cannot be loaded." on restart.

The fix for this error is to logon with another profile on the system with admin priviliges and:

  1. Open command prompt as administrator
  2. Type Regedit
  3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  4. There is 1 key for each profile. When a profile is bad there are 3 things worth checking:
    • Ensure the key name doesn't end in ".bad" or ".bak", should look similar to S-1-5-21-1234-1234-1234-1234
    • Ensure the RefCount value is 0
    • Ensure the State value is 0
  5. Logoff or switch users, and you should be able to logon just fine. A reboot may be necessary.

Additional reference used here.

This answer should be combined with tvanover's answer of Oct 9 at 20:01 and draws on Gonzalo's answer of Nov 8 at 17:03. I lack the reputation to edit in place, or even comment, so someone else with those privs please combine (and then we can delete this answer).

Solution 3:

I just tested tvanover's answer in a virtual machine. However, I did a few things differently.

  1. I did this with a fresh installation in Audit mode (Ctrl+Shift+F3 on first boot). I let it boot once into audit mode before proceeding.
  2. I copied the files to the root of the second drive.
  3. Instead of making a link, I set a mountpoint.

Here's how I made the mountpoint:

  1. After deleting the C:\Users directory, recreate it

    mkdir C:\Users

  2. Run the DISKPART command, and select the second disk (substitute * for correct disk number listed after the LIST DISK command)

    DISKPART

    LIST DISK

    SELECT DISK *

    SELECT PARTITION 1

  3. Set the mountpoint. If it fails, go back and make sure the C:\Users directory exists and is empty.

    ASSIGN MOUNT=C:\Users

    EXIT

  4. Reboot. Once it's done rebooting, you can use Start->diskmgmt.msc to remove the drive letter from the second drive if you want.

  5. If you're in Audit mode, go back to the System Preparation Tool window, make sure "Enter System Out-of-Box Experience (OOBE)" is selected as the System Cleanup Action, "Generalize" should be unchecked, and the Shutdown Options should be set to either Reboot or Shut Down. Click OK, and the system will cleanup and reboot back to the first-boot setup.