I've created a few fresh installs on my Raspberry Pi and most recently I used Ubuntu which actually worked! So there must be something specific to Raspberry Pi OS or a setting that I'm not aware of that's causing the issue.
I’d really appreciate any help with this. Please note, I would prefer not to use nfs although I realise this may be a work around.
My specs and troubleshooting below.
Raspberry Pi OS Version:
Code: Select all
cat /etc/os-release
Raspbian GNU/Linux 11 (bullseye)
Creating directories to mount in
Code: Select all
pi@raspberrypi:~ $ mkdir embyMovies
pi@raspberrypi:~ $ mkdir piMovies
Code: Select all
pi@raspberrypi:~ $ sudo chown -R emby:emby /home/pi/embyMovies
pi@raspberrypi:~ $ sudo chown -R pi:pi /home/pi/piMovies
Code: Select all
pi@raspberrypi:~ $ ls -l
total 74684
-rw-r--r-- 1 pi pi 36 Jun 16 21:55 cred
drwxr-xr-x 2 emby emby 4096 Jun 17 12:32 embyMovies
drwxr-xr-x 2 pi pi 4096 Jun 17 12:32 piMovies
I’m using the backup plugin to perform the write tests as it’s the quickest way I’ve found to try and write a file using Emby server.
This was successful.
Attempt to write to “/home/pi/piMovies” using Emby server. (before cifs/SMB mount)
Failed.
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/home/pi/piMovies/Emby Backup - 2022-06-20 08.7.27 - Auto' is denied.
---> System.IO.IOException: Permission denied
This makes sense. The piMovies folder doesn’t have Emby user permissions. These 2 tests confirm that Emby is using the Emby account and write permissions work before the SMB/cifs mount.
Mounting the SMB paths
/etc/fstab contents
Code: Select all
proc /proc proc defaults 0 0
PARTUUID=2cf82d9c-01 /boot vfat defaults,flush 0 2
PARTUUID=2cf82d9c-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
//nas/Movies/home/pi/piMovies cifs x-systemd.automount,uid=pi,gid=pi,credentials=/home/pi/cred,iocharset=utf8,vers=3.0,noperm 0 0
//nas/Movies/home/pi/embyMovies cifs x-systemd.automount,uid=emby,gid=emby,credentials=/home/pi/cred,iocharset=utf8,vers=3.0,noperm 0 0
Checking file permissions for SMB mount (embyMovies)
Code: Select all
pi@raspberrypi:~/embyMovies $ cd .ignored
pi@raspberrypi:~/embyMovies/.ignored $ ls -l
total 0
drwxr-xr-x 2 emby emby 0 Jun 16 21:46 'Emby Backup'
drwxr-xr-x 2 emby emby 0 Jun 17 07:26 'Emby Backup - 2022-06-17 07.26.0 - Auto'
drwxr-xr-x 2 emby emby 0 Jun 17 07:31 'Emby Backup - 2022-06-17 07.31.57 - Auto'
drwxr-xr-x 2 emby emby 0 Jun 17 07:34 'Emby Backup - 2022-06-17 07.34.3 - Auto'
drwxr-xr-x 2 emby emby 0 Jun 17 07:38 'Emby Backup - 2022-06-17 07.38.24 - Auto'
drwxr-xr-x 2 emby emby 0 Jun 17 08:21 'Emby Backup - 2022-06-17 08.21.35 - Auto'
drwxr-xr-x 2 emby emby 0 Jun 17 08:21 'Emby Backup - 2022-06-17 08.21.6 - Auto'
pi@raspberrypi:~/embyMovies/.ignored/Emby Backup $ cd 'Emby Backup - 2020-08-31 00.10.0 - Auto'
pi@raspberrypi:~/embyMovies/.ignored/Emby Backup/Emby Backup - 2020-08-31 00.10.0 - Auto $ ls -l
total 12
drwxr-xr-x 2 emby emby 0 Aug 31 2020 dlna
drwxr-xr-x 2 emby emby 0 Aug 31 2020 library
-rwxr-xr-x 1 emby emby 34 Aug 31 2020 mb.lic
drwxr-xr-x 2 emby emby 0 Aug 31 2020 plugins
-rwxr-xr-x 1 emby emby 12 Aug 31 2020 profile.txt
drwxr-xr-x 2 emby emby 0 Aug 31 2020 ScheduledTasks
-rwxr-xr-x 1 emby emby 2833 Aug 31 2020 system.xml
drwxr-xr-x 2 emby emby 0 Aug 31 2020 userdata
drwxr-xr-x 2 emby emby 0 Aug 31 2020 users
Code: Select all
pi@raspberrypi:~/piMovies $ cd .ignored
pi@raspberrypi:~/piMovies/.ignored $ ls -l
total 0
drwxr-xr-x 2 pi pi 0 Jun 16 21:46 'Emby Backup'
drwxr-xr-x 2 pi pi 0 Jun 17 07:26 'Emby Backup - 2022-06-17 07.26.0 - Auto'
drwxr-xr-x 2 pi pi 0 Jun 17 07:31 'Emby Backup - 2022-06-17 07.31.57 - Auto'
drwxr-xr-x 2 pi pi 0 Jun 17 07:34 'Emby Backup - 2022-06-17 07.34.3 - Auto'
drwxr-xr-x 2 pi pi 0 Jun 17 07:38 'Emby Backup - 2022-06-17 07.38.24 - Auto'
drwxr-xr-x 2 pi pi 0 Jun 17 08:21 'Emby Backup - 2022-06-17 08.21.35 - Auto'
drwxr-xr-x 2 pi pi 0 Jun 17 08:21 'Emby Backup - 2022-06-17 08.21.6 - Auto'
pi@raspberrypi:~/piMovies/.ignored $
pi@raspberrypi:~/piMovies/.ignored $ cd 'Emby Backup'
pi@raspberrypi:~/piMovies/.ignored/Emby Backup $ cd 'Emby Backup - 2020-08-31 00.10.0 - Auto'
pi@raspberrypi:~/piMovies/.ignored/Emby Backup/Emby Backup - 2020-08-31 00.10.0 - Auto $ ls -l
total 12
drwxr-xr-x 2 pi pi 0 Aug 31 2020 dlna
drwxr-xr-x 2 pi pi 0 Aug 31 2020 library
-rwxr-xr-x 1 pi pi 34 Aug 31 2020 mb.lic
drwxr-xr-x 2 pi pi 0 Aug 31 2020 plugins
-rwxr-xr-x 1 pi pi 12 Aug 31 2020 profile.txt
drwxr-xr-x 2 pi pi 0 Aug 31 2020 ScheduledTasks
-rwxr-xr-x 1 pi pi 2833 Aug 31 2020 system.xml
drwxr-xr-x 2 pi pi 0 Aug 31 2020 userdata
drwxr-xr-x 2 pi pi 0 Aug 31 2020 users
pi@raspberrypi:~/piMovies/.ignored/Emby Backup/Emby Backup - 2020-08-31 00.10.0 - Auto $
Attempt to write to “/home/pi/embyMovies” using Emby server. (after SMB mount)
Failed
Code: Select all
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/home/pi/embyMovies/.Ignored/Emby Backup - 2022-06-20 08.13.14 - Auto/profile.txt' is denied.
---> System.IO.IOException: Permission denied
https://wiki.archlinux.org/title/Emby
I tried what was suggested here but I didn't really understand it. Mentioning it because maybe it is related to the issue and maybe I applied it incorrectly to Raspberry Pi OS.Emby runs under the user and user group emby using systemd's DynamicUser feature. By default, Emby will have at most read permissions to your media files thanks to systemd's filesystem abstraction.
When I tried Ubuntu Ubuntu 20.04.4 LTS following the same tests above, writing worked fine however I'm finding Raspberry Pi OS is compatible with everything I need to run, unlike Ubuntu. Also seems much faster, even in terminal.