Jump to content

Emby doesn't see media after move to ext4 drive


jiibus
Go to solution Solved by Q-Droid,

Recommended Posts

jiibus

When I first set emby up, it was on Linux, but the media was on drives with NTFS partitions. No issues to speak of. Today I decided to convert my drives to ext4 since I have no need for Windows to access them.

 

Well after copying the files, deleting then recreating the partition in ext4 and copying the files back, Emby is no longer scanning my files. I deleted then re-added my Movie library, but nothing. Nothing is popping out at me in the logs. The permissions on the folder are 777.

 

Any advice?

emby.log

Edited by jiibus
Link to comment
Share on other sites

Q-Droid

Did you use the correct mount options, ownership and permissions on the new filsystem?

 

Your log is full of these errors:

System.IO.IOException: System.IO.IOException: Read-only file system
Link to comment
Share on other sites

jiibus

I just used "defaults" for mount options, set the Movies folder permissions to 777 and chown'd it to my user and emby group.

 

 

Link to comment
Share on other sites

Q-Droid

What is the output of the command "mount" for this new filesystem?

 

The easiest way to sort out the permissions is to do so as the emby user.

sudo su - emby -s /bin/bash

Then cd to the media directories (Movies?) and subdirectories and try to create a dummy file: touch dummy

 

If you can't cd down the path then the directories don't have the right permissions. If you can't create the dummy file then the current directory doesn't have the right ownership and/or permissions.

Link to comment
Share on other sites

jiibus

So yea, I cannot traverse as the emby user into the Movies folder. I have my Movie disk mounted in my home directory at /home/jiibus/Disks/Movies. This is a ls -al of ~/Disks

ll
total 16
drwxr-xr-x   4 jiibus emby   4096 Apr 25 21:34 .
drwxr-xr-x  53 jiibus jiibus 4096 Apr 26 09:53 ..
drwxrwxrw-+ 30 jiibus emby   4096 Feb 20  2019 Movies
drwxrwxrwx   1 root   root   4096 Apr 25 23:07 TV

I ran "sudo setfacl -m user:emby:rw /home/jiibus/Disks/Movies" as well. What else could I do?

Link to comment
Share on other sites

Q-Droid

Directories need 'r-x' permissions for access. Setfacl as you have it will do this for user emby, however it only does it for the "Movies" directory. If jiibus owns the media under that directory then emby will run into the same issue when you add content.

 

If you want emby to have persistent access as you add content you can set a default ACL for the emby group.

 

setfacl -R -m d:g:emby:rwX,g:emby:rwX /home/jiibus/Disks/Movies

 

However, if you want to do it for the emby user then:

 

setfacl -R -m d:u:emby:rwX,u:emby:rwX /home/jiibus/Disks/Movies

 

The above will recursively create ACLs for emby group (or user) and default ACLs for newly added files and directories to allow the emby group (or user) 'rw-' on files and 'rwx' on directories. Only files that already have 'x' will get that permission, files without 'x' will not.

Edited by Q-Droid
Link to comment
Share on other sites

Q-Droid

Seems like converting the partition back to NTFS would be simpler, would it not?

 

Maybe, but I wouldn't...

 

What is the output of:

id emby

getfacl /home/jiibus/Disks/Movies

mount (just the output for for /home/jiibus/Disks/Movies)

Link to comment
Share on other sites

jiibus
id emby
uid=963(emby) gid=963(emby) groups=963(emby)
getfacl /home/jiibus/Disks/Movies
getfacl: Removing leading '/' from absolute path names
# file: home/jiibus/Disks/Movies
# owner: jiibus
# group: 64552
user::rwx
user:emby:rw-
user:64552:rw-
group::rwx
group:64552:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:64552:rwx
default:mask::rwx
default:other::r-x
mount | grep Movies
/dev/sdb1 on /home/jiibus/Disks/Movies type ext4 (rw,relatime,x-gvfs-show)

 

 

Link to comment
Share on other sites

  • Solution
Q-Droid

The mount looks good.

 

The output for getfacl does not reflect what you ran.

 

The emby user is still not allowed per the ACL: user:emby:rw-

 

Something is not right about the emby group. The gid for emby shows 963 but getfacl shows 64552 for what Is displays as emby. There is also a uid 64552 for some reason.

 

What I would do, not saying you have to, is clear the ACLs to reset things for Movies. I don't know what other dependencies you have for other things that might be using ACLs in there.

setfacl -R -b /home/jiibus/Disks/Movies

 

Then add 'x' to the Movies directory.

chmod +x Movies

 

The emby user should at least be able to cd into Movies now.

 

Check to see what gid and/or uid 64552 are.

grep 64552 /etc/group

grep 64552 /etc/passwd

 

And verify the uid/gid for emby.

grep emby /etc/group

grep emby /etc/passwd

  • Like 1
Link to comment
Share on other sites

Q-Droid

After doing the above you can decide if you want to try ACLs again or manually add access to the subdirectories for the emby user.

 

Or if you want to go back to NTFS.

Link to comment
Share on other sites

jiibus

Reseting the ACL and chmod +x fixed it, thanks much! I'll re-apply the ACL to ensure Emby can see any new media in the future. Didn't realize execute permissions were necessary for Emby to read a file.

 

I suspect 64552 is left over from my Jellyfin install, trying to see if I had success with it reading my files.

 

I will also convert my TV drive to ext4, so to be sure I do it the correct way... After wiping then creating the partition as ext4 I should:

  1. Mount with defaults
  2. chown it to jiibus:emby
  3. Set permissions to 777
  4. sudo setfacl -R -m d:g:emby:rwX,g:emby:rwX /home/jiibus/Disks/TV

Is that it?

Edited by jiibus
Link to comment
Share on other sites

Q-Droid

Execute is needed for directories, not files. Don't arbitrarily add execute to files. The upper X is a filter to effect changes to directories but leave files unchanged.

Link to comment
Share on other sites

Q-Droid

I will also convert my TV drive to ext4, so to be sure I do it the correct way... After wiping then creating the partition as ext4 I should:

  1. Mount with defaults
  2. chown it to jiibus:emby
  3. Set permissions to 777
  4. sudo setfacl -R -m d:g:emby:rwX,g:emby:rwX /home/jiibus/Disks/TV

Is that it?

 

If the above worked for Movies then yes, any new media mounts/directories can be handled the same way.

Link to comment
Share on other sites

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...