How to record to NAS from TVHeadend running on Raspberry Pi 4
Sorry if I unintentionally transgress any forum etiquette - in all my time looking for answers to questions I have been able to get there through searching and have never actually had to post a question. I suspect the root of the problem is how I am mounting the samba share and the permissions on the Pi but if this is actually a tv headend issue I will gladly take myself off to their forum!
I am running TV headend on a RPi 4 with a Pi TV hat and all has gone pretty well, however I have tried to set it up to record to a samba share on my network and so far everything I have tried has failed.
The smb.conf section for the share (running on an Ubuntu machine) is:
[UbuntuNAS] comment = UbuntuNAS path = /home/david/UbuntuNAS browsable = yes writable = yes read only = no guest ok = yes create mask = 0777 directory mask = 0777
fstab line for the mount on the Pi is:
//192.168.1.16/UbuntuNAS /home/pi/UbuntuNAS cifs credentials=/home/pi/.smbcredentials,iocharset=utf8,users,_netdev,rw,uid=1000,gid=1000,file_mode=0775,dir_mo$
So far so good - as me (e.g.
gid 1000) I can read/write files and directories. However when I try to record to the location
/home/pi/UbuntuNAS/recordings/ (which is a subdirectory that exists by the way!) the recording fails with messages saying that the recording has been scheduled, started, and completed in quick succession, and the log output clearly shows that permission was denied:
2020-05-28 00:45:56.596 dvr: "The Real Marigold Hotel" on "BBC TWO" recorder starting 2020-05-28 00:45:56.599 dvr: About to set stop timer for "The Real Marigold Hotel" on "BBC TWO" at start 1590622200 and original stop 1590625800 and overall stop at 1590625800 2020-05-28 00:45:56.600 subscription: 0008: "DVR: The Real Marigold Hotel" subscribing on channel "BBC TWO", weight: 300, adapter: "Afatech AF9033 (DVB-T) #0 : DVB-T #0", network: "DVB-T Network", mux: "490MHz", service: "BBC TWO", profile="pass" 2020-05-28 00:45:56.646 pass: /home/pi/UbuntuNAS/recordings/The Real Marigold Hotel.ts: Unable to create file, open failed -- Permission denied 2020-05-28 00:45:56.646 dvr: Recording error: "/home/pi/UbuntuNAS/recordings/The Real Marigold Hotel.ts": Unable to open file 2020-05-28 00:45:56.647 subscription: 0008: "DVR: The Real Marigold Hotel" unsubscribing from "BBC TWO" 2020-05-28 00:45:56.647 dvr: unable to stat file '/home/pi/UbuntuNAS/recordings/The Real Marigold Hotel.ts' 2020-05-28 00:45:56.648 dvr: "The Real Marigold Hotel" on "BBC TWO": End of program: File not created
The output for this drive after running
mount in the terminal is:
//192.168.1.16/UbuntuNAS on /home/pi/UbuntuNAS type cifs (rw,nosuid,nodev,noexec,relatime,vers=default,cache=strict,username=david,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.16,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1,_netdev)
This obviously has way more options set than I have defined and I am not sure if there is a clue in that.
I have noticed in
\etc\password the following entry:
so have attempted setting
uid to 110 and
gid to 117 in the
fstab options to no avail (as well as both to '1' for daemon).
I am hoping that there is something I have simply failed to do, but frankly with the time I have invested on this so far I would be equally happy with a definitive answer that what I am trying to do is simply not possible!
Thanks in advance