Recover from a 'Library is locked' iTunes error

Jan 02, '03 09:08:45AM

Contributed by: qdzlug

Didn't see a hint for this one out there, so I thought I'd throw this out in case anyone else runs into this problem. I was having some kernel panic problems with my Ti Powerbook yesterday (apparently due to a bad USB peripheral) that caused my machine to lock up several times which resulted in a few hard resets of the laptop, which didn't appear to cause any harm.

This morning when I tried to start up iTunes I received an error stating that either the library was locked or I did not have write permission to it. I figured that this was most likely related to the problems I had yesterday, as I was burning a CD during one of the lockups.

After a bit of mucking around the system I was able to come up with this not-so-elegant workaround. I made my changes from the command line, but you should be able to do this from Finder as well.

  1. Make sure iTunes is not running.
  2. Go to your ~/Music/iTunes folder.
  3. Copy the files "iTunes Music Library.xml" and "iTunes 3 Music Library" to "iTunes Music Libary.xml.backup" and "iTunes 3 Music Libary.backup".
  4. Remove the files "iTunes Music Library.xml" and "iTunes 3 Music Library".
  5. Rename "iTunes Music Library.xml.backup" to "iTunes Music Library.xml" and "iTunes 3 Music Library.backup" to "iTunes 3 Music Library".
  6. Relaunch iTunes. Problem should be fixed.
A much more elegant way to fix this would be to determine where iTunes stores information regarding which files are locked, but I was unable to find this. Hopefully someone else out there has more information, but until then this should suffice.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030102060845695