$Id$ steps required to upgrade my macbook (black, rev A) from 80GB SATA HDD to 250GB SATA HDD (5400 RPM WD Scorpio; $137 + shipping - thanks Pricewatch), and then rearrange my data to take advantage of the new space. Most of the issues I had to work through were due to having FileVault turned on for my homedir (works totally transparently most of the time; I've never had problems with it, and totally recommend it - watch out for resizing though ...) tools required ============== * superduper! (www.shirt-pocket.com; well worth the $25 purchase price. Basically a front-end to rsync, but with a bunch of added nifty features) * phillips #000 bit (you probably don't have one; test against the screws on the back of your macbook, since they're the same size as the ones on the RAM/HDD cover bracket inside the battery case) * Torx T8 bit (you probably don't have one of these either) * basic familiarity with the UNIX command line steps: ====== * purchase/ship HDD (pricewatch FTW) * reboot your mac in "safe mode" - hold down the shift key during the boot process until you see the spinner going around (~10-20 seconds from the time the power turns on, to be safe) * log into your regular user account (the one that uses FileVault) * clone old HDD to external firewire (WD LifeBook 500GB I had already; this step would not have been necessary had I purchased an external firewire chassis to go with the 250GB replacement laptop drive) - use SuperDuper to "backup - all files" from your old laptop HDD to the firewire drive (took ~ 2 hours for my ~60GB of data). DO NOT RUN ANYTHING ELSE during this process; the first time I did this, a security update popped up in the middle of the process and apparently goofed up the backup, and I had to start over. * reboot the system and boot from the firewire drive (hold down "option" as the reboot takes place, until you see the boot device chooser screen - select the firewire drive with the arrow keys and hit enter) * login to your account to verify that everything works properly. Once you're satisfied that the firewire drive is an exact clone of your old laptop HDD, * shut down the laptop and let it cool off for a few minutes while you prepare to swap HDDs * flip your mac over and pull the battery out (use a penny to open the case if you need to). Touch the metal inside the battery bay to dissipate any static electricity, and STAY PUT while you're swapping components, so you don't generate any more static. * loosen the three (3) holding screws on the L-bracket until the bracket comes loose (the screws will remain attached to the bracket). Gently pull off the bracket and set it aside. * the HDD is on the left - you'll see a white plastic tab tucked underneath; pull it _gently_ with a fingernail or screwdriver until one end comes free, and then gently pull on the plastic tab and slide the HDD caddy out into the battery bay. * use your Torx T8 bit to unscrew all 4 screws on the drive caddy and swap in your new HDD. Replace all 4 screws, and slide the HDD caddy back into place (NOTE: it is entirely possible to put the caddy back in upside down. I do not recommend this course of action. Make sure the solid metal portion of the caddy is facing up when you slide it back in (the HDD should be facing down). It should slide easily into place and fit COMPLETELY into the slot on the left - you should have no portion of the HDD sticking out into the battery bay. * replace the L-bracket, starting from the lower left corner next to the HDD - * it should fit into place without any squeezing required, but you may need to * use a small screwdriver blade to push the cushioning material on the long side of the bracket into place (it likes to stick out around the bracket instead of going in behind, next to the RAM). The screws should all screw easily into place (do not over tighten, and if they don't seem to be fitting properly, DO NOT FORCE - they are easily stripped and if so, almost impossible to manage due to their size). * once the bracket is back in place, you can replace the battery (don't forget to lock it with a penny again) * plug the power back in, plug in your firewire drive, boot your machine in safe mode again (hold down shift during boot) and login as yourself. Start up SuperDuper and "backup - all files" with source being your firewire drive and destination being your new laptop HDD, and set your laptop drive as boot device when finished. * after the copy is done (give it a couple of hours), shut down, unplug your firewire drive and reboot. You should now be able to login as yourself, see everything just as it was before you started and have a bunch of extra free space on the hard drive. * HOWEVER ... this new space will not be accessible inside your home directory, which is mounted as a separate drive (a separate disk image, really). The canonical way to fix this appears to be with hdiutil(8), although I have not yet had any success with this (after logging in as root; my username is sfrancis): # hdiutil resize -size 200g /Users/sfrancis/sfrancis.sparseimage I let it run for 7 hours overnight, with -verbose and -debug turned on, and got no output beyond what was generated in the first 10 seconds, and no apparent change in the FileVault image file used for my home directory (size did not change by even a sector), but the CPU was pegged at 100% the entire time. * my workaround for hdiutil(8) not resizing my FileVault homedir image was to move my music to /Users/Shared/mp3z (this was the main reason I'd purchased a larger laptop drive - I was tired of dragging around a portable just to access music). I also moved my iTunes folder from the portable HDD into /Users/sfrancis/Music/iTunes/ * so far, so good - except that my iTunes library now had several thousand songs all listed with an invalid location (since they used to reside on my portable HDD). Now we can't edit "iTunes Library" directly (it's a binary file; probably some kind of hashed db), but "iTunes Music Library.xml" is quite easy to edit. The missing link here (thanks much to a tip on hifiblog.com) is that if "iTunes Library" is damaged, it will be automatically reconstructed from the contents of the XML file. So, we just make our changes to the XML file, zero out "iTunes Library" and start iTunes (then wait while the iTunes Library db is regenerated): $ cp iTunes\ Library iTunes\ Music\ Library.xml backup/ $ sed 's:/Volumes/PORTABLE:/Users/Shared:g' foo $ cat foo >iTunes\ Music\ Library.xml $ cat /dev/null >iTunes\ Library (nevermind the useless use of cat; it saves me some explaining of more arcane syntax) I hope to get hdiutil(8) working to resize my FileVault image at some point, but if it makes no visible progress in 7 hours of operation, it's either not working right, or is going to take so long that I'll just do without (I don't particularly like pegging the CPU and fans at full throttle for hours and hours on end). -- sfrancis | 20071219