Friday, June 20, 2008

Recovering your MacBook

My MacBook Pro died on me last Thursday. This is a truly devastating moment where you start questioning your back up procedure and realise in a flash how royally screwed you are without your laptop.

It turns out I had an "Invalid node Structure", but it took me a while to reach this conclusion. Then I figured out that this wasn't just a data integrity issue, rather my hard drive was hosed. I got a lot of scattered information about how to recover a MBP in various forums and friends so I thought I would record my experience just in case I have to go through this again.

  1. You should try running in safe mode first. To do this restart the laptop (by holding down the power key for 5 seconds) and then hold down the [shift] key when it starts back up. This did not work for me, but if it does work you need to run "Disk Utility" (see below.)

  2. You can boot from a Tiger or Leopard install disk by inserting the CD, power down, then restart holding down the [c] key.

  3. When I first started booting from CD I didn't know you had to hold down the [c] key. I had a sinking moment when I couldn't get the CD to eject from the MBP. If you are in this situation you can try 2 things:

    1. Restart and hold down the track pad key. This worked for me.

    2. Restart and wait 10-15 minutes, the laptop will eventually spit out the CD. This also worked for me.

  4. Booting from CD takes a while but eventually you get a welcome screen. From here you can got to the Utilities menu and run "Disk Utility".

  5. Select your primary boot volume and hit repair. This will verify the disk and attempt to repair. It was at this point I was told I was a victim of "Invalid Node Structure".

  6. You have a backup right? Yes I do, so now the recommended course of action is to reformat the drive, reinstall Leopard and then restore from back up. One major gotcha to be aware of is that you need to format your primary disk in the same format as your back up disk. Your options are: Mac OS Extended (Journaled) or Mac OS Extended (Case-sensitive, Journaled). The formatting MUST match up.

  7. If you do not have a back-up, it is possible to save your data. You'll need to go into single user mode and run the command: fsck -fy. See this forum post for more info. Folks on twitter and IM also recommended Disk Worrior, this piece of software looks pretty awesome if you need it.

  8. Wait forever while the install DVD is verified.

  9. Once the installation starts you'll soon find out if your hard disk is screwed. Even though I ran the Disk Utility on my hard drive, it started making bad noises half way through the install and eventually failed.

At this point I realised I needed a new hard drive. Living in Malta there is no Apple 'Genius Bar' to take my laptop to so replacing my hard drive myself was the only option. Cracking open your MacBook voids your warranty, so only do this if you have no other way of getting the hard drive installed.

Before you start unscrewing, I recommend you you take a look at the various videos on youTube. I thought these two were pretty good (you can skip through the boring bits).

You will need a couple of tools to get your MacBook open. I got by with a philips head 2.4mm screw driver and T6 torx (star head) screwdriver. There are whopping 24 screws you need to remove before you can get the hard drive out, if you get lost about which go where check this guide out.

Once you have installed your new hard drive restoring your system from Time Machine is pretty easy, but lengthy (mine took about 4.5 hours).

  1. Boot from you Leopard CD (hold down the [c] key at start up).

  2. Select your language and hit the arrow button.

  3. Select Disk Utility from the Utilities menu.

  4. Format your new hard drive. Remember it needs to be in the same format as your backup drive.

  5. Once the hard drive is formated, exit Disk Utility.

  6. From the Utilities menu again, select Restore From Time Machine. You'll need to plug in your back up drive at this point.

  7. Select the backup you want to use and you are off.

Thank goodness for Time Machine, this whole debacle would have been a thousand times worse if I wasn't using Time Machine. While Apple's hardware can be flaky, having great backup software make up for a lot.

BTW thanks to everyone who emailed, twitted and IM'd me with suggestions and words of encouragement.


Paul R Brown said...

Been there, done that once myself. At least in my situation (which was similar to yours but a little different — S.M.A.R.T. failure), Data Rescue and Drive Genius were more useful than Disk Warrior.

Ross Mason said...

Thanks Paul. Hopefully I will not go through this again for a while. What I have learned in all this is just how many people have had problems with their MacBooks.