Locked Out Of Mac OS X - Solved!
By Damien Gallop
December 4th, 2001
Last week I published a plea for help. I had found myself locked out of Mac OS X on my iMac. As that is where I do my writing, it was a crisis. A small crisis, granted, but a crisis nevertheless. I am here now to tell you that my OS X is back online again and to extend my sincere gratitude to those of you who wrote me in response. Without you, I would still be writing in OS 9 and feeling stranded on an island.
So, thank you all very much! I always had a high respect for the Mac community, and it just went up another notch. Even the overall tone of the letters was helpful, patient, and sincere, and the details were specific enough for me to work through a solution methodically. I appreciate it.
To recap, one day I found that I could no longer login to my OS X desktop. Things had been acting oddly, so I went for the salutary reboot, something I don't do often with OS X. Once up, I was presented with a login window, odd because I have my home machine set for automatic login. When I punched in my password, OS X shook its little head in refusal. No amount of running Reset Password from the OS X installation CD got me any closer to logging in.
With full credit to those who wrote in, allow me to present a synopsis of the problem and its solution.
The cause of the problem turned out to be a corrupted NetInfo database. I have yet to do a post-mortem and determine whether it was a set of entries or the whole database that got corrupted; I'm just happy to be up again. I also lost my Eudora Mail settings file, and had to revert to a backup copy. From these two events, I deduced that all files that had been open at the moment things glitched got corrupted simultaneously.
The solution was to delete (or rename) the NetInfo database folder and the OS X setup flag. These two are, respectively, the following items:
/private/var/db/netinfo/local.nidb (This is a folder.)
/private/var/db/.AppleSetupDone (This is a single file.)
I could access these items by booting into OS X's single user shell. Hold down Cmd-S as your machine boots to come up in this mode. There is a security patch out there to plug this back door. I now recommend you leave it available, especially on a home machine. I would have had no other way to make repairs.
To make any changes at the single user shell command line, you mount your disk as read/write, using the indicated syntax, which is mount -uw /. Fortunately OS X prompts you with the correct syntax when you start the session.
Once I removed the above two items and rebooted, OS X came up the next time as if I had just installed it, and queried me for the usual information. I took a risk and gave it my original username, and presently all of my user files, desktop, and settings came up as if nothing had happened. Voila!
Losing the core database of an operating system sounds like a serious thing, and it is. But OS X rebuilds practically all of it. Things missing that remain for me to fix are additional hosts I had configured and some secure socket layer information. That's what I have discovered so far. I am expecting the latter to repair itself when I reinstall the openssh package from OSXGNU, which, by the way, I now have on CD.
I hope none of this happens to you, but things do happen. It's certainly easy enough on any computer for a file to become corrupted while it is being written to disk. In my area, there are patchy periods of line power. They don't qualify as brownouts, but they're visible in the lights. I believe I'll buy myself an APC BackUPS Pro for Christmas. That should eliminate line noise as a possible cause of data write errors in the future. And, if it performs like my original APC PowerCell on my old Windows NT machine, then I'll be noise-free for a long time to come, as that little fellow hasn't failed ever.
One disk utility product heartily recommended to me is DiskWarrior. This appears to be a look-no-further poduct, and that's just how much further I intend to look. I hope to have this product in-hand and searching for other fallout on my OS X system by the time you read this.
Finally, once again, I extend a big kudos to those who wrote with solutions. Thank you. I truly appreciate it. Ciao.