mergerfs icon indicating copy to clipboard operation
mergerfs copied to clipboard

Permissions issue when using jellyfin with mergerFS

Open Suitear opened this issue 3 years ago • 2 comments

Any clue on how to make jellyfin work under mergerFS?

Describe the bug

When I attempt to launch jellyfin on Ubuntu 20.04 while mounting volumes located at a mergerFS pool, I could get jellyfin scan the media folder.

To Reproduce

  1. Set up jellyfin with regular filesystem
  2. Create mergerfs pool at /home/user where ALL my media is located in /home/user/rtorrent/download. I have 4 hard drivers (/dev/sdb, dev/sdc, dev/sdd, dev/sde). And I use mergerfs to merge them into a 44TB pool. image and My mergerfs option is as follows. /mnt/sd* /home/user fuse.mergerfs defaults,nonempty,allow_other,use_ino,minfreespace=150G,ignorepponrename=true,cache.files=partial,dropcacheonclose=true,category.create=mfs,fsname=mergerfs 0 0
  3. Add jellyfin to user group and sudo setfacl -R -m u:jellyfin:rx /home/user/rtorrent/download to make sure jellyfin has the right permission.

but jellyfin can't scan the media folder (/home/user/rtorrent/download) at all. every time I tried to add /home/user/rtorrent/download to jellyfin, it got blank. image

I can only add the folders one by one like this into jellyfin, then it can scan and add them to the library.

/mnt/sdb/rtorrent/download /mnt/sdc/rtorrent/download /mnt/sdd/rtorrent/download /mnt/sde/rtorrent/download

any clude to fix this? Thanks.

Suitear avatar Feb 01 '22 10:02 Suitear

Are you saying that as the jellyfin user you're unable to access the directory? And you're using extended ACLs rather than regular POSIX ACLs?

  1. Do you really need to use extended acls? It is more expensive than regular acls due to using xattrs.
  2. Did you try with posix_acl=true?

From the docs: posix_acl=BOOL: Enable POSIX ACL support (if supported by kernel and underlying filesystem). (default: false)

trapexit avatar Feb 01 '22 12:02 trapexit

As a note I ran into some time ago, mergerfs caches supplemental users/groups. "if a user is added to a group it may not be picked up without the restart of mergerfs." It looks like you're adding the ACL, so I'd look to @trapexit 's answer but just in case you're using supplementary groups, watch that quirk.

See Supplemental user groups in the docs.

michaelkrieger avatar Aug 02 '22 18:08 michaelkrieger