[Solved] Moving storage failed

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

[Solved] Moving storage failed

Post by zed_patrol »

I've searched long and hard for a solution to this problem, but can't quite find the answer. My system was running well with mythtv recording to an nfs mount on another machine. I took the hard drive off of that machine that I had my mythtv storage recording to and put it on the actual backend server. I changed the location of the directories in mythtv-setup. It throws no errors, but will not record. The recordings show up in the database, but no actual new ts file is made. Permissions are set correctly, mythtv owns the directory. Mythtweb backend status says 0gb available, 0gb used. I'm out of ideas on why this didn't work. Any help is greatly appreciated. Thanks.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Moving storage failed

Post by bill6502 »

Hi,

If you'll mention your distribution and version, you may get better answers.

After changing the storage directories in the affected storage groups, was the backend restarted?
The start/stop commands in mythtv-setup may not be working.

Guessing *buntu 16.04+, the answer is: sudo systemctl {stop|start} mythtv-backend.service

If that's of no help, check the backend logs.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

Yeah I'm using version .29, on ubuntu 16.04. I've restarted the computer many times. Everththing acts like it should work. I can even schedule recordings, they even show up but don't actually record. It's pretty weird. I feel like I am missing something simple. A little more detail of what I did:

System was up and running great on the backend. Backend recorded to an nfs mounted external hard drive that was on another machine. I decided to move the external drive to the machine running the backend. I physically did this and then ran mythtv-setup and pointed it to where the hard drive was moved. Anyhow it doesn't work. Maybe it's just not that simple.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Moving storage failed

Post by bill6502 »

I'd stop the backend, then do: cat /dev/null | sudo tee /var/log/mythtv/mythbackend.log
and start the backend. The make a single recording.

Then put the log in your favorite pastebin and put the link to it here.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Moving storage failed

Post by wesnewell »

zed_patrol wrote:
Sun Mar 17, 2019 9:09 pm
Permissions are set correctly, mythtv owns the directory. Mythtweb backend status says 0gb available, 0gb used.
You don't have any recording space available. So you have something configured wrong in the setup. Double check everything. BTW, mythtv doesn't own my recordings dir and it works fine like that. Of course it does have r/w access to it.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

Yeah looks like a permission issue.

Mar 18 22:30:01 mythmachine mythbackend: mythbackend[1747]: I TVRecEvent tv_rec.cpp:4204 (TuningNewRecorder) TVRec[1]: rec->GetPathname(): '/1091_20190319053000.ts'
Mar 18 22:30:01 mythmachine mythbackend: mythbackend[1747]: E TVRecEvent threadedfilewriter.cpp:129 (Open) TFW(/1091_20190319053000.ts:-1): Opening file '/1091_20190319053000.ts'.#012#011#011#011eno: Permission denied (13)

Ok so it is trying to put the .ts file in the root directory. I have no idea why that is happening. In mytv-setup do you set paths anywhere other than "Storage Directories?" I only have the "default," "livetv", and "screenshots" groups set, but that is all I ever had set when this drive was on another machine. Any ideas? I appreciate your help.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

Does anybody know where the paths are stored in the mythconverg database? I am not that good with sql, but can do basic stuff if somebody points me in the right direction.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Moving storage failed

Post by paulh »

Messing with the DB is not recommended but if you must ;)

Code: Select all

mysql> SELECT * from storagegroup;
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Moving storage failed

Post by bill6502 »

@ zed_patrol if you don't want to use SQL: <yourBackend>:6544/Myth/GetStorageGroupDirs
(from your favorite browser.)

If the: Opening file '/1091_20190319053000.ts' in the log above is a recording that's being
restarted, because it failed/the backend was restarted etc, then there was an old bug that
would loose the full path. I don't recall when it was fixed. It didn't affect new recordings.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

Ok i checked with the mysql utility. Paths look good. Strange
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Moving storage failed

Post by wesnewell »

zed_patrol wrote:
Tue Mar 19, 2019 5:55 am
Yeah looks like a permission issue.
Ok so it is trying to put the .ts file in the root directory. I have no idea why that is happening. In mytv-setup do you set paths anywhere other than "Storage Directories?" I only have the "default," "livetv", and "screenshots" groups set, but that is all I ever had set when this drive was on another machine. Any ideas? I appreciate your help.
The problem is obvious. Do you not know how to fix it?

Add a Recordings storage group and set it to where you want your recordings stored. Then change your default recording template to use the new Recordings storage group. And while you're at it, change the location for your default storage group to something other than /. Do you really want all mythtv files stored in just one dir? I store most of mine on a separate drive.
wes@mythfe0:~$ ls /sdb
default lost+found music pictures recordings videos
Make sure mythtv has permission to access them.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

I don't understand why it is trying to put things in the root directory though. All I did was move my HD and repointed myth to where it was. It obviously didn't work, but why? Honestly it just worked before and, sure I would have liked to have organized it better to more directories, but I found the documentation very confusing and also the setup interface takes some time to understand.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Moving storage failed

Post by bill6502 »

Looking at the paths isn't enough, the output of this, done from your backend please:

curl -s localhost:6544/Myth/GetStorageGroupDirs?GroupName=Default | sed "s/></>\n</g"

Expect to see something like the following for each Storage Directory in the Default Storage Group:

Code: Select all

<StorageGroupDir>
<Id>54</Id>
<GroupName>Default</GroupName>
<HostName>mythmachine</HostName>
<DirName>yourPathHere</DirName>
<DirRead>true</DirRead>
<DirWrite>true</DirWrite>
<KiBFree>someNumber</KiBFree>
</StorageGroupDir>
Then ls -la on the DirName returned from the above (just a few lines of it please.)

If done properly, your Storage Directories are under the mount points (such that if the
mount fails, the backend would never be able to write to your root file system.

Since this was on a NAS, see if the owner/group still a NAS owner/id and unknown to the host.
zed_patrol
Newcomer
Posts: 9
Joined: Thu Jan 17, 2019 6:31 pm
United States of America

Re: Moving storage failed

Post by zed_patrol »

Ok thanks for the help. I tried your curl command and saw the following attributes as such:

<DirRead>false</DirRead>
<DirWrite>false</DirWrite>

So I guess that is the culprit? I have no idea how to fix that. I did check the uid and guid for the drive and all looks good. I can write files as the mythuser in that directory. Am I missing some setting somewhere?
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Moving storage failed

Post by bill6502 »

Yes, the read/write permissions must be true. You must also verify the the
uid/gid map to the expected names (probably true, but not mentioned in the
above.)

The output gives the permissions of the user that runs mythbackend.
Typically, that's user mythtv.

If you had posted the output of the ls command, as requested, we wouldn't
need to guess about the problem.

"mythuser" mentioned in the previous post isn't wrong, but it's unusual. Since you're
using ubuntu 16.04, you're most likely starting the backend via systemd. You can see
the user systemd will use. Type: systemctl cat mythtv-backend to look.

Posting the backend log, as requested in the 4th post here, would have eliminated more
guessing, as the user will show up there.
Post Reply