Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My iTunes library is located on an network drive, or rather, the music is, and my library file is located on my MacBook.

  • Library file: /Users/glenn/Music/iTunes/iTunes Library
  • Music: /Volumes/MyVolume/Music

But every now and then when I use the laptop somewhere outside my WiFi network, and then come back, fire up iTunes and play a song I get a library full of those pesky little exclamation point icons next to my songs. This is because iTunes have guessed that "Oh, he's not at home, let's reset the music files location to /Users/glenn/Music/iTunes." And there are no music there.

How can I prevent iTunes from doing this "smart" guess, and just leave the setting alone?

PS. And MyVolume is auto-mounted on my laptop. But of course, if iTunes is running when opening up the lid of the MacBook, it takes some time for it to mount, and iTunes won't find the path to the music at first.

share|improve this question

You can make "iTunes Music" an alias to your music folder on your network drive. That should keep iTunes' smartness at bay.

share|improve this answer
That seems to be the only solution. – Studer Aug 22 '10 at 16:52
I seem to recall that iTunes "works around" this hack and will remove the soft link and replace it with a local directory. Not sure if this is still (or ever) true, but I'd be sure to take a look to make sure things are really happening as you expect they are if you use a link. – Tim Nov 15 '10 at 16:37

Just a thought for your laptop, why don't you share your iTunes library and stream it to your laptop instead of mounting the network drive?

I'm in the process of setting this up now, I just moved my iTunes library and media files to my Network Attached Storage, which can share with all machines on my home network.

I was having the same library reset issue as you, so I'll try using an alias in Windows 7 to get around this (thanks @zneak). Nothing scarier than telling iTunes where my 10,000+ song library is and have it show nothing :(

share|improve this answer

I would guess that when the iTunes media directory /Volumes/MyVolume/Music is found to not exist, it resets to the default value of /Users/glenn/Music/iTunes. That is to say, I don't think it matters if the files are there or not (so network mounting is not so much the issue), but that the directory is there and can be browsed.

So a solution would be to have an empty directory as your iTunes media library directory (which can just be the default), and mount the network share into that directory. This would involve using smbmount rather than the standard Finder-based /Volumes/... mounting. Of course... smbmount doesn't come with OS X, so this solution will require some effort on your part to get smbmount.

You might be able to achieve the same with symbolic links, though I'm not sure whether iTunes can handle its media library directory being a broken symlink; it might just delete the symlink by forcibly creating the /Users/glenn/Music/iTunes directory on top of it...?

share|improve this answer

Finally figured out how to get around this myself. My solution is to have two separate libraries, one local and one on my drive. I created a LaunchAgent (see that runs a script when the mount path to the disk changes (via WatchPaths). The script checks whether the directory /Volumes/drivename exists, and if it does it sets runs a command to tell iTunes to change to the Library on the drive.

if [ -e "$mountPath" ]
   defaults write 'alis:1:iTunes Library Location' -data "drive hex path data"
   defaults write 'alis:1:iTunes Library Location' -data "local hex path data"

Otherwise it runs the same command with the path to the local library.

Mac OS does some weird kind of encoding for the hex data path, so I would recommend holding down the option key while starting iTunes, selecting each library, and examine the plist for the path data (note that when you use the defaults command you have to remove the brackets and spaces from the hex data).

This way, if your drive isn't mounted, iTunes will load a local library and won't mess up your main one. This can be handy for traveling, etc when you just want to use the local library to play stuff on iCloud.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.