Problem after moving users folder on Windows 7

7

4

I've just tried to move my users folder to another drive on 64-Bit Windows 7 Ultimate. However, I can no longer log in as I get the error message: "The User Profile Service failed the logon. User profile cannot be loaded".

In windows, my drives are mapped as:
C:\ -> windows system drive SSD
d:\ -> programs
e:\ -> users

Using the recovery command prompt my drives were mapped as:
X:\ -> recovery media
e:\ -> windows system drive SSD
f:\ -> users

I tried to create a hardlink from c:\users to e:\users in the recovery command prompt as follows:

robocopy /copyall /mir /xj e:\users f:\users
rmdir /S /Q e:\users
mklink /J e:\users f:\users

this seemed to work in the command prompt as doing a 'dir' showed the junction point as expected. However I was unable to log in after rebooting.

As I was slightly confused about which drive letters to use (the recovery ones or the original windows ones), I tried this again using the "\?\Volume{GUID}\" notation instead but this still has the same problem.

Anyone know what I did wrong or how to both this?

PS the original instructions I used were: http://lifehacker.com/5467758/move-the-users-directory-in-windows-7 PPS this is a clean install of windows, so I am not worried about losing data, etc.

Simon

Posted 2010-10-16T12:01:02.060

Reputation: 181

sounds like the profile path is still set to c: I think this can be changed in managment console, not sure how to do it on commandline, probably via some regedit? – stijn – 2010-10-16T13:46:30.267

@stijn - the profile path is still set to c, but this is correct isn't it? I thought that was the point of the junction point? – Simon – 2010-10-17T10:02:06.943

oops didn't see you created the juntcion; in that case, yes, it sounds allright.. either something went wrong with the copy (you could check that by moving everything from e: to c: again, if you still get the error, something's currupt), or windows has problem seeing everytiing through the junction (which I doubt, I've been using junctions for a long time and never had problems) – stijn – 2010-10-17T10:23:26.617

@stijn thanks, that's a good suggestion. I've done that and you are right, it still can't logon. Any idea's on what I could have missed on my robocopy arguments? It didn't report any failures when I did the copy? – Simon – 2010-10-17T10:31:54.637

as harrymc points out, robocopy might not copy files that are in use; did you copy after booting to recovery console? if not, that might be the problem; if so, I don't know, afaik when booting via cd no files are in use so it should be fine. – stijn – 2010-10-18T18:05:47.537

@Simon So what was the resolution? You mentioned that Robocopy doesn't copy junctions... – Toaster – 2012-03-11T23:00:05.993

@Colin I think I had to follow the original lifehacker instructions, but the user I created when first installing windows would no longer work, only new users would work or something like that... sorry, this was so long ago. I did want to write the solution at the time, but it took so much trial and error I couldn't remember exactly the steps I took. – Simon – 2012-03-12T17:08:55.220

@Simon Thanks. Yes, the process is simple but delicate. – Toaster – 2012-03-15T22:01:10.573

possible duplicate of Moving users folder on Windows Vista/Seven to another partition

– Renan – 2012-07-24T13:49:20.753

Answers

3

The problem seems to be with the different drive letter mappings in repair mode compared normal mode. What I did and worked for me is to run DISKPART (good reference here: http://ss64.com/nt/diskpart.html) remap the partition/devices and then make the junction with the drive letters which windows will normally use.

Nik

Posted 2010-10-16T12:01:02.060

Reputation: 31

2

See in this thread the comment made by ohdannyboy on December 4th, 2009 2:33 pm, and the following comment by imadman.

They detail how to relocate the Users folder in a way that supposedly works.

From wikipedia Robocopy :

The Windows Volume Shadow Copy service is the only Windows subsystem that can copy open files, which it does by snapshotting them for point-in-time consistency. Robocopy does not implement accessing the Volume Shadow Copy service in any way, inhibiting its usefulness as a backup utility for volumes that may be in use. However, one can use separate utilities such as VSHADOW or DISKSHADOW (included with Windows Server 2008) to create a shadow copy of a given volume with which to back up using Robocopy.

If uncopied in-use files are the cause of the problem, it is still unclear how you could have deleted e:\users, but many miracles are possible in Windows.

However, the article Backup/Copy Files that are "In Use" or "Locked" in Windows advocates using HoboCopy instead of robocopy.

As another remark, I cannot understand how you claim to have mapped the system drive to another letter than C:. As far as I know, this is absolutely impossible.

harrymc

Posted 2010-10-16T12:01:02.060

Reputation: 306 093

thanks harrymc, the instructions I used were actually "ohdannyboy"'s anyway. Still cannot get it to work though. – Simon – 2010-10-17T10:17:11.040

I have added some more thoughts about the subject. – harrymc – 2010-10-17T18:24:52.303

Thanks for the update harrymc. The problem wasn't files not copying because they were in use. I've now fixed the problem and will add an answer here to provide my solution, but briefly the problem was that robocopy doesn't copy junction points. As to how the system drive wasn't c:, that can happen when you boot from a win7 dvd and select command prompt from the repair menu. – Simon – 2010-10-18T10:32:11.123

According to your description, the junction was created AFTER the copy. – harrymc – 2010-10-18T12:54:19.780

Yeah, sorry, the junctions i'm talking about there are the one's that windows creates INSIDE the c:\users folder - for example, it creates a junction called "My Documents" that just points to "Documents". These are for legacy compatibility but in my experience it appears that they are required for the user account to work correctly. – Simon – 2010-10-18T13:24:53.510

2

I ran into this previously. You have to make sure you use the remapped volume letter for the SOURCE parameter on the mklink command and your actual Windows-recognized volume letter for the DESTINATION parameter. Windows does NOT remap symlinks when you change the volume letters of what they point to. They're dumb like that.

E.G. According to your configuration, the following command should suffice:

mklink /J E:\Users E:\Users

Also, NOTE: if you remap your users directory elsewhere as a subdirectory (E.G. E:\Storage\Users as I once did) be careful that robocopy does not skip over any files, ASIDE from any failing. My experience with this tells me that Windows will not copy critical Users files that only work with the default directory scheme (E.G. [DRIVE]:\Users). I found out that putting the Users directory into a subdirectory would cause critical files to pass their filename length quota, and it would thus skip over them.

Duke Wellington

Posted 2010-10-16T12:01:02.060

Reputation: 21

You really should provide more information. If you can't provide more information then its not really a full detailed answer like the other answers currently. – Ramhound – 2013-02-06T16:28:02.837

@DukeWellington you know, I think that was the problem - always meant to come back to this question, but did so many things I couldn't remember what the solution was! I think your answer has useful info. – Simon – 2013-02-07T17:34:49.650

mklink /J E:\Users E:\Users is the key – Matt – 2013-10-18T17:54:24.393

1

The problem is that the \xj option on the robocopy EXCLUDES JUNCTION POINTS, creating the issue (missing junction points) later clarified by Simon. Unfortunately, if you leave this option out, the process chokes on the junction points. This is a serious catch 22 with the proposed approach.

If you didn't create a recovery point and are desperate, I reinstalled and identified the following juctions that need recreated (replacing ? with your profile). I did not actually restore a system this way so I cannot guarantee that this is exhaustive, but I believe it to be so.

As you can verify for yourself, the junctions continue to point at "C:" even after the drive letter has changed (during Windows Repair Command Prompt). I believe, therefore, that the new junctions should be pointed at their "usual" locations (standard drive letters) despite the fact that the instructions above show different drive letters (on the Repair Command Prompt).

  • Users\Default User <==> Users\Default
  • Users\?\My Documents <==> Users\?\Documents
  • Users\?\Local Settings <==> Users\?\AppData\Local
  • Users\?\Application Data <==> Users\?\AppData\Roaming
  • Users\?\Cookies <==> Users\?\AppData\Roaming\Microsoft\Windows\Cookies
  • Users\?\NetHood <==> Users\?\AppData\Roaming\Microsoft\Windows\Network Shortcuts
  • Users\?\PrintHood <==> Users\?\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
  • Users\?\Recent <==> Users\?\AppData\Roaming\Microsoft\Windows\Recent
  • Users\?\SendTo <==> Users\?\AppData\Roaming\Microsoft\Windows\SendTo
  • Users\?\Start Menu <==> Users\?\AppData\Roaming\Microsoft\Windows\Start Menu
  • Users\?\Templates <==> Users\?\AppData\Roaming\Microsoft\Windows\Templates
  • Users\?\Documents\My Music <==> Users\?\Music
  • Users\?\Documents\My Pictures <==> Users\?\Pictures
  • Users\?\Documents\My Videos <==> Users\?\Videos
  • Users\?\AppData\Local\Application Data <==> Users\?\AppData\Local
  • Users\?\AppData\Local\History <==> Users\?\AppData\Local\Microsoft\Windows\History
  • Users\?\AppData\Local\Temporary Internet Files <==> Users\?\AppData\Local\Microsoft\Windows\Temporary Internet Files

You may also need to add a SYMLINKD using "mklink /d ". Note the substitution of the /D option for the /J option:

  • Users\Application Data\ <==> C:\ProgramData (unless you have also moved this directory)

Naturally, additional links may have been created by other programs, but this should fix the major items broken by the inadequate instructions.

claytond

Posted 2010-10-16T12:01:02.060

Reputation: 121

0

Using sysprep is the easiest way to create user profiles in a different location. All the other, unofficial ways, such as messing around with junctions and copying or moving files around, gave me "The User Profile Service failed the logon. User profile cannot be loaded." profile error.

XP1

Posted 2010-10-16T12:01:02.060

Reputation: 924