I'm replacing the hard drive in my 2009 macbook (13" unibody). How do I go about installing OSX and can I go straight to Yosemite or do I have to install Mavericks and then upgrade? It's my first attempt at replacing a hard drive so I've no idea what to expect. Thanks all!
You can use the drivers CD present in the MacBook box at the time of acquisition. Following the steps you can instal an old version and then update to the last one. Otherwise there should be the possibility of start a recovery and directly download (using a WiFi connection) the last versione of the OS.
An other option is to use Time Machine, if and only if, you have previously made a backup of the entire system before the swap of HD.
The more recent versions of OS X include a software called Recovery Disk Assistant. You need
- an empty USB disk or stick of sufficient capacity (8 GB or more)
- the OS X install disk image for Yosemite
- and the software, which you can also download if you don't find it in your Utilities folder within the Applications folder.
Alternatively, use the terminal and the
createinstallmedia command as described in this Apple Support link.
If your MacBook has an SD card slot, you can also create the recovery disk on an SD card. Just be aware that all previous content is lost when you let Recovery Disk Assistant loose on the volume.
If you are missing the OS X Yosemite install disk image, visit the past purchases tab in the App Store - it should be right there.
Make your recovery disk, then reboot with the new hard drive and the USB recovery volume in place and install Yosemite. The web holds plenty of detailed instruction for the process:
If you want to faithfully recreate all content of your current disk, make a TimeMachine Backup, or hook up your old disk and wait for the prompt after booting the newly installed system first to install your old files.