Jump to content
IGNORED

How to Set Up an iTunes Library on a Network Attached Storage Device (NAS)


Recommended Posts

  • 7 months later...

Hello Kirk,

Thank you for the excellent article. I now plan on moving my entire iTunes folder to a Synology DS414 in order to free up some much needed space (1TB!) since I will be upgrading to an all-laptop environment.

Two questions:

Are there advantages in using a WD MyCloud over a Synology NAS? Ease of use? File system?

Will using iTunes this way be the same as having the files locally, albeit slower? For example, will my AppleTV still be able to access movies and TV shows as it does now?

Many thanks,

Alexandre

Link to comment
I haven't used Synology in a long time, but I would assume the software is similar these days. Essentially, it's the same as if the files are local. Just make sure that the NAS is mounted before iTunes launches.

And if the NAS isn't mounted and my media isn't available, I can live with that. I just don't want iTunes to revert its settings to my local drive... I'd like to avoid the "it gets messy" part in your article!

Link to comment

OK. Did I miss or misunderstand something then when you write:

 

Move your entire iTunes folder

This is a simpler process. Just copy the iTunes folder in your home folder’s Music folder to the NAS. As above, this may take a long time.

The first time you launch iTunes after the move has completed, press the Option key immediately after clicking the iTunes icon. Click Choose Library, and then navigate to the iTunes folder on the NAS. iTunes will then use this library, and, if it’s not available on the network, will alert you. It won’t revert its settings to your local drive.

Sorry to insist on this issue, but with various people in our household accessing iTunes, I'd like to avoid a mess…

 

Alexandre

Link to comment

Yes, there are two ways to do it. I tend to prefer not copying the library files (which is what happens when you do the above). But if you do it, then you are protected from iTunes reverting the media folder location.

 

However, make sure you don't have two people trying to access it at the same time. And it's a good idea to back up the library files often (that's the main reason I don't think it's a good idea; it's harder to back those files up.)

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment
  • 5 months later...
  • 3 weeks later...
And if the NAS isn't mounted and my media isn't available, I can live with that. I just don't want iTunes to revert its settings to my local drive... I'd like to avoid the "it gets messy" part in your article!

 

Make an alias to the actual Media folder in its shared network location and place that in iTunes default location with the default name. If iTunes launches and cannot immediately find the media files because the share hasn't been mounted, it will try to revert to the default, but find the alias and follow where that points which I think will in fact mount the necessary volume.

 

I'm pretty sure that's how I used to do it, but it's some years ago now and Apple may well have found a way to ensure that no longer works as they seem to have a habit of making life difficult for users.

Link to comment

 

One of the features of such a configuration is that multiple users can then share the same media files by all pointing iTunes to the network shared storage. But I've been wondering about something.

 

Whichever of the 2 paths proposed by Kirk that you undertake, i.e. either the entire iTunes folder or just the Media folder is on the share, it WILL share the 'Automatically Add to iTunes' folder. This is of course being monitored by iTunes for any new files and it promptly grabs and imports them. But when this folder is actually being simultaneously shared, potentially by several clients, which one gets the new files?

 

Maybe iTunes is clever and ceases to monitor the folder if it is located on a potentially shared network location. Otherwise is it just a lottery as to which instance of iTunes gets each added file or what?

 

The obvious solution would be to locate that folder in the iTunes folder, above the Media folder and share the Media folder but keep the rest local (a better solution anyway IMO), but typically, there is no control over the location of any of iTunes folders, apart from either of the 2 aforementioned options and both of those give rise to this issue about the 'Automatically Add to iTunes' folder.

 

Anyone know the answer to this. What happens when that folder is actually shared between more than one running instance of iTunes?

Link to comment
Make an alias to the actual Media folder in its shared network location and place that in iTunes default location with the default name. If iTunes launches and cannot immediately find the media files because the share hasn't been mounted, it will try to revert to the default, but find the alias and follow where that points which I think will in fact mount the necessary volume.

 

I'm pretty sure that's how I used to do it, but it's some years ago now and Apple may well have found a way to ensure that no longer works as they seem to have a habit of making life difficult for users.

 

I wouldn't count on that always working with network volumes.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment
One of the features of such a configuration is that multiple users can then share the same media files by all pointing iTunes to the network shared storage. But I've been wondering about something.

 

Whichever of the 2 paths proposed by Kirk that you undertake, i.e. either the entire iTunes folder or just the Media folder is on the share, it WILL share the 'Automatically Add to iTunes' folder. This is of course being monitored by iTunes for any new files and it promptly grabs and imports them. But when this folder is actually being simultaneously shared, potentially by several clients, which one gets the new files?

 

Maybe iTunes is clever and ceases to monitor the folder if it is located on a potentially shared network location. Otherwise is it just a lottery as to which instance of iTunes gets each added file or what?

 

The obvious solution would be to locate that folder in the iTunes folder, above the Media folder and share the Media folder but keep the rest local (a better solution anyway IMO), but typically, there is no control over the location of any of iTunes folders, apart from either of the 2 aforementioned options and both of those give rise to this issue about the 'Automatically Add to iTunes' folder.

 

Anyone know the answer to this. What happens when that folder is actually shared between more than one running instance of iTunes?

 

You're thinking that you can share it with aliases, or with symlinks? I'm not sure that's a Good Idea. I can imagine only Bad Things happening.

 

Now, you say that multiple users can share the same media. This is true, and this is quite simple, but it's file sharing, not iTunes library sharing. You'll be able to access the media files on different computers, but each user will be responsible for adding them to their libraries. And if you do so via the Automatically Add to iTunes folder, I think that could mess things up, potentially moving them to where other users wouldn't be able to use them. And, of course, no user can change any tags, because that will screw up other iTunes libraries.

 

There's no safe workaround to having multiple users share the same media files. The best way is to create a master library and use Home Sharing.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment
You're thinking that you can share it with aliases, or with symlinks? I'm not sure that's a Good Idea. I can imagine only Bad Things happening.

 

If the entire iTunes folder is placed in the shared location (e.g. NAS), that means the AAtiT folder is being shared and as you say, I can't imagine it playing nicely. But has anyone tried this? I don't want to actually do this, but was intrigued as to what would occur if you did. It could just be deleted, but doesn't iTunes then simply re-create it when starting?

 

If you're not going to share the media content, why use a NAS? A big locally attached drive has to be easier and simpler.

 

Now, you say that multiple users can share the same media. This is true, and this is quite simple, but it's file sharing, not iTunes library sharing. You'll be able to access the media files on different computers, but each user will be responsible for adding them to their libraries. And if you do so via the Automatically Add to iTunes folder, I think that could mess things up, potentially moving them to where other users wouldn't be able to use them. And, of course, no user can change any tags, because that will screw up other iTunes libraries.

 

There's no safe workaround to having multiple users share the same media files. The best way is to create a master library and use Home Sharing.

 

Yes I understand the difference between file sharing a iTunes sharing and Home Sharing is the best way for other users to access the content, agreed, far better than the original library sharing which didn't even provide album artwork, nor any ability to change any listing sort order as far as I can remember. But to have a single master library on a server means that I have to do everything on the server and that (currently) doesn't even have a CD/DVD device from which to rip new media. So I have to do that on my Mac (Pro) which is in any case how I want to control everything.

 

The ideal is an impossibility with the current iTunes and Apple's way of thinking, so my plan is to use my Mac to do everything, but to replicate that onto the server as the master library for anyone else, TVs etc to share from. But the best way to keep my Mac and the server in sync is the tricky part. I cover it in more details in the other thread I started about iTunes server and sharing.

Link to comment

Another quick question:-

 

Can anyone suggest the best way to MOVE a complete iTunes library, i.e. just to a different location within the same file system?

 

I know I can change the path to the Media folder in prefs and then Consolidate, but that always copies the files. This is stupid when it's a huge library and just needs moving to a different location within the same file system which would make it very quick as no files would actually be moved anywhere. Not only that, but there is no room on the disc to duplicate everything. Currently there's about 800 GB on a 1 TB HD so there's no way it can possibly be copied even if I were to wait all that unnecessary time.

 

I can try to fudge it by fooling iTunes with aliases etc. but surely there must be a decent way to get iTunes to simply accept the new location, MOVE the files and update their location in the library file?

Link to comment

Re the Automatically Add to iTunes folder; this is most likely a sort of folder action, so macOS will funnel the files to the local library.

 

Re the NAS: some people want to do this for libraries they manage on laptops. I agree; there's no point in using a NAS with a desktop computer. These days, I'd just use a self-powered USB3 drive. I have a few of them that hold 4 TB.

 

As for the final point, as I said above, you can rip on one Mac, and add them to the library on the other Mac (or server). It's probably easier in the long run, since tagging locally is a lot simpler than via screen sharing.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment

I'd do this. Create the new target folder, and choose it in the iTunes preferences. Quit iTunes, move the files to the target folder, then launch iTunes. It should immediately find all the files. You might need to consolidate just in case afterwards. (I have done this in the past, and it has worked, but it's been quite a while, so I'm no exactly sure how iTunes would handle that now.)

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment
I'd do this. Create the new target folder, and choose it in the iTunes preferences. Quit iTunes, move the files to the target folder, then launch iTunes. It should immediately find all the files. You might need to consolidate just in case afterwards. (I have done this in the past, and it has worked, but it's been quite a while, so I'm no exactly sure how iTunes would handle that now.)

 

Yes I've done this in the past too, but some years ago and it's a big vague now, besides which iTunes may longer behave in the same way.

 

Today I had an issue with some podcasts that iTunes had placed in the iTunes/Media/Downloads folder, maybe because I was sharing the Podcasts folder at the time and so it couldn't place them in that normal folder. Who knows. Anyway, I simply UNchecked 'Keep folder organised' in iTunes prefs and closed the prefs window. Opened again and checked that option and closed the window again. It then started running through all the files. At least it seemed that way as it took a while and filenames were flashing up in the small dialog at the usual unreadable rate. Certainly it was more than just the dozen or so podcasts that were out of place. When it had finished, the podcasts had been correctly placed. Maybe when checking that option it simply looks to see what needs moving and then does move rather that as Consolidate which copies.

 

But I'm sure in the past it simply found the files in the new place. Does the library file store a reference to the file, so it would still know the files even if they've been moved? That's what I previously surmised.

Link to comment

I seem to recall a few years ago that something changed, that you could find one missing file, and iTunes would correct a lot of others. I haven't tested that in a while, but it's possible that updating the location of one file might propagate to others. You could probably test by manually moving a bunch of files, then finding one, then seeing what happens.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment

Well after a bit of messing about, my local iTunes was happily using the content from its new location, without anything being copied, just moved and every file location in iTunes seems to be pointing at the correct folder and the new location of the media folder is specified in the prefs. So far, so good. I also have an exact copy of this Media folder on the server and which I now NFS shared (using the /etc/exports file). With iTunes off I renamed the local Media folder and created a new empty Media folder, onto which I mounted the share from the server. When iTunes started it simply accepted those shared files as they all have the same path and it will play any selected music or video. But all is not well.

 

I can edit the name of a Home Video and the name of the file (on the server of course) is changed as you'd expect. But if I change the name of a music file, the filename is not updated, although the file IS. The actual tag data is updated as is the time stamp of the file, so the new track name IS being saved, but iTunes does not update the filename to suit. I changed a Music Video to a Home Video and it moved the file into the Home Videos Folder and any changes to the name means iTunes updates the tag and the filename. But If I change the type back to Music Video, iTunes edits the file, but does NOT move it back to the Music folder. It is now stuck in the Home Videos folder.

 

So for some reason, the Home Videos folder works fine and any file in the Music folder can be updated, but iTunes cannot change the name of a music file, nor can it add a file into that folder.

 

I've studied the permissions on the server and how they appear locally. All the folders are 775 and all the files are 664. Everything is owned and group 'jukebox' which is the name of the user on the server and also its main group of which I am also a member, all of which is identical on my local Mac and the server (same UIDs and GID to make sharing simpler, Ha). The only difference I can determine is that Music files reside 2 folder levels lower than Home Video files as Music files are under the Artist and Album folders whereas Home Video are not. But since all ownerships and permissions are identical, I cannot se why this should make a difference.

 

It has occurred to me that this may be the same problem as when I individually shared and mounted the media folders I wanted to share. At first I didn't notice any problem, then assumed iTunes simply didn't like those media folders being network shares, but now I wonder if it is in fact the same problem when I share and mount the entire Media folder. In any case, can anyone suggest any possible reasons why iTunes is behaving like this? There must be many users sharing their Media folder on a NAS drive, does that work completely and correctly? In which case why is mine not doing so? Or are there always such problems, but because iTunes masks them, no-one has noticed?

 

If you are sharing the Media folder across the network, can you edit the name of a music track and the file name changes to suit? If not, what about Home Videos?

 

I have certainly shared iTunes' Media folder in the past, but not for some years and in the meantime there have been many revisions of iTunes. Perhaps later versions have this problem? Or can anyone spot the flaw in my setup?

Link to comment

Done some more testing and iTunes seems to be very inconsistent. Home Videos, Movies, Podcasts and TV Shows all seem to work fine. I can update any metadata and the file is updated and the name changed as required. But AudioBooks and Music do not. The files seem to have their metadata (tags) updated, but the filename is never changed and new files of those types cannot be added. I can see no reason whatsoever why there should be this difference. Is it iTunes?

 

In fact it has confused me even further. The server had some Movies stored and although the files are now available to my local iTunes, they're not yet in the library. So I tested one and then selected Add to Library from the whole folder. Which they were, but instead of each movie file in its own folder, all the movie files are now together in the Movies folder. This does make more sense to me as they don't need their own folder, but how come they were previously in their own folder, but now are not? Has iTunes changed and keeps whatever structure already existed, but given the chance it will simplify the Movies folder. I checked another Mac and iTunes is definitely keeping each movie file in its own folder. Is this simply a change in iTunes behaviour?

 

I also saw something similar when I was moving the library. The first stage resulted in all media types using the Media folder instead of their own sub folder. So all Artists' folders were in the Media folder and there was no Music folder, even though the prefs were set to 'Keep Media Folder Organised'. So I then selected File/Organise Library and it whizzed away and put everything in the right media type sub folders. The point is the 'whizz'. Took only a few minutes (or less) to re-organise all 25,000 files (only had to move them after all).

 

Anyway, back to the Movies folder structure and I thought to try 'Organise Library' again which might re-create the Movies folder as it has always been with a folder for each file. This process started to run, at about 2 seconds per file. I let it run for a while to see if it would speed up at all, which it didn't. Apple hadn't thought this through and there's no way to stop it. So rather than wait years for it to finish, I had to Force Quit iTunes. I restarted it and tried again, but the same excruciatingly slow progress and had to Force Quit again.

 

So has anyone else found that iTunes now places movie files directly in the Movies folder? Also, has anyone any suggestions as to why a super speedy process earlier today will now only run like a snail?

 

Actually, I've just thought. iTunes is now dealing with the files across the network, whereas this morning they were local. But this is a Gigabit network and stuff is mostly really fast and there's no reason why iTunes speed for this process would drop by a factor of hundreds, if not thousands. Any bright ideas?

Link to comment

As to the permissions problem, it's, well, a permissions problem. I've never been very good with those.

 

As for the second, I'd guess that the speed issue is because it's over a network. It's very slow; just because it's "gigabit" don't think it's anywhere near the speed of local. It's not just the file copy speed that slows it down, it's everything that prepares to copy a file.

 

As for the Movies folder, I really don't know. All of mine are in their own folders.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment

I've been dealing with unix permissions since well before Apple ever got hold of them and I'm generally pretty comfortable with them. The problem is that Apple, as with many things it appears, tends to ignore the accepted standards and does 'its own thing' which may or may not be consistent with any standards. In this case, the most obvious puzzle is that all the perms are identical on all files and folders, but iTunes behaves differently with different folders. I can only deduce from this that Apple is again 'doing its own thing' and not abiding by any standards.

 

So at this point I am giving up completely with any sharing. Apple has me beat on this and I can find no way to make iTunes play nice with its data storage. I am now reverting to a duplicated/sync'd system as I've been using for the last few years since I failed in my previous attempts to crack this. So I'll deal with everything locally on my Mac and rsync it to the server as and when I manually decide. But I will make it simpler by writing a decent script to do all the sync'ing and place it in iTunes Scripts menu for easy access. Not ideal, but at least I know it DOES work as it avoids any iTunes peculiarities.

 

However there are still some 'difficulties' that needs to be addressed if the intention is to sync the library file (the simplest way to update the server with new and changed content):-

 

Mobile Applications are NOT required or even wanted on the server. So I'll exclude them from the sync and although the server will have a reference to them in its library file, they'll simply be missing. Since I'll never bother to look at them on the server this is not a biggie, but it's irritating that in iTunes one cannot specify what to share and what not to share. So anyone looking at the server's (Home) shared library will be able to see the list of Mobile Apps, even if they are not really there. In fact as far as I can tell, the client has no way to control what they see in any Home Shared library. One can adjust what is shown in the menu on the local machine, but you cannot similarly eliminate items from the menu when you've viewing a remote iTunes library via Home Sharing. If I'm wrong, please correct me, but in any case it's an irritation and not a show stopper.

 

The reverse is true for Movies which I want solely on the server. So in this case I have automounted the server's Media/Movies folder on my Mac. In this way I will be able to view the movies and my library will always be the up to date version to be sync'd to the server, which will of course be looking at the same Movies folder. I'm not concerned about the security of duplicating this content on both machines at this time. They will all be backed up on the server itself anyway and I don't want to waste the disc space on my Mac when I don't actually need to access them locally. I tag the movie files on my Mac when I first obtain/rip them and use the server's 'Automatically Add to iTunes' folder to add them on the server, although now I might be able to do that locally. Subsequently I never need to edit them, or access them in any way on my Mac. Sharing the folder like this just enables me to keep my library up to date. In fact though, my previous tests showed that shared Movies can be edited by the local iTunes, but this is not actually required. If I add them directly on the server, I will however have to add them to my local iTunes once the server has any new movies. 'Add to Library' ought to handle that, even if it means the movies are in the Movies folder and not each in their own sub folder. Whichever way iTunes decides to do it, doesn't really matter.

 

Finally then, after much messing around and wasting of time, I'm pretty much going back to where I was a couple of weeks ago as iTunes is clearly designed to prevent one from sharing in any way, apart from their own Home Sharing. Thanks Apple. Time to once again start looking at creating my own Media Server solution. Don't hold your breath though. ;)

Link to comment

Mobile applications: yes, you'll still see them from another Mac and I assume that if you try to copy one, you'll get an error.

 

Movies are more problematic, especially because the amount of storage they use. So you ideally don't want to keep them on both machines. There are, perhaps, two ways to deal with this. If you have non-iTunes Store movies, perhaps don't use iTunes. I use Plex for my videos, and it's light years better than iTunes. If you have a lot of iTunes Store purchases, and your bandwidth is sufficient, you may not even need to keep them, since you can play them from the cloud.

 

But, yes, Apple doesn't want iTunes sharing to work easily. Home Sharing is good for limited uses, but they still realize that many people really do want an iTunes server.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment
  • 1 month later...
Yes, there are two ways to do it. I tend to prefer not copying the library files (which is what happens when you do the above). But if you do it, then you are protected from iTunes reverting the media folder location.

 

However, make sure you don't have two people trying to access it at the same time. And it's a good idea to back up the library files often (that's the main reason I don't think it's a good idea; it's harder to back those files up.)

 

Kirk, could you elaborate on what you mean by it's harder to back up library files? I'm trying to decide which approach to follow, moving the entire iTunes folder or just the media files.

Link to comment

On my Mac, I use Time Machine, which backs up files every hour. You can't do that on a NAS, so you won't get as many backups in case something goes wrong. You also need to ensure that you get multiple backups of the library file, with lots of versions, in case you need to revert to a library file that's days, even weeks older.

I write about Macs, music, and more at Kirkville.

Author of Take Control of macOS Media Apps

Co-host of The Next Track podcast.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...