Jump to content


Photo

File permissions again

permissions linux ubuntu ntfs

  • Please log in to reply
23 replies to this topic

#1 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 28 October 2016 - 10:16 PM

Failure setting up Emby (my first time)

 

I have a hard drive in my 'server' that contains all my media.

It is formatted as NTFS.

I have it mounted from the fstab.

 

listing of files/directories show as ...

-rwxr-xr-x 1 bric bric  110914782 Jun 16 21:11 Finding Dory-trailer.mov
drwxr-xr-x 1 bric bric       4096 Jul 30 15:09 Home Video

I added emby to the group owning the files on that drive. So the groups command returns:

emby: emby bric

 

When I try to add the media library (in the web interface) either with

/path/to/mounted/drive/Movies

or

//192.168.0.10/Movies

or

//MyServer/Movies

 

I get this error:

 

 

There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.

 

More info needed? Suggestions about what to try next?



#2 puithove OFFLINE  

puithove

    Advanced Member

  • Alpha Testers
  • 716 posts
  • Local time: 09:22 PM

Posted 29 October 2016 - 06:59 AM

The permissions on the file and directory you listed are not group writeable.  Add the emby user to the bric group does not help you.  The emby user does not have permission to write.

 

Linux permissions are like:

Owner (User) / group / world (everyone else)

         rwx        /   r-x    /   r-x

 

This means your bric user has read,write,execute - your bric group has read,execute - everyone else has read,execute.


Edited by puithove, 29 October 2016 - 07:10 AM.


#3 puithove OFFLINE  

puithove

    Advanced Member

  • Alpha Testers
  • 716 posts
  • Local time: 09:22 PM

Posted 29 October 2016 - 07:05 AM

As for what to do, personally, I'd move the data to a linux filesystem and set the permissions properly.

 

If you have a good reason to leave it as NTFS, you have options to set the permissions on the mount.  You didn't mention how you're mounting it, but if you're using NTFS-3g, here's a doc on it which includes setting the permissions via the mount:  https://wiki.archlin...dex.php/NTFS-3G



#4 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 11:18 AM

On the web admin page (http://localhost:8096/web/library.html) where you add the 'media library' it has a note at the top which says,

For Linux on Arch Linux, CentOS, Debian, Fedora, OpenSuse, or Ubuntu, you must grant the Emby system user at least read access to your storage locations.

 

So I wasn't expecting my permissions to be a problem until I got that error. I have a generally okay understanding of permissions in Linux. But I tried your suggestion and set permissions to 777 in the fstab.

 

Side note: Since the entire drive is media only, the 'problem' of the filesystem being NTFS is a lesser one yes? Although, I confess, even setting it as I originally had it felt a bit 'open'.  However, I agree... I sort of wish I had gone with ext4 or ZFS.  At the time, I wasn't able to predict the number of linux based devices joining the household.

 

After reboot and permissions now showing as drwxrwxrwx (or -rwxrwxrwx) everywhere on that drive I went to add the media library again.

 

And the error message is the same.

 

 

There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.

 

And then I realized that I'm a big liar! Although, that has been media only for years, I recently moved my home directory to that drive (thinking that then I could reformat/reinstall other o/s flavours at will).  So I uninstalled/reinstalled emby-server (thinking that perhaps config had failed to be written properly). 

 

But no, that makes no difference. (sigh)

 

For completeness I tried:

/path/to/Movies

/path/to/Movies/

//192.168.0.10/Movies

//192.168.0.10/Movies/

smb://192.168.0.10/Movies

smb://192.168.0.10/Movies/

smb://MyServer/movies

smb://MyServer/movies/

 

(incidentally... which one is appropriate?)

 

I have tried this in firefox and chrome (not chromium) with equivalent results.

 

So I'm still at a loss.  And even more of a loss.  The location definitely exists.  The permissions are now wide open.


Edited by bric, 29 October 2016 - 03:10 PM.


#5 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135803 posts
  • Local time: 09:22 PM

Posted 29 October 2016 - 12:38 PM

Can you try mounting the shares locally first, then add the mounts to emby?

#6 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 01:52 PM

Can you try mounting the shares locally first, then add the mounts to emby?

 

What do you mean by 'mounting the shares locally'?

 

Currently, the files *are* local.  The server on which emby is running also has the drive with the media. The drive is mounted in /etc/fstab to a mount point of /media/drive04/ and on that drive .../Video/Movies/ (for example).  I've tried /media/drive04/Video/Movies/ as the source in emby.

 

I have also mounted specific locally mounted directories (e.g., Movies) as shares in Samba and tried adding those to emby. Was that what you meant?

 

or did the reference to NTFS confuse you? It is an NTFS drive because at one time this was a dual boot system and I was considering permanently moving it to windows...except that I found I didn't like Windows as much when the time came and so now it's only Linux.

 

General info: I've just got plain Ubuntu (16.04) running at the moment though I've considered a variety of other configurations.


Edited by bric, 29 October 2016 - 02:17 PM.


#7 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 135803 posts
  • Local time: 09:22 PM

Posted 29 October 2016 - 02:08 PM

Ok, if they're local then you'll want to make sure the emby service user can see them.



#8 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 02:54 PM

Currently, the fstab is setting full permissions (777) for everyone on everything.

All files show -rwxrwxrwx.  All directories show drwxrwxrwx.

 

groups emby returns:

emby: emby bric

(where bric is the owner and group associated with the files/dirs via the fstab)

 

So that should allow the emby service user to see them right?



#9 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 03:17 PM

For interest, I put 'emby' as the owner and group (in fstab) so now I see (for example)...

drwxrwxrwx 1 emby emby   4096 Sep 21 15:25 .wine
-rwxrwxrwx 1 emby emby     99 Oct 29 12:11 .Xauthority

however, I still get the error:

There was an error adding the media path. Please ensure the path is valid and the Emby Server process has access to that location.


#10 fc7 OFFLINE  

fc7

    Advanced Member

  • Developers
  • 735 posts
  • Local time: 03:22 AM
  • LocationMadrid, Spain

Posted 29 October 2016 - 05:59 PM

Is this drive external (USB)?


Sent from my iPad using Tapatalk

#11 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 06:34 PM

Is this drive external (USB)?

 

Nope, regular internal (sata) drive. Hard disk drive.



#12 Servman OFFLINE  

Servman

    Member

  • Members
  • 20 posts
  • Local time: 01:22 PM

Posted 29 October 2016 - 08:14 PM

Hi bric,

Are you having issue with the path substitute? If so use back splashes and it should work.

Give that a go.

I can see you your first post you are using forward slashes.

Regards

Edited by Servman, 29 October 2016 - 08:15 PM.


#13 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 08:18 PM

Though I was momentarily hopeful, it was not to be. The slashes are standard for Linux as compared to the backslash in Windows. Thanks for the suggestion.

If only it were that simple... :(

 

I'm going to stare at the logs a bit later and see if that sheds any light.



#14 Servman OFFLINE  

Servman

    Member

  • Members
  • 20 posts
  • Local time: 01:22 PM

Posted 29 October 2016 - 08:26 PM

Hi @bric,

I run a ubuntu server 16.04 and when i have added my folders i have given emby full read,write and execution rights

And see below

/RAID/Media/Movies
And for path substitute
\\192.168.1.100\Media\Movies

Edited by Servman, 29 October 2016 - 08:26 PM.


#15 puithove OFFLINE  

puithove

    Advanced Member

  • Alpha Testers
  • 716 posts
  • Local time: 09:22 PM

Posted 29 October 2016 - 09:56 PM

I see you said it's mounted at /media/drive04/  The emby user would need at least read & execute access to all of the parent dirs from the root all the way to where it's mounted.  If it doesn't have access to any of the parents, it won't have access to the child.

 

Maybe restart emby, generate the error, stop emby, and post the server log.

 

Then show us 'ls -l' at each of the parent dirs down to where it's mounted.  So like

ls -l /

ls -l /media

ls -l /media/drive04


Edited by puithove, 29 October 2016 - 10:02 PM.


#16 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 29 October 2016 - 11:16 PM

I see you said it's mounted at /media/drive04/  The emby user would need at least read & execute access to all of the parent dirs from the root all the way to where it's mounted.  If it doesn't have access to any of the parents, it won't have access to the child.

 

Ha! If that's the problem then I can tell you right now that /media belongs to root. It was created by ubuntu and I believe has been automounting things there and I just stuck my drive into there without much thought.

 

I may have to rethink the mounting point and give it another try. Perhaps you've given me the clue...

... however, coming back to edit: are you sure? That seems wrong to me. I'll go do some reading.

 

And, if it were a samba share then emby would only have access to the shared drive.  And as long as it had the right permissions on the share it would work, right?


Edited by bric, 29 October 2016 - 11:52 PM.


#17 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 30 October 2016 - 12:17 AM

Then show us 'ls -l' at each of the parent dirs down to where it's mounted.  So like

ls -l /

ls -l /media

ls -l /media/drive04

 

Edited for brevity the results are...

 

ls -l /:

drwxr-xr-x  23 root root     4096 Oct 27 10:46 lib
drwxr-xr-x   2 root root     4096 Oct 27 10:46 lib64
drwx------   2 root root    16384 May 17 10:29 lost+found
drwxr-xr-x   4 root root     4096 May 17 11:18 media

ls -l /media:

drwxrwxrwx  1 emby emby 4096 Oct 26 15:02 drive04

ls -l /media/drive04:

drwxrwxrwx 1 emby emby 282624 Oct 26 15:02 Calibre Library
drwxrwxrwx 1 emby emby      0 Sep 29 09:54 home
drwxrwxrwx 1 emby emby  20480 Jun 28 21:56 Music
drwxrwxrwx 1 emby emby  12288 Oct  7 11:16 Pictures
drwxrwxrwx 1 emby emby 110592 Oct 29 12:19 Video

edit: previously, as described in previous posts, instead of 'emby' the user and group for drive04 and subdirectories was 'bric' (of which I made emby a member). In the latest testing, I changed permissions in fstab to reflect 'emby' as owner and group.


Edited by bric, 30 October 2016 - 12:31 AM.


#18 puithove OFFLINE  

puithove

    Advanced Member

  • Alpha Testers
  • 716 posts
  • Local time: 09:22 PM

Posted 30 October 2016 - 06:46 AM

No, that all looks fine.  Now that you've got all that done, I'm not so sure it's permissions.  Maybe post a server log - it might have some clues.

 

Also, as a test, create a dir and place at least one media file in a location accessible by the emby user in the linux filesystem (get away from the whole FUSE / NTFS stuff) and then add that as a library in Emby.  If that works, I'd encourage you again to get your stuff migrated over.



#19 bric OFFLINE  

bric

    Advanced Member

  • Members
  • 45 posts
  • Local time: 06:22 PM

Posted 30 October 2016 - 10:50 AM

Good suggestion for a test. Emby does work with a source on my ext4 formatted drive, but still don't know why it won't work with the NTFS drive:

 

I created a new directory in /home:

 

sudo mkdir embytest

 

adjusted the ownership:

 

sudo chown emby:emby embytest

 

had copy a file with sudo since I'm not logged in as emby:

sudo /media/drive04/Video/big_buck_bunny_720p_stereo.avi .

then
chown emby:emby big_buck_bunny_720p_stereo.avi

 

Then went to the web admin and added '/home/embytest' as a 'media library'.

 

No problem! It works!

 

from /home/embytest

ls -al

total 277808
drwxr-xr-x 2 emby emby      4096 Oct 30 07:13 .
drwxr-xr-x 3 root root      4096 Oct 30 06:57 ..
-rwxr-xr-x 1 emby emby 284437944 Oct 30 07:10 big_buck_bunny_720p_stereo.avi
-rw-rw-r-- 1 emby emby      1145 Oct 30 07:13 big_buck_bunny_720p_stereo.nfo
-rw-rw-r-- 1 emby emby     23229 Oct 30 07:13 poster.jpg

Emby is downloading metadata as specified. I would cheer except because my drive sizes don't allow for easy reformatting unless I pick up a new drive.  Something in the NTFS drive is not playing nice with the way Emby is asking permission

 

Certainly it doesn't seem to be any sort of problem with my emby install itself, so that's good anyway. I might have to seek elsewhere for an expert on NTFS permissions or bite the bullet on a new HD purchase.


Edited by bric, 30 October 2016 - 11:04 AM.


#20 puithove OFFLINE  

puithove

    Advanced Member

  • Alpha Testers
  • 716 posts
  • Local time: 09:22 PM

Posted 31 October 2016 - 07:33 AM

Yea, in theory, it should work, but it's definitely not ideal.  Post a server log with the steps I mentioned above and see what kind of error it's throwing.

 

You can also convert that drive with the data on it.  It'd be a process of shrinking NTFS, create EXT4 filesystem (or other) in the empty space, move files, shrink ntfs, expand EXT4, move files, rinse & repeat.  There's even tools out there that take care of the heavy lifting for you.







Also tagged with one or more of these keywords: permissions, linux, ubuntu, ntfs

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users