Mount a Samba share for recording

For discussion of topics specific to MythTV on linux
Post Reply
Darkmann
Newcomer
Posts: 3
Joined: Sat Feb 18, 2017 2:43 pm
Denmark

Mount a Samba share for recording

Post by Darkmann »

Hi.

Have installed Ubuntu (Minimal installation) on a virtual machine, installed MythTV backend, and configured it to use my 2x2 HDHomerun tuners. Use MythTV frontend on my Raspberry PI’s to watch and record tv. All works fine.
But now comes the challenge:
Instead of using diskspace on my little virtual box for recording tv, I would like to mount a network share which is located on my qNAP NAS. The share is open, and do not need any user or password to use/access.

Shared folder contains one folder pr. Storage area. One for livetv, one for recordings and so on.
I added mount to share in fstab like this:
//192.168.2.5/WMC /media/windowsshare cifs guest,uid=1000,iocharset=utf8 0 0

I can now change storage folders in mythTV backend to use the share.

On exit from setup, everything look fine, no error messages.
But when using the mythtv frontend, it will not allow me to see live tv anymore.

I looked at original mythtv storage folders and see that they are owned by user mythtv and group mythtv, and permissions is drwxrwsr-x.

So I changed the mounting parameters in fstab to:
//192.168.2.5/WMC /media/windowsshare cifs guest,uid=mythtv,gid=mythtv,iocharset=utf8 0 0

Now the mounted share is owned by userid mythtv and groupid mythtv, that is all good.
But permissions is drwxr-xr-x, and If change storage references in mythtv backend to shared folder, I get the error message, that myth tv can't write to the folders. (Didn’t get that when root was the owner)
My best guess is, it is because w is missing in group permissions on folder?

So how do I change permissions on my shared/mounted folder so it looks like the ‘original’ mythtv storage folders.
I have tried command chmod. On execute it runs for a second or two, and completes without any warnings or errors, but permissions haven’t changed.
Is it because the share is a samba folder that normally doesn’t have this possibility for access permission control…

Or should it be solved in a completely other way? :?: :roll:

Kind regards.
User avatar
pgbennett
Developer
Posts: 504
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Mount a Samba share for recording

Post by pgbennett »

You should not need to have group write in order for it to work.

I would first check that the backend is running under user "mythtv". I suspect that maybe your backend is running under a different user id. If that is so you could change the samba mount to use that user id.

If it is running under mythtv, then try su mythtv and see if you are able to create a file in the recordings directory when logged on with mythtv.

For changing the group permissions on SAMBA you will need to look for SAMBA documentation.
Darkmann
Newcomer
Posts: 3
Joined: Sat Feb 18, 2017 2:43 pm
Denmark

Re: Mount a Samba share for recording

Post by Darkmann »

Well. I can see that I'm not the only one on this forum, who has this issue.
I'll start reading, and hope someone else have solved the issue too.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Mount a Samba share for recording

Post by MikeB2013 »

This may not be relevant to your configuration.

There is an old problem with using /media as the mount point as some distributions automount in /media causing strange conflicts (everything should work but it does not) see :
https://www.mythtv.org/wiki/Troubleshoo ... ermissions

In general I would suggest using something in /srv e.g. /srv/mythtv/

Mike
Darkmann
Newcomer
Posts: 3
Joined: Sat Feb 18, 2017 2:43 pm
Denmark

Re: Mount a Samba share for recording

Post by Darkmann »

I solved the issue, by reading about 7 other threads in this forum, and combine their hints and tricks.

It all comes to permissions.

I simply needed to set the right permissions when auto mounting my external drive.
Adding _netdev, dir_mode=0775,file_mode=0775 solved the issue.

//192.168.2.6/mythtv /media/windowsshare cifs _netdev,guest,uid=108,gid=118,dir_mode=0775,file_mode=0775,iocharset=utf8

After mouting, I created all needed subfolders, and they inherited the permissions.

Change the storage settings in myth tv backend to point at new folder.

And it worked.

Thanks for your help.
Post Reply