There is an unresolved issue for some iTunes users in which libraries stored in locations other than the default ~/Music folder do not stay that way, and the library path gets reset to the default location in iTunes.
Per Apple Discussions poster Xoedusk:
"I have my iTunes library located on an external drive. Works nicely. But every now and then, the location of the library resets to the default location (~/Music/)...I keep the external drive mounted at all times."
There may be several reasons for the iTunes settings to be reverted back to default values, though it is puzzling that the problem reoccurs at seemingly random times for some users, especially if the iTunes library location is constantly mounted and accessible by the system. Still, users might try the following fixes to see if they help the situation.
Ensure external drives are set up properly Unless the external drive is going to be used with multiple operating systems, it is recommended to keep the volume formatted as Mac OS Extended. Many drives ship formatted as "FAT32" for cross-platform compatibility, but some users have experienced I/O problems with FAT32 in OS X.
Reset the iTunes preferences Locate the iTunes preferences file (named com.apple.iTunes.plist) in the users/username/Library/Preferences/ folder, and remove it from the preferences folder. Then open iTunes again and change the default library location. If a preferences file corruption is causing a reset of the settings, then this should fix it.
Fully reset the iTunes library In addition to removing the iTunes preferences file itself, users might reset their iTunes libraries by leaving any old library files in the default location and then dragging only the contents of the "iTunes Music" folder into the iTunes window to import them all to the new desired location (do this once the desired library location has been set in the iTunes preferences). This may take time for users with large libraries, but may help ensure that all library-related items point to the proper locations.