Tvheadend recording to a network drive

Hi I have created a directory in osmc that resides on a raspberry pi usb drive on my network. The drive appears on my osmc file manager. I can see and open files that it contains. So I feel it’s working fine.
I wanted to point Tvheadend to this directory to store recordings that I make. However so far I have not found any info on the correct format of the usb drive address to add to the Tvheadend confiruration. I have tried variations on /IP address of RPi usb drive/folder path/ but no success. I have not tried logging the failure to debug - I am not sure how to do this or where these logs would be stored.
Any help with the correct format much appreciated!

If the USB drive is not connected to the TVheadend server then it will have to be mounted in that server’s filesystem. Can we clarify which devices you are using for (a) OSMC, (b) TVHeadend and (c) the device with the USB port the USB drive is connected to.

Thanks for your fast response. I have a RPi +3 running osmc and TvHeadend. The live TV works fine - I have a HDHomerun Tuner on my network that provides the signal.
I have a RPi 4 set up as a simple NAS with a 4TB usb drive attached. This uses samba to provide my network with data storage.
I opened the file manager on osmc and setup a folder on the RPi 4 to use this as the place to store recorded TV. It seems that osmc reads this folder without error. I then tried to add this path to my Tvheadend as the storage path for the DVR. If I try to record this currently does not work - I see the exclamation sign in Tvheadend and get the error file missing.
I have tried using fstab to mount the usb drive too. Currently this does not work either. If on the osmc RPi I look for the mounted RPi 4 usb drive I do see it but Tvheadend doesn’t seem to recongnise it.

Hi I have just tried rebooting osmc - before I just reloaded the daemon. I do see an error - Tvheadend client - access denied. I did do chmod -R 777 on the folder but maybe something else is needed. Thanks.

I use autofs for all my shared drives. Export the drive on the Pi4 with nfs-server and mount it under /mnt on the Pi3 and TVHeadend should be able to see it and write to it. You may need to reboot both Pis after setting this up.

Thanks. I had some success and solved the access denied issue using your post from 2019 and adding to access list. However I am still stuck with both fstab and autofs. I am more familiar with fstab and seemed close to getting that to work. But autofs - I could not understand the references to server1 and share1! How do I translate to my network? I have network folders (that are password protected) that I can ssh into. But I have not found the the correct way to format either fstab or autofs yet. So I fall back onto using the osmc sd card which is 64GB so can take the load!

Please post /etc/exports on the Pi4 and /etc/auto.master and /etc/auto.nfs.shares from the Pi3.

I have tried using fstab again. It is not working - it records into the /mnt/file that I made. But this is not linked to the folder on the Pi4. There is no exports nor auto.nfs.shares files on the Pi4 or the Pi3. The Pi3 has a auto.master and a auto.smb.shares. I tried mount -a and there was no error.

Since both Pis are running linux, I recommend you use nfs to share the drive on the Pi4. At the moment it’s being shared by samba (cifs). If you post your fstab we can try to get samba working though.

I’m guessing that is a local file on the Pi3, not a mountpoint. You need to empty that or create a new empty directory for fstab or if using autofs let that create a different directory.

This is my line in fstab: // /mnt/Recordings nfs username=xxx,password=xxx,defaults,rw,noauto,noatime,x-systemd.automount 0 0.
Incidentally I have installed autofs and it is running and I have created a symlinked folder on my Pi3. With a similier fstab line to the above but with cifs and using the symlinked folder I get the permssion denied error 13.
Thanks a lot for all your help.

To share with nfs, you need to create /etc/exports on the Pi4 containing just this line:


Then on the Pi3 either sudo mkdir /mnt/Recordings and use fstab. I don’t think username and password are necessary. Or don’t create that directory and use autofs where /etc/auto.nfs.shares looks like

/mnt/Recordings -fstype=nfs4

Edit /etc/auto.master as described in the linked post above.
After setting it up systemctl restart nfs-server on Pi4 and systemctl restart autofs on Pi3.

You may not have discovered this wiki: