You are not logged in.

#1 2022-11-15 08:39:22

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Unable to change ownership on mounted samba share folder

I am trying to get Jellyfin working over a network share, but jellyfin requires the network share be mounted to the local drive and permissions to read/write.

Problem is every time I try to mount it in --rw or -o rw I cannot change the ownership of the folder the dive is mounted to.

Every attempt just leaves the user and group as root no matter what I change.

Offline

#2 2022-11-15 08:47:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

Did you configure an user on the samba share? https://wiki.archlinux.org/title/Samba#User_management https://wiki.archlinux.org/title/Samba# … ermissions Did you then configure the client to properly mount that specific share path as your target user? https://wiki.archlinux.org/title/Samba#Manual_mounting - read the note and the man page linked there as well.

Last edited by V1del (2022-11-15 08:48:18)

Offline

#3 2022-11-15 08:52:21

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

The share is forced to user smbuser and group smbgroup. The user smbuser and smbgroup were then added to the host system.

Now when mounting and specifying a user without a password can I just use username= without the password= ?

Offline

#4 2022-11-15 09:13:14

d.ALT
Member
Registered: 2019-05-10
Posts: 958

Re: Unable to change ownership on mounted samba share folder

jddoxtator wrote:

Now when mounting and specifying a user without a password can I just use username= without the password= ?

Note:

    If the uid and gid being used does not match the user of the server, the forceuid and forcegid options may be helpful. However note permissions assigned to a file when forceuid or forcegid are in effect may not reflect the the real (server) permissions. See the File And Directory Ownership And Permissions section in mount.cifs(8) §FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS for more information.
    To mount a Windows share without authentication, use "username=*".

(https://wiki.archlinux.org/title/Samba#Manual_mounting)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#5 2022-11-15 09:20:38

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

 sudo mount -t cifs //192.168.1.100/videos /videos -o username=*,password=*,workgroup=WORKGROUP,iocharset=utf8,forceuid=smbuser,forcegid=smbgroup,rw

This is what I tried. error(22) invalid argument error

This is my host smb.conf file. Both user and group are created on host with proper permissions.

[global]
server string = Video Server
workgroup = WORKGROUP
security = user
map to guest = Bad User
name resolve order = bcast host

[videos]
path = /videos
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
writeable = yes

Last edited by jddoxtator (2022-11-15 09:26:26)

Offline

#6 2022-11-15 09:26:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

I doubt you need to have the password field as well. Is  smbuser and smbgroup the actual user/group you are starting jellyfin as?

Last edited by V1del (2022-11-15 09:27:45)

Offline

#7 2022-11-15 09:35:14

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

V1del wrote:

I doubt you need to have the password field as well. Is  smbuser and smbgroup the actual user/group you are starting jellyfin as?

no, i'm logged in as the system wheel user. Do i need to mirror the accounts from host on client machine?

 
sudo mount -t cifs //192.168.1.100/videos /videos -o username=*,workgroup=WORKGROUP,iocharset=utf8,forceuid=smbuser,forcegid=smbgroup

Gave another invalid argument

Here is a thought, I created the folder on the client outside of mount with mkdir. Should I be allowing the mount command to make the dir?

Last edited by jddoxtator (2022-11-15 09:41:14)

Offline

#8 2022-11-15 09:41:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

Yes and no. For "properly" doing it it would be nice but if this is about jellyfin not complaining you need to appropriately change the uid/gid respectively forceuid/forcegid mount options to the local user whose perms you want to map to the share. They'll likely not map correctly on the server side but this shouldn't really matter, as long as the client thinks the files are his and they are relevantly mapped.

You had the mount working at one point no? Which invocation did you use there?

Last edited by V1del (2022-11-15 09:41:48)

Offline

#9 2022-11-15 09:43:36

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

V1del wrote:

Yes and no. For "properly" doing it it would be nice but if this is about jellyfin not complaining you need to appropriately change the uid/gid respectively forceuid/forcegid mount options to the local user whose perms you want to map to the share. They'll likely not map correctly on the server side but this shouldn't really matter, as long as the client thinks the files are his and they are relevantly mapped.

You had the mount working at one point no? Which invocation did you use there?

so forceuid and forcegid should be my client wheel user? e.g. jddoxtator02:users

Mount works without all the -o options

Last edited by jddoxtator (2022-11-15 09:44:11)

Offline

#10 2022-11-15 09:45:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

Yes, I'm assuming uid=/gid= would already suffice and they will have the uid/gid of the sambauser/group on the server side but be logically mounted to your user on the client side.

Offline

#11 2022-11-15 09:50:58

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

Progress, got this to work

sudo mount -t cifs //192.168.1.100/videos /videos -o uid=jddoxtator02,gid=users

now I just need to get it to hold onto --rw so I can change ownership to jellyfin

ok

 
sudo mount -t cifs //192.168.1.100/videos /videos -o rw,uid=jddoxtator02,gid=users

got me

drwxr-xr-x   2 jddoxtator02 users          0 Nov 14 15:22 videos

I think that should work... time to try.

Edit: Nope, jellyfin still hangs trying to open folder, but it at least tries now.

Next thought, just mount as uid=jellyfin?

Last edited by jddoxtator (2022-11-15 09:58:44)

Offline

#12 2022-11-15 09:59:01

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

You can't arbitrarily change ownership after the fact on a normal cifs share.  The uid=/ gid= need to be what you want them to be at mount time. How are you starting jellyfin? If you are starting that with the jellyfin user then yes you'd need to use that.

Last edited by V1del (2022-11-15 10:00:26)

Offline

#13 2022-11-15 10:08:40

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

V1del wrote:

You can't arbitrarily change ownership after the fact on a normal cifs share.  The uid=/ gid= need to be what you want them to be at mount time. How are you starting jellyfin? If you are starting that with the jellyfin user then yes you'd need to use that.

starting jellyfin through systemctl as jddoxtator02, but is the service structure user account bound? I did try changing the uid to jellyfin, but jellyfin still hangs trying to add the folder.

Offline

#14 2022-11-15 10:18:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

If you aren't starting it with --user and seeing that this is intended to be a media server it will likely use it's own user, check the service file with

systemctl cat jellyfin.service

Offline

#15 2022-11-15 10:25:42

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

 
[Unit]
Description=Jellyfin Media Server
After=network.target

[Service]
User=jellyfin
EnvironmentFile=/etc/conf.d/jellyfin
ExecStart=/usr/lib/jellyfin/bin/jellyfin --datadir ${JELLYFIN_DATA_DIRECTORY} --cachedir ${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_ADD_OPTS}
Restart=on-abort
TimeoutSec=20

[Install]
WantedBy=multi-user.target

User is indeed jellyfin, however setting jellyfin as the user and group still has no effect.

Jellyfin can see the directories, but when I go to add it, it just hangs with the blue rotating circle.

I've tried mount point with both of these

sudo mount -t cifs //192.168.1.100/videos /videos -o rw,uid=jellyfin,gid=jellyfin
sudo mount -t cifs //192.168.1.100/videos /videos -o rw,uid=jellyfin,gid=user

Offline

#16 2022-11-15 10:30:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

Which might be just an issue with the network/how jellyfin wants to interact with it. Any error messages regarding the hang in the journal? Can you manually add files by switching to the jellyfin user and trying to create something? E.g.

sudo -u jellyfin touch /videos/jellyfincancreatehere

what are the currently exposed perms?

stat /videos

Offline

#17 2022-11-15 10:37:33

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

sudo -u jellyfin touch /videos/jellyfincancreatehere

results in

sudo: the -U option may only be used with the -l option
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABkNnS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABkNnS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-ABbEHkNnPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-ABkNnS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ...
 

stat /videos

results in

File: /videos
  Size: 0               Blocks: 0          IO Block: 1048576 directory
Device: 0,38    Inode: 10878977    Links: 2
Access: (0755/drwxr-xr-x)  Uid: (  967/jellyfin)   Gid: (  967/jellyfin)
Access: 2022-11-15 07:14:46.451247000 +0000
Modify: 2022-11-14 15:22:46.174406000 +0000
Change: 2022-11-14 15:22:46.174406000 +0000
 Birth: 2022-11-14 15:22:46.174406000 +0000

oops, top one was an entry error

 
sudo -u jellyfin touch /videos/jellyfincancreatehere

does nothing but print a new line

Last edited by jddoxtator (2022-11-15 10:41:29)

Offline

#18 2022-11-15 10:41:02

d.ALT
Member
Registered: 2019-05-10
Posts: 958

Re: Unable to change ownership on mounted samba share folder

Could you go with this?:
- in your smb.conf set force user = jellyfin
- add jellyfin user to SAMBA users: https://wiki.archlinux.org/title/Samba#Adding_a_user
- chown -R jellyfin: /video


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#19 2022-11-15 10:46:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

did you check whether jellyfincancreatehere exists after the touch? According to the stat output the permissions on the dir are fine for the jellyfin user to write to.

Offline

#20 2022-11-15 10:49:41

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

d.ALT wrote:

Could you go with this?:
- in your smb.conf set force user = jellyfin
- add jellyfin user to SAMBA users: https://wiki.archlinux.org/title/Samba#Adding_a_user
- chown -R jellyfin: /video


Tried that, still hangs.

Offline

#21 2022-11-15 10:50:34

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

V1del wrote:

did you check whether jellyfincancreatehere exists after the touch? According to the stat output the permissions on the dir are fine for the jellyfin user to write to.

yes, folder was created

I'm going to hard reboot the server and see if that bring things around

just realized that I haven't updated this system in a while either. I think it's still on the old openssl.

Going to full system update and reboot.

Last edited by jddoxtator (2022-11-15 11:05:28)

Offline

#22 2022-11-15 11:05:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

Which permissions did the file have? As mentioned you might want to check your journal, e.g.

journalctl  -u jellyfin -b 

on whether it leaves any messages as to why it hangs.

Offline

#23 2022-11-15 11:07:59

jddoxtator
Member
Registered: 2022-01-02
Posts: 43

Re: Unable to change ownership on mounted samba share folder

V1del wrote:

Which permissions did the file have? As mentioned you might want to check your journal, e.g.

journalctl  -u jellyfin -b 

on whether it leaves any messages as to why it hangs.

ok, I have some interesting info in the log. Some network manager errors

Nov 15 11:00:57 Rig03 jellyfin[734]: [11:00:57] [ERR] [11] Jellyfin.Networking.Manager.NetworkManager: No interfaces information available. Resolving DNS name.
Nov 15 11:00:57 Rig03 jellyfin[734]: [11:00:57] [INF] [11] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Nov 15 11:00:57 Rig03 jellyfin[734]: [11:00:57] [INF] [11] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
Nov 15 11:00:57 Rig03 jellyfin[734]: [11:00:57] [INF] [11] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]

Offline

#24 2022-11-15 11:09:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,101

Re: Unable to change ownership on mounted samba share folder

These shouldn't matter since from the perspective of jellyfin your samba share is local. These NetworkManager messages are more likely to be relevant for the clients you'll eventually connect.

Offline

#25 2022-11-15 11:18:27

d.ALT
Member
Registered: 2019-05-10
Posts: 958

Re: Unable to change ownership on mounted samba share folder

jddoxtator wrote:
d.ALT wrote:

Could you go with this?:
- in your smb.conf set force user = jellyfin
- add jellyfin user to SAMBA users: https://wiki.archlinux.org/title/Samba#Adding_a_user
- chown -R jellyfin: /video


Tried that, still hangs.

Did you restart SAMBA service?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

Board footer

Powered by FluxBB