You should follow me on Twitter.


Recover from Directory Service database index corruption

Over the course of the last week, I had the following problem twice: My MacBook Pro ran with a processor load of 190% — I had a look at the Activity Monitor utility and found out that this load came from a single process called DirectoryService. Thus the computer became unresponsive and unusable — and a simple reboot didn’t help.

I did a little research on the topic and this is what I ended up doing:

  1. Open a new Terminal window
  2. Go to the following directory: cd /var/db/dslocal/indices/
  3. Delete the corrupted database index: sudo rm Default/index
  4. Enter your password and confirm with Return
  5. Reboot your machine — since we already have an open shell, let’s do it geek-style: sudo shutdown -r now

You can also try to kill the DirectoryService process by executing sudo killall DirectoryService, but you have to go through the steps above to make sure that the database index will be rebuilt and not cause the same problem again after you reboot your machine.

This way I solved the problem on my MacBook Pro running Mac OS X 10.5 Leopard — good luck!

UPDATE: If this doesn’t work for you because your machine is not responding due to the high processor load, boot pressing the Shift key and try the whole process again in Safe Mode.


Comments

  1. Quote

    I am experiencing the same issue with DirectoryService on my MB since 2 weeks. I followed your suggested steps, lets see in the next days if the problem will show up again. Thank you.
    Ralf

  2. Quote

    I think this issue has something to do with Leopard’s sleep mode. I’ve had this problem two times, and both times my MBP just woke up from sleep mode before this happened.

    No more problems since — I hope it stays like that…

  3. Quote

    I’m surprised to hear you are having trouble with Leopard. I’ve heard nothing but good things about the OS. That goes the same with a Mac in general. It’s good to hear that you have a handle on the situation. Hopefully, nothing like that ever happens to me, whenever I do get a Mac.

  4. Quote

    I’m positive that it’s the best system for my needs, but unfortunately it is only 99% perfect — it’s still a little buggy ;-)

  5. Quote

    I have this problem when I start filesharing software like torrent or limewire.. stuff like that.. DirectoryService goes crazy, 10.5.2 doesn’t change this bug at all, and I tried the above step (without rebooting but with killing the proces after deleting the specific file, I also checked if removing /var/db/DirectoryService/flatfile.db would be of any help, and nope, it wasn’t).. This is getting really frustrating, cause it leaves my computer inoperable for a while when I start a filesharing program.. Is this some kind of RIAA scheme ( ;) j/k)??!?!

  6. Quote

    This is really important information for I have also had to deal with the directory service database index corruption, thanks

  7. Quote

    This worked for me on OS X 10.5.2

Leave a Comment

(required)

(required)

Formatting Your Comment

The following XHTML tags are available for use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

URLs are automatically converted to hyperlinks.

Additional comments powered by BackType