You are likely to be eaten by a grue
If this predicament seems particularly cruel
Consider whose fault it could be
Not a torch or a match in your inventory
(Summary for tumblr people: I almost had my Mac’s hard drive lose everything but then I didn’t, and this has nothing to do with Toronto politics or the Simpsons, so if this is just the next post in your dashboard just scroooooollll on ahead, trust me.)
Here’s what you do if the hard drive in your Mac is failing, you are running OS X Lion, and you don’t yet have a Time Machine backup. (In the words of someone I somehow still consider a friend: “What is wrong with you, besides everything!?”)
How did I know my hard drive was failing? The first indicator you’ll come across is random, inexplicable hangs while you are using your computer. Every so often your cursor will continue to move across the screen, but windows will stop responding to clicks, the Dock won’t show names as you mouse over icons, and so forth. You might be stuck like this for as much as a minute, and then you go back to normal. This is because OS X prioritizes user responsiveness over everything else; the window server (the part of the OS that displays the desktop and cursor) will stay alive even when everything else is screwed.
Basically, if your cursor is still moving, but nothing responds to clicks, and it stays that way for a half minute or more, then you are having the same symptoms I did. Time to investigate.
Fire up Console. (You can find it in the Utilities folder inside Applications.) In the upper right corner, type “disk0s2” to filter out messages, and see if you have anything that says “/disk0s2: I/O error”. If you do… you’re in trouble, but you might get out of it. I did, and now I’m writing this post to explain what I did. It might work for you; it might not. Read everything! Good luck! I can’t help you any more than this!
First things first: you are living on borrowed time. Your hard drive is working just well enough to inform you it’s dying. If you recover even one file that you thought you would have lost forever, dayenu. Everything past that is gravy. There are going to be people who suggest that you fire up Disk Utility and run a Verify Disk, or check the drive’s SMART status; these are useful, but in my case the disk looked as fine as fine could be as far as Disk Utility was concerned. Don’t take a “verified” SMART as a sign there’s no problems.
It is time to shut down your computer. Right now. I said now. Use the power button if absolutely necessary. We are going to assume that, like me, you are lucky enough that you’ll be able to boot it one more time later. (If not, my sympathies. I thought it was pretty touch and go for me for a while.) Your hard drive’s remaining time is finite and you want to spend as little of it as possible doing nothing.
Now, go get two external hard drives that are both at least as large as your computer’s internal drive, preferably bigger. I have a 320-gigabyte drive in my iMac, so I bought two 500-gig drives. One of these will be used for Time Machine and the other will be a live bootable disk we’re going to make later.
Attach the Time Machine disk to your computer. Start your computer up and log in. The Mac will see the new, unrecognized disk and ask if you want to use it for Time Machine.Hell yes you do. The disk will be reformatted and 120 seconds later, it’ll start backing stuff up.
Normal Time Machine backups run pretty quickly and don’t have problems, but we’re not in that world. Just let Time Machine do its work, grinding through, even if the disk errors occasionally cause it to pause mysteriously for minutes at a time, “288,110 items remaining”. Let it run, probably overnight. (My Time Machine run started at 11:30am on Sunday and finished at 8:46am Monday.) It might even crash. If it does, just let it restart on its own; Time Machine will do its best to pick up where it left off. (Mine crashed once, during one of those mysterious pauses.)
Once you have a working Time Machine backup, eject that disk. Right now. Now. You have just finished creating a snapshot of whatever Time Machine was able to save from your hard drive. You can look in Console for messages containing “backupd” to see if there were any files that it couldn’t read.
If you feel lucky, keep the Time Machine disk attached and wait an hour for the hourly backup to run. Some of those missing files may be readable the next time around when Time Machine tries to back them up, because your hard drive is now behaving unpredictably. Others may just be gone gone gone. (I ended up running a second hourly backup because I was asleep when the full backup finished. As it turns out, I lost several MP3s and an email from 2008.)
Now shut down your Mac, then reboot it in recovery mode by holding down the Option key as you turn it on and it powers up. You will be given a choice of two disks to boot from: Macintosh HD and Recovery HD. Pick Recovery HD. You will be shown a menu with four options, one of which is Disk Utility. That’s where we want to go right now.
Plug in your second external hard drive and fire up Disk Utility. It’s formatted as a Windows drive, which is good enough most times but right now we need to make it a bootable Mac disk. To do this, repartition the drive with a single partition called “Macintosh HD”, and use the options panel to set it to use GUID Partition Scheme. Let Disk Utility reformat the drive and exit Disk Utility.
Now you have your new boot disk, pining for an operating system. Reattach your Time Machine drive. (Yeah, this sounds a little patronizing. You are almost certainly not stupid enough to reformat the Time Machine volume. I wasn’t that stupid. But I was running on not enough sleep and too much worry, so it was close! Better safe than sorry.) Select the option to reinstall OS X Lion, and when you’re asked what disk to put it on, pick the boot drive we just reformatted.
You will now go through the usual Lion install rigamarole. You’ll be given a choice on how to set up your new disk: as a new Mac, off an existing hard drive, or off a Time Machine volume. You know what to do. Pick the Time Machine option, select your TM disk, and go.
This is going to be slow, I’ll warn you now. You’re reading from and writing to your disks over USB. It took two and a half hours for my restore to finish. Go have dinner or watch a movie or something. Either this will work, in which case you don’t need to babysit it, or it won’t, in which case I honestly have no idea what you could do.
(The reason I installed to an external drive is that a backup without a restore is not actually a backup. It’s just a disk. If it was okay for your backup software to just make you think it worked whether it did or not, you could replace Time Machine with a five-line script that pops up a dialog window saying “Backup complete.” By reinstalling from TM right now, we’re proving that we have a backup disk that works.)
Once the install finishes, you will be able to start using OS X from your external disk. The first thing you should do is go to System Preferences and tell Spotlight to stop indexing your internal hard drive. Remember, the reason we’re going through all of this mess is that your internal disk is screwed up. We don’t want to touch it any more than we have to!
You now have a slightly slower system — though compared to those random pauses from the dying disk, it might actually feel a little bit faster. You could in theory run off your external drive. Try not to do that. Cheap external drives are cheap because they are going to be just reliable enough to screw you over; lots of people have horror stories about their drive only lasting a month. That’s fine in our case; we don’t want a month, we just want a few days.
Shut down your computer and take it to your preferred repair shop. Tell them that you suspect the hard drive is fried. Or, hey, it could be something else. All you know is the symptoms you tell them. They’ll make you right as rain, and send you home with your Mac with a brand new hard drive. You can now reinstall Lion on it, using either your bootable disk or your Time Machine backup.
Now go out and buy an external disk that’s at least twice as big as whatever external drive got put in your Mac. This is your new, long-term Time Machine drive. And you are severely aware of the necessity of having a long-term Time Machine drive now, aren’t you? Yes you are. Just nod.
Fortunately you are no longer in a race against time. You have a brand-new hard drive in your Mac that’s working fine. You’ve also got a known-good Time Machine disk you can restore from, and a known-good OS X Lion disk you can boot with. You have two good copies of everything.
And that’s two more than you had this morning.