Permissions for TVheadend usb storage

Thanks for Docker. Loving it.
I have TVheadend installed through Portainer and working fine including detecting my dvb devices.
I want to record to a mounted usb drive and have created a volume for it but having tried many things I am unable to get the recordings to go to this drive.
The user:group for TVH’s _data folder is tvhUser:911 whereas I expected that to be tvhUser:tvhUser same as for the /mnt/usb16GB.
I have granted the user tvhUser administrator rights.
Am at a bit of a loss as to what I have missed.
TIA

Permissions aren’t correct, as iirc 911 is the result of not having PUID & PGID set correctly.

Post your portainer config, screenshots, whatever

Thanks for yr reply.

I agree permissions are not correct. Just haven’t been able to find how to set them properly. It seems that the env parameters of PUID=1000 and GUID=1000 are not being set.

I think I see the issue. Is it PGID not GUID as I have it?

Alas it is still not right.

2020-03-03 12:08:51.120 dvr: Unable to change directory permissions to "775" for "/mnt/usb16GB/Q+A" (keeping "755")

2020-03-03 12:08:51.121 dvr: /mnt/usb16GB/Q+A/Q+A - - Q+A explores

and this is being created in _data for the above recording:

drwxrwxr-x 2 tvhUser tvhUser 4096 Mar 3 23:08 Q+A

PUID & PGID are the two parameters

1 Like

As an aside, I just fired up portainer, what a mess that is. Docker compose is a far simpler way to manage your docker container deployments imho.

What file system is the USB formatted with, what OS are you running?

docker exec -it tvheadend ls -la /mnt/usb16GB

Will show you the perms on that mount point.

Cannot disagree with you there. It has some good points but can be a challenge to navigate.
The OS is Ubuntu 18.04 (actually Armbian 19.11.3 Bionic) on a Pine A64 i.e. arm64 so not sure if I can run docker compose.
The FS for the usb drive is Ext4.
Selection_225

I’m going to hazard a guess it’s still perms on the mounted drive.

It needs to be RW for the 1000 user.

fstab would be the place to look.

/dev/sda1 /mnt/usb16GB vfat auto,users,rw,uid=1000,gid=1000,umask=002 0 0

I think my next step is to blow the whole container away and start clean. I have been using the Duplicate/Edit tool to make changes to the container but I think the last change to correct to PGID has not set all the folder permissions correctly.
I will let you know.
Thanks

Wow. Persistent problem.
This is the latest recording being written to the _data folder not to the usb drive so at least the container has the right permissions:

drwxrwxr-x 2 tvhUser tvhUser 4096 Mar 4 00:13 Humans

The error in the log is

dvr: Unable to change directory permissions to "775" for "/mnt/usb16GB/Humans" (keeping "755")

even though it already has 775 permissions and ownership is right tvhUser tvhUser.

What’s weird is that TVH will create a 775 sub-directory in the _data directory but not in the /mnt/usb16GB directory with both destinations having the same ownership and permissions.

In case anyone stumbles on this the issue was the volume had to be defined as a BIND so that:
Host folder /mnt/usb64GB/recordings was bound to Container volume /mnt/usb64GB/recordings