Having A Panicless Kernel Panic
// May 9th, 2009 // Rambling
Kenn Bell, of the fabulous Dog Files (you don’t need a dog to be a fan), was having a problem with his MacBook Pro at startup. Turns out, it was kernel panic’ing. I couldn’t tweet everything I wanted to say in 140 chatracters, so I thought to myself “well, you’re a professional sysadmin by day, write out what you’d tell someone who dropped by the office with this problem.” So I did. Now, a kernel panic isn’t something you’ll see every day, but, if it happens to you, you’ll likely want to panic as well. It seems pretty dreadful when you get that ‘you must restart’ screen, but all may not be lost.
First, some background. The kernel is the heart and soul of your computer’s operating system. It’s quite resilient on its own, but we pile heaps and heaps (hehe… sorry… nerd joke…) of stuff on it in order to make our computers useful. But, if some near-catastrophic situation occurs where the kernel finds itself unable to continue/perform, it will ‘panic’. A panic is basically a software work stop. It’s saying to you “something is seriously wrong and I can’t (or won’t, for your protection) continue.” The problem could be hardware or it could be software. Let’s try to figure out which, shall we?
- Remove and then re-seat the RAM. The memory modules in your Mac are pretty easy to remove. Refer to Apple’s support pages or the booklet that came with the machine. If you have canned air, it wouldn’t hurt to blow out the socket too, but that’s low on the scale of ‘probable cause’. But RAM modules can work loose and just one less-than-adequate connection, especially if it’s intermittent, can cause no end of havoc for your computer. This is especially true of laptops.
- Do you have AppleCare? If so, boot from the CD that came in the box (hold down the “c” key at startup) and run the test utility included. If your kernel panics are constant and you don’t get one when booting from the CD (or a OSX disc), then your hard drive (or the OS install on it) have moved up the suspect list. Hopefully the utility will identify the culprit.
- If you can’t boot the machine without a panic, try booting in safe mode. http://support.apple.com/kb/HT1455
If this works, then you’ll likely need to reinstall OSX at this point… You have a backup, right?
- If you can boot the machine (from hard drive or AppleCare CD or OSX CD/DVD), check your hard drive’s SMART status with Disk Utility. Click on the drive and look at the bottom of the Disk Utility window. If it says anything other than ‘Verified’, start cloning your data off this drive now, if you haven’t already. A little mild panic is allowed in this case. Got SuperDuper?
- If you can boot the machine (from hard drive – you don’t have SuperDuper on your CDs…) and have done all the above, clone your drive now. Hopefully you’ve already done this, but it bears pointing out. At the very least, have a backup of your data somewhere (via clone or Time Machine or whatever). Boot from the cloned drive (hold down the option key at starrtup and select your clone drive) — try it several times if the kernel panic is intermittent. If the kernel panic ceases, we can start suspecting your hard drive and not OSX. Otherwise, or if you don’t have a bootable clone, just a backup, let’s move on.
- If you can boot the machine from hard drive (your kernel panics are intermittent) and nothing above has worked, have you recently repaired permissions? Before we get into things that might make some people nervous (single user mode, etc.), let’s eliminate a simple permissions issue (or, maybe Disk Utility will error out and show that it’s the hard drive at fault). If you haven’t repaired permissions in a while, open up Disk Utility and do so now. With any luck, you won’t have a panic during this. But we have a clone/backup to fall back on, right?
- OK, I lied about single user mode. We’re not going there. If you’re familiar and comfortable with single user mode and fsck and and the like, you probably stopped reading this about 3 bullets ago. You may now panic. But only if you don’t have a backup. If you have a backup, it’s time to try the last-ditch-effort: reinstall OSX and restore your user data. Annoyed? Yes. Panicked? No.
- If reinstalling OSX does not help, it’s time to hit the Genius Bar or call AppleCare. There are other things you could attempt, but this is what you paid for. It’s time to let someone who gets paid to do it take your burden away. Deep breath… and repeat after me, “I’m so glad I got AppleCare.” You did get AppleCare, right? Oh, yes. Right. Let’s try that one too, “I’m so glad I’m still under warranty.”
There are other things you could try, but they’re outside of the scope of this post (i.e. – I’m too lazy at this point to type it all out). Good luck!