The other week I mentioned I'd suffered a hard drive failure on my laptop. Other than the git issues I wrote about last time, I had another issue that seemed worth writing up: How to get all of the user data for the rebuilt install on a separate drive to the programs and operating system. If that's something you might want to do with a Windows install then read on...
I've been using a machine running Windows Server Essentials as a home server for some time, and this manages the backup of my individual PCs. Something I realised with the recent hard disk failure was that it's rare that I'd want to restore the whole drive. The reality is that I usually want to re-install the O/S and applications to a blank drive, and then restore only my data files and some settings from backups. Hence using Windows Server Essentials to back up the entire drive is largely wasting disk space and making the backups take much longer than necessary.
So I started researching how I could configure my rebuilt machine to get my user data onto a separate volume, and back up only that bit.
url copied!
While this is easy, it's not that great a solution. Firstly, it doesn't address any of the settings and data stored in any of the hidden folders that Windows keeps under your Users folder. You're moving some of the child folders of your User folder, but nowhere near all of them. Also some (poorly written) applications which make assumptions about where these folders are supposed to live won't respect the settings here, and will keep writing to the old location anyway.
So what else can we do?
url copied!
xcopy "E:\Users" "D:\Users" /e /i /h /k /y /c
rmdir "E:Users" /s
mklink /j Users "D:\Users
Those three commands should end up looking something like:
If all goes well, the installation should now complete (after you've answered a few more questions) and Windows should run fine. When you look at Explorer you should see something like:
Note how the Users folder here has a "this is a link" icon overlay, showing what we've done.
And with that sorted out, I can now tell the Windows Server Essentials connector software to back up the
E:
drive only, so just my files and settings are copied.
url copied!
Should you see this error, you can use Shift-F10 to get the command prompt back, and adjust the link. Use
rmdir Users
to remove the incorrect directory junction record. Then repeat the
mklink /j
command to point a new link to the correct drive letter. Rebooting again should allow the windows installer to complete.
If you're worried about getting this process right (or you just want to practice), you can test it out in a virtual machine.
↑ Back to top