Jump to content

[Troubleshoot] Can't login to OS X


3 posts in this topic

Recommended Posts

Symptoms: You are unable to log-in on OS X, no matter how many times you try, check or double check.

On the GUI, the login window doesn't show the users on the system, just the path to enter name and password, even if i't configured otherwise (the default)


Cause: You probably have a corrupted netinfo database. It sometimes get corrupted when the system freezes or the computer gets unexpectedly shut down wile accessing it. (it has happened to me me a few times)


Prevention: Don't use unstable test versions of software unless you know what you are doing, and if there are frequent power outages in your area get a UPS.


Fix: there are two ways to fix this issue. The simple one, that I recommend for those with only one User in OS X and fear of the command line. And one more complete one that is recommended for those with complex netinfo databases.





Easy way: Making a new one, for the command-line fearful.

This way you will delete (or backup somewhere else) the existing netinfo database, and make a new one, don't worry you won't loose any of your files. Recommended only if you have a simple netinfo database, only one or small number of users and no fancy stuff in there. (I have reasons to believe that is possible that this won't be a good idea if you use file vault, I doubt it, but don't take unnecessary chances.)


Procedure: It's a three step procedure. you'll need access to the system partition (macdrive, other OS X installation or single-user mode)

  • Delete or move the current database by removing the following folder.

  • Delete the following file, it is a marker that tell OS X that you already passed trough the setup process after you install.

  • Reboot to OS X, you will see the setup utility again, enter the same user name and password, and done! You will have everything where you left of.

The complex way: Loading a backup

This way you will use a backup of the netinfo database, so you don't lose any of your netinfo configurations, etc. Your netinfo database is backed up every day to /private/var/backups/local.nidump, you can manually do this enetering this in a terminal window:

nidump -r / -t localhost/local > local.nidump


Procedure: First boot the troubled OS X system and go to single-user mode

  • As usual, to be able to write enter
    mount -uw /

  • Now put your corruped databse somwhere else, rename it or delete it, for example:
    mv /var/db/netinfo/local.nidb /var/db/netinfo/corrupednetinfo.nidb


    mv /var/db/netinfo/local.nidb /corruptedfiles_backup/corrupednetinfo.nidb

  • Now to start netinfo and create a new, empty database (this are all around the web but are originally from an O'Reilly article)

  • /usr/libexec/kextd
    /usr/sbin/netinfod -s local

  • To en this nighmare we need to load the backed netinfo database to the clear one, for that:
    niload -d -r / . < /path/to/backed-up/database


Link to comment
Share on other sites

PS: If you got some troubleshooting tips or solutions of things that happened to you (or not) post them, so others can solve the problems of their own. And that may help you too, many times I have fixed some problem, and forgotten about it, just to have the exact same thing happen again later, and had to research the problem again to solve it

Link to comment
Share on other sites

  • 9 months later...

  • Create New...