[mythtv-users] Shared filesystem that looks different to different machines

Russell Gower mythtv at thegowers.me.uk
Wed Jun 4 15:50:05 UTC 2014


On 4 Jun 2014, at 15:53, Joseph Fry <joe at thefrys.com> wrote:

> Sounds like a weird question, so let me elucidate!
> 
> On my mythtv box, I have a directory which contains all my ripped
> CDs. This is shared via nfs and samba so that all other machines
> (there's windows and linux clients) in the network can access them
> to play music. Let's call this /myth/music.
> 
> The issue is that when this area is shared with iTunes, iTunes
> insists on putting the downloaded podcasts in /myth/music/Podcasts.
> There is no configuration for the podcasts location, it always puts
> it at one level below your music. This is fine for a single user.
> 
> The problem comes when several people want to use iTunes to access
> the music and load their own podcasts, because the podcasts area is
> also shared via the same location for all users.
> 
> Therefore I need everyone to access /myth/music as a shared area,
> but everyone needs to be able to access /myth/music/Podcasts as a
> different area to all the other users.
> 
> I've tried Googling this, but not come up with the right combination
> of vague words to find a solution here.
> 
> The only way I've thought of to work round this so far is to maybe
> create /myth/music/Podcasts as a symbolic link to /local/Podcasts,
> which is outside of /myth/music, and then share /myth/music out to
> different Linux boxes, and each user obtains /myth/music from a
> different server, all of which have a different /local/Podcasts.
> This sounds like it should work, but I haven't tried it yet.
> 
> I don't want to duplicate the music - there's over 15,000 tracks in
> there, and the collection is not fully online yet! This would be a
> major waste of disk.
> 
> Can anyone think of any other way of doing this so that each user
> can share a single copy of the music and have a local copy of
> podcasts, given the invariance in the iTunes setup for the location
> of the podcasts?
>  
> You could just a set of shares for the podcasts, then on each machine mount the normal music share at /myth/music and /myth/music/Podcasts could be the users individual share of podcasts.
> 
> Alternatively you might be able to do something creating with autofs, but its probably more trouble than its worth for a small setup, especially when its probably going to be fairly static.
> 
> 
> This is immediately what I though too.  
> 
> On server:
> Create an export for /myth/music, 
> Create /myth/podcast-bob and /myth/podcast-jane directories and exports.  
> 
> On Bob's client:
> create /home/bob/music folder
> mount /myth/music to /home/bob/music
> mount /myth/podcast-bob, /home/bob/music/Podcast as desired.
> 
> I don't believe that NFS would have any issue with nesting a mount inside another mount like this, after all the OS just treats it as another filesystem and every linux system I have ever seen does this (/dev, /proc, etc).
> 
> The one caveat would be that on the server, the data doesn't have the proper structure.  This can be easily remedied by storing your data elsewhere and mounting the folders to the appropriate location.  For example: store your data in /home/shared/music, /home/shared/podcast-bob, and /home/shared/podcast-jane.  Then on the server you can use normal folder mounts, not NFS, to mount /home/shared/music to /myth/music and /home/shared/podcast-bob to /myth/music/Podcasts.
> 

The OP mentions iTunes, which implies either Mac or Windows clients, whilst the above would work for Mac clients it’ not going to work for Windows clients.

I’d approach it like this, 
  1. configure samba to share users home directories
  2. under each users home directory create a private/podcast directory structure
  3. create a combined view of private/podcast and /myth/music called music within each users home directory using aufs
    mount -t aufs -o br=/myth/music:/home/user1/private none /home/user1/music/
    mount -t aufs -o br=/myth/music:/home/user2/private none /home/user2/music/
   (repeat for each user)

this should (I’ve not actually tested it) create 
	/home/user1/music/* - all the files from /myth/music
       /home/user1/music/podcast - this users private/podcast directory

Now this isn’t going to scale very well for a large number of users but it should be fine for a dozen or two.

One thing to note is that I don’t believe iTunes likes to share it’s library, when I tried between my two Mac’s using NFS if I opened two clients at once it corrupted it’s database files.

Regards
  Russell


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140604/7bd30894/attachment.html>


More information about the mythtv-users mailing list