Here’s the scenario: you have a smaller Solid-state drive as your boot and application drive, and a larger HDD for your files. You don’t want to gum up your SDD with temporary internet files and other cruft, so you want your TEMP directory to be on the HDD, rather than its default location in Users. In fact, you don’t even want your Users to be on your boot drive either, because that’s where My Documents and other libraries are stored by default.
The solution? Move Users to your data drive but create a HARD LINK on your boot drive to fool windows (and Adobe Creative Suite) into thinking that everything’s on the boot drive.
One additional note (that caused a major complication for me) was that I generally like my TEMP directory to be at the root of my drive. This makes it more visible and therefore more likely to get cleaned out (by me) regularly, as opposed to being buried inside my %USERPROFILE% directory where it will never see the light of day. This has always been C:\TEMP in the past, but under this setup, I wanted it on D:\TEMP.
It turns out that moving your Users to the data drive is easier than you might think. The additional complication is that you can’t be logged in as that user when you do it. The best option then is to boot from your Windows install disk (which should be handy, because in all likelihood you’re doing this right after a clean install of Windows, right?) and do it from a command prompt there.
Before we get started
One thing you might want to do is get your drive letters in order now, before you do any hard-linking, because experience shows that changing drive letters after the fact could be problematic.
Boot into Windows, and open up the D
Booting to a command prompt
Use your Windows install disk to boot to a command prompt. To get there, choose the repair your computer option. You get this scary message saying that windows has detected a problem with your install (this is not true) and do you want to “Repair and Restart”. NO. (Go ahead, click the “No” button).
In the list of recovery tools, there is your command prompt. Click it.
Moving USERS to your secondary drive
Now that you’re in a command prompt and not logged in as a User, you can move the Users directory. There’s a ton of hidden files and stuff, so we’ll be using robocopy, a powerful copy tool that’s bundled with Windows 7.
This is where things get a little weird. When in Recovery mode, your logical drive letters can be different than what you expected. So spend some time in your command prompt to discover which is which.
I recommend using the DISKPART utility, which is available at the command prompt. Type “DISKPART” (without the quotes of course, and capitalization is optional) then type “list volume”, yes, I know it’s grammatically incorrect Niles. Now you should see a listing of all your volumes with the drive letters they’re mapped to. Look at the drive sizes – hopefully that will help identify the drive. Type “exit” to return to your command prompt for the next step.
If that should fail to be conclusive you willhaveto rock it old skool. You will use the dir command to list the contents of your various drive letters. You type the drive letter followed by a colon (eg: C:) and then ENTER to switch drives. You might find that some drives are unavailable or are protected system partitions. Just start at C: and work your way through the alphabet, doing a dir each time you actually get a physical drive and determine which is your boot drive and which is your data drive.
You’ll know you found your boot drive when the dir command lists directories such as “Program Files”, “Windows” and “Users”.
Write these letters down. You might get confused because they are often quite different than what you would expect. When this process is complete, they will go back to normal, so just bear with me.
In my scenario, it turned out that my boot drive was E: and my data drive was D:, so those are the letters I used in the following commands.
1. Copy your Users directory from the boot drive to the data drive
robocopy /copyall /mir /xj E:\Users D:\Users
2. Remove the old Users directory (it can’t be there or you can’t create the hardlink)
3. Create the hardlink (called a Junction in proper NTFS jargon). This is like a shortcut, only at a file system level.
mklink /J E:\Users D:\Users
Now reboot and navigate to your Data drive – you’ll see the Users there. Then, to test it out, open up another windows explorer window, and click on Documents, and put something there.
Important: Windows Explorer will show C:\Users\YourUserName because we’ve completely fooled it. Don’t take my word for it. Navigate manually to your data drive and open up Users/YourUserName/Documents and you should see the file you copied.
For more details on the various commands I’ve listed and to see my original reference, follow this link to lifehacker.com.
Photoshop Scratch Disk Errors with relocated TEMP file
In theory, if you haven’t messed with your TEMP folder, it will be %USERPROFILE%\AppData\Local\Temp. Which means that it’s been relocated, too. In my case I moved my TEMP file to D:\TEMP for the reasons I described above in my preamble. This required also going into the Windows environment variables and pointing the TEMP directory to this new location. This is actually easy to do via Start Menu > Search > View Advanced Systems Settings, then click on Advanced > Environment Variables. You can then edit each occurrence of TMP and TEMP to point to your new location.
This causes no end of grief for the Adobe Creative Suite applications.
Photoshop will fail on launch giving you this error: “Could not open a scratch file because the file is locked or you do not have the necessary access privileges”
(Aside: for you Googlenauts who just landed on this page because you’re having this error, you might want to try trashing your prefs by holding down Ctrl + Alt +Shift immediately after launching Photoshop. That is the recommended fix for a different, and much more common situation, that also leads to the same error message. The solution below only applies if you’ve moved your TEMP folder to another location).
Bridge will crash shortly after launch with a similar scratch disk error.
InDesign will crash a moment after it boots up.
It’s actually bad design on Adobe’s part. They don’t respect the environment variable and for some bizarre reason need the TEMP folder to be on the boot drive.
The solution: create another hardlink to TEMP.
mklink /J C:\TEMP D:\TEMP
Then point the environment variables to the hardlink, not to the physical location. Open your Start Menu, right click Computer, choose Properties. Click “Advanced System Settings” in the top left navigation pane. Choose the Advanced tab and click “Environment Variables”. Now, look in both the User Variables and the System Variables for any occurrence of “TEMP” or “TMP” and press the corresponding Edit button. Type in C:\TEMP in each instance (there are usually 4 edits that need to be made).
Leave a comment if this worked for you!
Note: I’m not a systems guy, so if you have other issues I probably don’t have the answers. I’m just posting this here because it took me a lot of Google-fu to cobble this info together, and the hardlink to TEMP is something I came up with (though I’m sure others have, too).