Thursday, May 19, 2011

Lenovo W520 for Sony Vegas Pro 10 and Adobe After Effects CS5 - Part 4

Optimize mSATA + HDD Setup
There are a lot of articles and forum posts about optimizing SSD setup. Here the ones I read to decide what to do:

Quick guide Install Tweak Windows 7 After Installation mSATA
How to setup SSD boot drive secondary
Windows 7 Ultimate Tweaks & Utilities
How to Optimize your windows profile and media storage ssd
Move Users local profile from C: to another drive
Move the users directory in windows 7

It gets quite involved so here is an outline of this subsection:

(a) Define but do not login to the real administrator user
(b) Create folders for D:\Program Files* in D: (HDD)
(c) Copy C:\Users to D:\Users
(d) Edit registry to move Users from C: to D:
(e) Reboot
(f) Login to the real administrator user
(h) Switch Memory Paging to HDD to free space
(i) Deactivate Hibernation to free space
(j) Deactivate Indexing for C: to free space

I'm still researching the controversial ones such as superfetch, prefetch and moving the system TEMP directory.

Define but do not login to the real administrator user
Boot up in safe mode by tapping F8 after power on until you get a selection screen. Select, you guessed it, Safe Mode. Then login as your temporary 'pro' user:

Start -> Control Panel
-> User Accounts and Family Safety
-> Add or Remove User Accounts
-> Create a new account
-> Enter username
-> x Administrator
-> Create Account
-> Create a password (your new user selected)
-> Enter password twice
-> Enter hint
-> Create password

Do not login to this user yet. There's still some work to be done.

Create folders for D:\Program Files* in D: (HDD)
Go to the HDD in Explorer and create two new folders:

D:\Program Files
D:\Program Files (x86)

This will be the target for future installs that don't need to be on SSD. In other guides they also create D:\Users here. But I did it a different way.

Copy C:\Users to D:\Users
There is an alternate way to do this without a registry hack which involves booting off a Windows 7 Recovery disk and hard linking C:\Users to D:\Users. Outside of Windows 7 you might also accomplish it using a Linux liveCD. The point was you can only do the junction trick if you don't boot off the drive you're modifying. Because of this I stuck to the procedure used in the article.

-> Run
-> Command
-> right-click Run as administrator

cd \
robocopy C:\Users D:\Users /copyall /e /xj /xd C:\Users\pro

It should copy Default and Public at minimum. If Nvidia Optimus updates are wanted the UpdatusUser should be copied as well. "All Users" is a symlink to C:\ProgramData and is skipped by default. "Default Users" is a shortcut with no target and is likewise skipped. User "pro" we explicitly skip in the copy.

Edit registry to move Users from C: to D:
This is where it gets exciting and tedious. First make sure to backup the current registry in case something goes awry.

-> Run
-> regedit
-> File
-> Export
-> Give it a filename like "D:\preSSDDregistry.reg"
-> Export Range: x All
-> Save

Then navigate to the following path:

right-click Modify the Names "Default", "Profiles Directory" and "Public". Change %SystemDrive% to D:. Leave "ProgramData" alone.

Make another full backup of your registry at this point. Go back to the top of the tree to "Computer". Now every instance of C:\Users has to be change to D:\Users and C:\Users\pro to D:\Users\youruser. You could do this by hand by tapping F3 then editing manually. There are a lot of entries! I have a shortcut but it's not for everyone. It's downright dangerous. The only other alternative is to find an external program to do this. I didn't have one I could trust so I did it myself.

My downright dangerous method

-> Run
-> regedit
-> File
-> Export
-> Give it a filename like "D:\beforeDangerous.reg"
-> Export Range: x All
-> Save

Copy D:\beforeDangerous.reg to D:\downrightDangerous.reg. Open this file with notepad. Search and replace C:\\Users\pro with C:\\Users\youruser. Then C:\\Users to D:\\Users. If you don't understand the significance of double-backslash, its the escape character. Notepad may not respond for a few seconds as it does the mass replace.

Save your notepad file. Then right-click Merge D:\downrightDangerous.reg to apply the changes. It will give a few errors about keys that are open. This is okay. Just click through them.

Then go back to regedit and from Computer do a manual search for C:\Users. There should only be one (ProfileImagePath for the UpdatusUser) you can change. And another entry that can't be changed because it is a Name rather than Data (FP_AX_MSI_INSTALLER). When you get "Finished searching through the registry". You got them all.

I used a normal boot this time.

Login to the real administrator user
Login to the new administrator user. Check D:\Users and make sure the user directory is there. Check your environment variables to see that user TEMP and TMP point to the HDD as well.

At this point its safe to Delete the pro user.

-> Control Panel
-> User Accounts and Family Safety
-> Add or remove user accounts
-> Select pro
-> Delete the account
-> Delete Files
-> Delete Account

You should find that C:\Users no longer has pro. I rename C:\Users to C:\DeleteMe to be sure it's no longer used. If it was the system would have complained about an open file. I reboot again to be sure and login with my new real administrator. Since I'm positive the new user is working I go ahead and delete C:\DeleteMe. D:\Users is now the new location for User Profiles!

SWTOOLS may or may not have value. I don't want to take the chance of deleting it yet but it's hogging about 2GB of SSD. So I robocopy it across to D and hardlink it with a Junction like you would a Unix directory.

-> Run
-> cmd
robocopy C:\SWTOOLS D:\SWTOOLS /move /E

Check SWTOOLS in explorer to confirm it has moved from C to D. Then go back to your command line and execute this


Switch Memory Paging to HDD to free space
The system defaults to Automatic management of page file where C: is system managed. With 12GB installed it could use that much SSD. I'd rather use the space for programs so I'm moving paging to the HDD.

-> Computer
-> right-click Properties
-> Advanced System Settings
-> Performance
-> Settings...
-> Change
Uncheck "Automatically manage paging file size for all drives"
Select C: [Windows7_OS] System managed
x No paging file
-> Set
-> OK

Select D: [DATA] None
x System managed size
x Custom size
-> OK

I prefer a fixed file size rather than having it grow unpredictably. So I enter the recommended size as specified by Windows. Really though, if you paged a significant amount of your RAM you'd have a thrashing problem.

Deactivate Hibernation to free space
Here is another space eater. Hiberfil.sys is a snapshot of your RAM that the system can restore from Hibernation. I've not used Hibernation feature in years. Even on desktops I use the sleep option which is faster and more reliable (uses more power though).

-> Run
-> Command
-> right-click Run as administrator
powercfg -h off

Deactivate Indexing for C: to free space
Indexing is supposed to make it easier to search file contents for keywords like a search engine. Sounds nice in concept but I haven't warmed up to it in practice. I still prefer the Windows XP style of searching. On most of my PCs I use Agent Ransack instead.

-> Computer
-> C:
-> right-click Properties
-> Uncheck "Allow files on this drive to have contents indexed in addition to file properties"
x Apply changes to drive C:\, subfolders and files
-> OK

This takes a few minutes.

Update: Change Path of Memory Dump
If you get a BSOD you will find a complete memory dump the size of your RAM in C:\Windows\MEMORY.DMP. I found where it was set here. With still about 40GB free on the 80GB SSD I'm not too worried yet. But when space starts to get cramped I'd like to move this to the HDD.

-> Control Panel
-> System and Security
-> System
-> Advanced system settings
-> Advanced
-> Startup and Recovery: Settings
-> Change %SystemRoot%\MEMORY.DMP to D:\MEMORY.DMP
-> OK

Delete C:\Windows\MEMORY.DMP then reboot.

Other SSD optimizations
The factory restore should have turned the System Restore off on the SSD drive. the Disk Defragmenter service is defaulted to manual. It shouldn't be run on the C drive. Some prefer to have this service disabled entirely.

On to Part 5

No comments: