Saturday, April 21, 2007

The day my MacBook died

I've been forced to realize that personal computers, or at least operating systems for them aren't built for heavy multitasking. None of them.
I am a heavy mulitasker, I use some 20 applications simultaneously, and have even more running in the background. This is almost always a guaranteed way to make your computer crash. Back when I was using windows, some 10 years ago, it used to crash for that reason. Linux has frequently crashed for that reason with me at the keyboard. I have even tried later windows versions, such as XP, they also crash for that reason.
Today my Mac OS X crashed as well. It has crashed before, not as much as Linux (could be thanks to more hardware power though), and definitely not as much as windows, but it has crashed. But those times it has been in a controlled way. I have noticed that my applications froze and restarted them, or shut down a few of the onces in the background. Once or twice it's been really bad an I had to reboot, since the same application kept crashing over and over. Today was different.
First the screen froze, while I was watching a move, responding to some e-mails, downloading a few torrents and checking some references online. I tried the standard force-quit-application-tricks, but nothing helped. Tried force-rebooting, nothing. So I turned off the power. Here comes the worst part. When I booted up, Mac OS X refused to start. All I got was a unix shell. Since I've never seen a Mac behave like that before I had no idea that this was Single User Mode (I would have known that it was su-mode if it had been Linux, since I knew Linux has a su-mode). No error messages, nothing. Tried rebooting, same thing. Tried halting and restarting, same thing. Tried booting from the Setup CD, failed and back to su-mode. I started up my other computer (Good ol' Linux, where I know how stuff works) and tried searching for help online, in Apple support and the Mac OS X forums,. I tried searching for stuff like "mac os x start gui", "mac os x starts with command line interface" in different variations. Nothing. So I called phone support. No help there either, apparently you need to pay (an awful lot of money) if you want phone support.
So, back to searching for info online. I had noticed that most error descriptions about the startup process had described what the screen looked like. "Blue screen", "flashing question mark", "gray screen" et.c. so I tried searching for "mac os x black screen with white text". Yatzi, I found a page telling me that this was su-mode, and how one started the computer in su-mode. The next step was trying to start my Mac in su-mode and see if that would have the reverse effect not that I knew that it started in su-mode per default. That didn't work, however I noticed that I received much more startup information when I told it to start in su-mode than when the startup failed and entered su-mode. So I tried verbose mode, and hoped to get more info on what went wrong in the startup. Bingo, while trying to start all of the sudden the system said "/etc/hostconfig: no such file or directory" and then failed into su-mode.
From here things were pretty straight forward. I verified that the file was missing (It was) and called up a friend who also has a MacBook and had him e-mail his /etc/hostconfig to me. Then I remounted the file system (in su-mode it is mounted read only per default), created the file and entered the content from the file he sent me via the keyboard. Sara helped me here, typing from one screen onto another is boring and error prone.
This time when I rebooted it finally worked! What I cannot understand however is how the file could disappear in the first place. I wasn't doing any configurations of startup services when it crashed. I guess that the reason for the failure will remain a mystery, I'm just happy that my computer works again. Hopefully this information will be useful for someone else with the same problem, if Google indexes this blog entry so that s/he finds it.