Migrate Mac OS 10.7 Lion on a OCZ Vertex SSD in a unibody MacBook Pro
To speed up my unibody MacBook Pro (6,2) I decided to replace the internal hard disk with a SSD (OCZ-Vertex 2, 240GB, SATA2/3Gbps, Rev. 1.33). After browsing loads of tutorials I found another really easy way to put Lion on the blank disk. I have no confirmation if this is really the "master way" and that complications or side effects are impossible, but it works without 3rd party software, without shell commands, but only with Apple software and the tools you use anyway.
I assume you have already have ...
an installed and functioning system in on your internal hard disk. If this is a MacOS 10.6 Snow Leopard installation, you must upgrade to Lion, because the Recovery Disk Assistant will be used, which is not available under 10.6 yet.
a Time Machine disk
a "scrap" USB stick or old USB hard disk. The Apple guys say it must have at least 1GB space.
Installation sequence
Make Time Machine backup
Remove large files (videos, music, photos, etc) from your internal hard disk until the used disk space is less than the disk size of the SSD. (I simply removed almost all media files and had 90GB disk usage after this cleanup. No applications or settings in the Library deleted.) A software which helped me quite well finding the space wastes was WhatSize. Probably you could use some cleanup programs as well to reduce the used disk space first (I didn't). I would definitely propose to remove more rather than less. You can get the stuff back from the backup anyway.
Make a Time Machine backup again. This backup will be the one to migrate later on.
Download the Lion Recovery Disk Assistant. Additional information about this Apple software can be found in the article OS X Lion: About Lion Recovery Disk Assistant.
Connect the USB disk and format it with a HFS+ filesystem using the the Disk Utility. Then run downloaded Recovery Disk Assistant, which will detect the USB disk ("follow the instructions :-)". In my case it was a 8GB USB stick (one of the d**ned Cuiser sticks), I repartitioned it with one partition, Journaled HFS+, partition name: "LionRecovery").
Replace the internal HDD with the SSD. A good Tutorial by mefouryou how to do this can be found at YouTube: How to Install an SSD Into a Unibody MacBook Pro.
Switch on your notebook, press the option-key until the boot menu shows up, and boot from your Lion Recovery disk.
Plug in the Time Machine backup disk and choose the "Restore From Time Machine Backup" option. In my case the process took about 1 hour. After finishing the restore procedure, the notebook restarted and I could log in as usual.
Conclusion and annotations
After restoring on the SSD, the system worked out of the box. All settings I checked, such as saved passwords in Safari, Bookmarks, and the like were unchanged. Mail asked to import already existing emails and did this without any side effects. However, some Adobe programs had trouble with the licensing, so I had to uninstall (inclusively removing the settings in ~/Library) and reinstall them. Word 2011 wanted the CD key again (probably because the Hardware ID changed). The processor load was quite high after the installation due to the Spotlight indexing process. The next Time Machine backup, which I did directly after the migration, had a size of 75GB.
Some SSD related settings
As they are some differences between SSDs and HDDs, here some further things you may want to do:
Disable sudden motion sensor, which protects the disk mechanics if you drop your notebook. As SSDs have no mechanical parts, disable it in the terminal:
sudo pmset -a sms 0
Enable TRIM support. Lion enables TRIM for Apple SSDs, but not for Vertex 2. I don't like to present a solution on this site because this issue and its solution is a quite dynamic and not long time tested affaire at the moment. One of the referred discussions is http://notebooksnews.com/apple/enable-trim-mac-os-x-lion/. I have no idea if this will work for future versions, so search the internet for the actual solutions!
Disable hard drive sleep: It's no advantage to put SSDs into sleep mode. You can switch this off in the System preferences section "Energy Saver" by unticking the "Put hard disks into sleep when possible" checkbox for both Battery and Power tabs.
You can free some disk space by disabling the hibernation mode. (This is not directly related to the handling of the SSDs, but general disk usage). Setting the sleep mode settings from 3 to 0 does this:
sudo pmset -a hibernatemode 0
. You can then remove the sleep image:sudo rm /var/vm/sleepimage
.
Summa Summarum: After determining what to do, the whole migration took effectively about 2.5 hours of my lifetime - which is less than fixing the last compilation issue with MacPorts ...