[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

Re: Moving storage failed

Post by zed_patrol »

The dirname was /media/dave/movies/mythtv/
If I do ls -la on that dir, it has the following result:

Code: Select all

-rw-rw-rw- 1 mythtv mythtv     181970 Jan 16 13:21 1133_20190116200000.ts.png
-rw-r--r-- 1 mythtv mythtv  604244972 Jan 17 12:00 1133_20190117190000.ts
-rw-rw-rw- 1 mythtv mythtv      10458 Feb  4 22:06 1133_20190117190000.ts.-1.100x56.png
-rw-rw-rw- 1 mythtv mythtv     190733 Jan 17 12:22 1133_20190117190000.ts.png
-rw-r--r-- 1 mythtv mythtv  610856368 Jan 17 13:00 1133_20190117200000.ts
-rw-rw-rw- 1 mythtv mythtv       5291 Feb  4 22:06 1133_20190117200000.ts.-1.100x56.png
-rw-rw-rw- 1 mythtv mythtv      63245 Jan 17 13:22 1133_20190117200000.ts.png
-rw-r--r-- 1 mythtv mythtv  621501304 Jan 18 12:00 1133_20190118190000.ts
-rw-rw-rw- 1 mythtv mythtv      10034 Feb  4 22:06 1133_20190118190000.ts.-1.100x56.png
-rw-rw-rw- 1 mythtv mythtv     183890 Jan 18 12:22 1133_20190118190000.ts.png
-rw-r--r-- 1 mythtv mythtv  620330816 Jan 18 13:00 1133_20190118200000.ts
-rw-rw-rw- 1 mythtv mythtv      10828 Feb  4 22:06 1133_20190118200000.ts.-1.100x56.png
-rw-rw-rw- 1 mythtv mythtv     240790 Jan 18 13:21 1133_20190118200000.ts.png
-rw-r--r-- 1 mythtv mythtv   72998708 Jan 19 11:06 1133_20190119190000.ts
That's just a sample, every one of my recordings is in there.

Here it is with ls -n

Code: Select all

-rw-rw-rw- 1  127  134     151349 Feb 27 13:22 1133_20190227200000.ts.png
-rw-r--r-- 1  127  134  600294528 Feb 28 12:00 1133_20190228190000.ts
-rw-rw-rw- 1  127  134     222212 Mar  1 09:32 1133_20190228190000.ts.png
-rw-r--r-- 1  127  134  624510620 Feb 28 13:00 1133_20190228200000.ts
-rw-rw-rw- 1  127  134     181510 Mar  1 09:53 1133_20190228200000.ts.png
-rw-r--r-- 1  127  134  623432252 Mar  1 12:00 1133_20190301190000.ts
-rw-rw-rw- 1  127  134     186073 Mar  1 13:37 1133_20190301190000.ts.png
-rw-r--r-- 1  127  134  617376960 Mar  1 13:00 1133_20190301200000.ts
-rw-rw-rw- 1  127  134     199852 Mar  1 13:55 1133_20190301200000.ts.png
-rw-r--r-- 1  127  134  655251816 Mar  4 12:00 1133_20190304190000.ts
-rw-rw-rw- 1  127  134     221411 Mar  4 12:22 1133_20190304190000.ts.png
-rw-r--r-- 1  127  134  635586828 Mar  4 13:00 1133_20190304200000.ts
-rw-rw-rw- 1  127  134     191315 Mar  4 13:22 1133_20190304200000.ts.png
From my passwd file I can see that it looks like the uid and gid of the mythtv user is 127 and 134.

Should I delete all my storage groups and start over? All I was using was the default one.

User appears to be mythtv for the mythtv-backend service as shown with systemctl command:

Code: Select all

[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
After=mysql.service network.target
 
[Service]
User=mythtv
EnvironmentFile=-/etc/mythtv/additional.args
ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
StartLimitBurst=10
StartLimitInterval=10m
Restart=on-failure
RestartSec=1
 
[Install]
WantedBy=multi-user.target
Here's output from the mythbackend log when it tried to record The Late Show last night:

Code: Select all

Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: I Scheduler programinfo.cpp:2532 (QueryBasename) QueryBasename found no entry for recording ID 0
Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: I Scheduler programinfo.cpp:2532 (QueryBasename) QueryBasename found no entry for recording ID 0
Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: I TVRecEvent tv_rec.cpp:1090 (HandleStateChange) TVRec[1]: Changing from None to RecordingOnly
Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: I TVRecEvent tv_rec.cpp:3665 (TuningFrequency) TVRec[1]: TuningFrequency
Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: I Scheduler scheduler.cpp:2923 (HandleRecordingStatusChange) Tuning recording: "The Late Show with Steven Colbert":"2019-03-19 23:35:00": channel 1071 on cardid [1], sourceid 1
Mar 19 23:35:00 puma mythbackend: mythbackend[21548]: C CoreContext programinfo.cpp:340 (ProgramInfo) ProgramInfo(): Failed to find recorded entry for 0.
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I CoreContext scheduler.cpp:734 (UpdateRecStatus) Updating status for "The Late Show with Steven Colbert":"2019-03-19 23:35:00" on cardid [1] (Tuning => Recording)
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I TVRecEvent tv_rec.cpp:4204 (TuningNewRecorder) TVRec[1]: rec->GetPathname(): '/1071_20190320063500.ts'
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: E TVRecEvent threadedfilewriter.cpp:129 (Open) TFW(/1071_20190320063500.ts:-1): Opening file '/1071_20190320063500.ts'.#012#011#011#011eno: Permission denied (13)
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: E TVRecEvent tv_rec.cpp:4210 (TuningNewRecorder) TVRec[1]: RingBuffer '/1071_20190320063500.ts' not open...
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I CoreContext scheduler.cpp:734 (UpdateRecStatus) Updating status for "The Late Show with Steven Colbert":"2019-03-19 23:35:00" on cardid [1] (Recording => Recorder Failed)
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I TVRecEvent tv_rec.cpp:1090 (HandleStateChange) TVRec[1]: Changing from RecordingOnly to None
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I Scheduler scheduler.cpp:2356 (HandleReschedule) Reschedule requested for CHECK -9 2 737502 UpdateRecStatus2 | The Late Show with Steven Colbert | 2019-03-19 23:35:00 |  |
Mar 19 23:35:01 puma mythbackend: mythbackend[21548]: I Scheduler scheduler.cpp:2469 (HandleReschedule) Scheduled 18 items in 0.0 = 0.00 match + 0.00 check + 0.01 place
Mar 19 23:35:02 puma mythbackend: mythbackend[21548]: I Scheduler scheduler.cpp:2356 (HandleReschedule) Reschedule requested for MATCH 0 0 0 2019-03-20T17:30:00Z EITScanner
Mar 19 23:35:02 puma mythbackend: mythbackend[21548]: I Scheduler scheduler.cpp:2469 (HandleReschedule) Scheduled 18 items in 0.0 = 0.02 match + 0.00 check + 0.01 place
Mar 19 23:35:05 puma mythbackend: mythbackend[21548]: E JobQueue programinfo.cpp:2608 (GetPlaybackURL) ProgramInfo(1071_20190320063500.ts): GetPlaybackURL: '1071_20190320063500.ts' should be local, but it can not be found.
Mar 19 23:35:05 puma mythbackend: mythbackend[21548]: E JobQueue programinfo.cpp:2608 (GetPlaybackURL) ProgramInfo(1071_20190320063500.ts): GetPlaybackURL: '1071_20190320063500.ts' should be local, but it can not be found.
Mar 19 23:35:05 puma mythbackend: mythbackend[21548]: I Metadata_798 jobqueue.cpp:2157 (DoMetadataLookupThread) JobQueue: Metadata Lookup Starting for "The Late Show with Steven Colbert":"2019-03-19 23:35:00" recorded from channel 1071 at 2019-03-20T06:35:00Z
Mar 19 23:35:07 puma mythbackend: mythbackend[21548]: I ProcessRequest mainserver.cpp:1738 (HandleAnnounce) MainServer: MainServer::ANN Monitor
Mar 19 23:35:07 puma mythbackend: mythbackend[21548]: I ProcessRequest mainserver.cpp:1743 (HandleAnnounce) MainServer: adding: puma(13a6a50) as a client (events: 0)
Mar 19 23:35:07 puma mythbackend: mythbackend[21548]: I ProcessRequest mainserver.cpp:1738 (HandleAnnounce) MainServer: MainServer::ANN Monitor
Mar 19 23:35:07 puma mythbackend: mythbackend[21548]: I ProcessRequest mainserver.cpp:1743 (HandleAnnounce) MainServer: adding: puma(13e0f60) as a client (events: 1)
Anyhow, my machine name is puma, I obscured that before. Thanks for all your help.
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 »

There doesn't appear to be anything wrong with your file system although using the /media root dir wouldn't have been my choice to mount a new internal drive. Maybe /mnt, but I just created a /sdb dir since that's the real drive. Hr3e's mine.
wes@mythfe0:~$ ll /sdb/recordings
total 43740956
drwxrwxrwx 2 wes wes 12288 Mar 20 23:37 ./
drwxrwxrwx 8 wes wes 4096 Dec 23 02:28 ../
-rw-r--r-- 1 mythtv mythtv 14270522204 Mar 20 21:00 1051_20190321000000.ts
-rw-rw-rw- 1 mythtv mythtv 180281 Mar 20 21:07 1051_20190321000000.ts.png
----------
The problem is mythtv is still trying to open the / root dir to store the recording and that's just not going to happen since it doesn't have permission. You need to add /media/dave/movies/mythtv/ to either the default storage dir in setup or create a recordings dir with it in it and do what I said in my earlier post. you're just pissing in the wind now.
And i hate uuid. This is how I mount /sdb.
wes@mythfe0:~$ cat /etc/fstab|grep sdb
/dev/sdb1 /sdb ext4 defaults 0 2
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
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, thanks for the detail. Sure, you can delete all storage groups. Personally,
I'd try to find the cause of the issue (it's even possible that redoing all of them would
result in the same issue, your choice.) Read on if you like.

Can we see the full output of the curl above, not just the R/W settings?

I'd add this in: /etc/mythtv/additional.args

Code: Select all

ADDITIONAL_ARGS="-v record:debug,file:debug --logpath /tmp"
And restart the backend.

Then make a single recording, which we expect will fail. Put the log in
pastebin.com, or any other place you like. Put the link to it here. The
complete log will be in /tmp with an obvious name.

I'm assuming these are recordings, as opposed to LiveTV and/or that since
you've mentioned only using Default as the Storage Group, there's no LiveTV
Storage Group.

Comment out (with a #) the ADDITIONAL_ARGS line and restart again.
You won't want to run with the them for long because it makes for noisy
logs! And you don't want to fill up you /tmp directory.


There is info at backend startup that may be of value. Especially for Storage Groups.
You should see a line containing this:

Code: Select all

CheckAllStorageGroupDirs(): Checking All Storage Group directories
and lines after that for each Storage Group.
Last edited by bill6502 on Thu Mar 21, 2019 7:37 pm, edited 1 time in total.
Reason: Storage Group, not Record Group
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 »

@wesnewell, I'm completely off-topic here, but if you're agree with FHS, the proper
location for MythTV is under /var/lib/mythtv/... . Or, my choice /srv/mythtv/... . Ref:
http://www.pathname.com/fhs/pub/fhs-2.3 ... EDBYSYSTEM
/mnt is the "Mount point for a temporarily mounted filesystem".

But, your computer, your choice.
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 »

Yep, I've also got those.
wes@mythfe0:~$ ls /var/lib/mythtv
banners coverart fanart music screenshots trailers
bare-client db_backups livetv recordings streaming videos

But I like things simple. sda is my main drive (ssd) with system on sda1. sda2 I use for clonezilla backup images because going ssd to ssd is faster. sdb is a 2tb drive where I store all my mythtv recordings and and db backups. Yeah, I know I could mount it as ./var/lib/mythtv, but then I'd have to type all that out instead of just sdb. I'm not a typist either. I also backup to an external drive and also keep the latest sda1 image on a usb drive just in case. Without backups it would take me at least a month to reconfigure all the custom crap I've got. Doing that once was enough for me.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
User avatar
dizygotheca
Developer
Posts: 267
Joined: Wed Sep 03, 2014 9:02 am
Great Britain

Re: Moving storage failed

Post by dizygotheca »

Do all the directories have execute permission as well ?
https://superuser.com/questions/168578/ ... executable

Code: Select all

ls -lad /media
ls -lad /media/dave
ls -lad /media/dave/movies
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 »

@bill6502
Ok I fixed it. Thanks for all your help. I did what you said to increase the logs and it said:

Code: Select all

Group 'Default' references directory '/media/dave/movies/mythtv/' but this directory does not exist.  This directory will not be used on this server
So it had to be some permission issue. It turns out that newer ubuntu sets the permissions with ACL on the /media/username default mount spot for external drives. More about ACL here:

https://help.ubuntu.com/community/FilePermissionsACLs

I must admit that I had never heard of ACL, but when I did ls -l on my /media/dave dir it looked like this:

Code: Select all

drwxrwx---+ 3 root root 4096 Mar 17 13:43 dave
I didn't know what the + sign meant so after a bit of googling I found the above ubuntu page.

I guess I got thrown off as I could make files in directories under "dave" as the mythtv user, but I guess only if I navigated there as user dave first. Good learning experience I guess. Thanks for all your help.
Post Reply