iTunes + iPod + Shared Disks: Managing A Large, Shared Library
By jtb on Jul 11, 2007
Most folks that have Macs own a notebook version. If you have a significant music / video library, you won't have the disk space on your notebook. This is one thing I never understood about iTunes. Any significant music collection is going to swamp the notebook's disk. The defaults are all set to store the library on the local disk, and to actually make copies of files you add to the library in the iTunes folder. For the latter, if you don't actually understand what's going on, you could wind up with multiple copies of files hanging around.
Another point is that most people want to share their library between users in their household. I think there's a way to share your iTunes library from your Mac (I've never tried it), but that assumes that any consumer of the media is also using iTunes. iTunes is not a general purpose media player. I have a lot of formats it won't consume, so I use other players like VLC in some cases.
After being an early adopter of several different types of digital audio players, the iPod model was a hard pill to swallow. The basic approach is the iPod is a read-only device to everything except iTunes, and who's format and content is completely managed by iTunes. There's only one reason the iPod works this way: control. Apple can force you to go through iTunes, which is as much a storefront as anything else, to manage your library. The iPod could easily have been a standard USB mass storage device, and allow files to dragged and dropped onto it. But then you wouldn't be forced through iTunes, and the iTunes Store. To be fair, this would require more logic on the iPod to index the library, which might have been a technically harder problem. Also, the iPod only plays AAC format, so even if you import MP3 files into your iTunes library, they are converted to AAC before they are copied to the iPod. Again, this allows the iPod to be simpler in that it doesn't need to understand anything other than AAC. It can rely on iTunes for that. This probably makes importing music slower, but that is not an everyday thing for most people. The only good thing here is that iTunes hides this detail from you.
Unfortunately, the iPod model is used by most other digital audio manufacturers (there are a few exceptions). The difference is that for them, the software is not iTunes, it's Windows Media Player. So when I was faces with the choice of purchasing on oddball brand that supports USB mass storage, a player that requires Windows, or an iPod, I chose the lesser of the three evils.
But anyway, back to the problems of disk space and sharing media. This is my best solution ...
To get around the limited disk space / sharing problem, the actual content of my library is stored on a large shared disk. I use a neat little NAS device which is essentially a drive enclosure that runs a slimmed down version of Linux with the purpose of running an SMB and FTP server (only, that's all it does). This particular device has been pretty darn stable for me. I chose it because it's an enclosure, not a sealed unit already containing a drive. This allowed me to buy a cheap 500GB drive and keep the cost down. The only drawback is that it is an ATA-100 interface, not SATA. You'd think this would be an advantage. ATA-100 is older, and the drives should be cheaper. However, it's so old that the drives are getting hard to find and they are about the same price. SATA is much faster, but that doesn't matter as ATA-100 is very much fast enough to keep up with either the USB or network interfaces to the drive.
A drawback of "all on the shared disk" is that the library doesn't leave the house with you. It not on your notebook. Well, that's why I carry the iPod around with me.
With the NAS, I can mount the SMB drive on any computer in the house and access the media in any way I want. For example, an integral part of my "media center" is an older Windows PC connected to my "TV" and some cheap computer speakers. I use this to play music and video .avi, .mpg, streamed content from the internet, etc., movies. Of course the PC plays DVDs also so I could throw out my DVD player too. The PC just mounts the shared disk and plays the files from there. You don't need a powerful, "media PC" for this, and it doesn't have to be a high-tech expensive solution. Just about any PC manufactured in the last 6 years can play DVDs, .mp3s, and .avi files. It's a PC simply because I had one lying around. It could also be an Mac Mini.
As a side note, I purchased a nifty wireless keyboard for the PC. I set the fonts big, and I can sit on my couch and control everything. Very nice, even if the keyboard makes a rather large remote. This model is pretty small, and has a built in trackball mouse so the keyboard and mouse are one single unit. It's worked flawlessly, although you wouldn't want to do a lot of work with it as it's small and the trackball isn't the best. FYI, if you're looking at wireless keyboards, there are models w/ a range of "up to 10 feet" then there's the "up to 50 feet" models. Get the latter, even if you're within 10 feet of your media center, they get flaky at 3-5 feet.
For iTunes, I mount the drive via SMB and import the media from the shared drive. This must be slower, but I don't know how much because I've never done it any other way. I imagine it's a lot slower, as in this case it is accessing the shared drive over a wireless connection. Anyway, with about 20G on the iPod, it take about 5 minutes to do a no-op sync operation from iTunes. That's okay by me, as I can just connect it and walk away, and it's always done by the time the iPod is charged anyway.
One problem I ran into recently ... the shared drive is just a DHCP client, so it can potentially get any of the IP addresses in the block that is made available on my router. I could go into the router and force it to assign a particular IP address to the NAS each time, but the problem with that is I've needed to "reset" my router several times which makes it lose this type of configuration, and it's a pain in the arse to configure, so I just don't like to add any complex config to it.
So the other day, I needed to reboot the router. My NAS picked up a different IP, which was a different automount point (I am automounting the NAS SMB point). iTunes could no longer resolve any of my library. Neat. There is no way to fix this through iTunes itself, except by "locating" each individual file. There are no utilities I could find to do it either.
In retrospect, I should have created a symlink to the mount point, and then imported from that location. Then if the IP of the NAS changes, I can just change the link. I did this now, but I didn't think of that initially.
As it turns out, it's pretty easy to muck w/ the iTunes library. There's a binary formatted version, but there's also a XML backup. To solve this, I sed'd the XML library file and changed the "location" of all of the media to the symlink.
sed -e "s#file://localhost/private/Network/Servers/192.168.0.10/PUBLIC#file://localhost/Users/jtb/mnt/PUBLIC#g" "iTunes Music Library.xml" > ../new.xml
(Noticed that I used a different separator in the sed expression to avoid escaping all of the /'s)
Then I removed all of the iTunes files, restarted iTunes, and did a File->Import Library operation on the new XML library I created. This took a long time to re-import everything and calculate "gapless playback" (whatever) but it seems to have worked.
One think that stuck for for a while was the "location" in the XML library. It's a file:// URL, so I originally tried ...
file://Users/jtb/mnt/PUBLIC (this is my symlink to /Network/Servers/...)
As it turns out, iTunes wants a HOST NAME in the FILE URL, like this:
Not what you'd expect.
Of course, the key to using iTunes this way is to set your preferences to NOT copy files, and NOT rename them (see Preferences->Adavanced). Basically, tell iTunes to leave the media files alone and just use them from their original imported location.