[Solved] Deleting a recording fails to delete the associated media files

For discussion of topics specific to MythTV on linux
Post Reply
williamatwood
Junior
Posts: 39
Joined: Sun Feb 12, 2017 8:08 pm
Canada

[Solved] Deleting a recording fails to delete the associated media files

Post by williamatwood » Mon Oct 15, 2018 2:55 am

Hello,

I am running Mythtv 0.28.2-6-g9031599 on Ubuntu 16.04.5 LTS. I have 240 GB of my internal hard drive for Ubuntu, and a 2 TB external hard drive on which I store the media files for recordings of TV shows. Rather than modify the location of the "default" folder in Mythtv, I have a soft link from /var/lib/mythtv/default to the place on the 2 TB drive where the files are actually stored. This seems to confuse the Mythtv file deletion algorithm; the "space available", as reported by my Kodi front end, drops to a certain value (about 200 GB), and then recordings begin to fail. (I suspect that this is due to the external disk being full, but I am not certain of this.)

Since Mythtv does not delete for me, I need to delete no-longer-desired recordings manually. I discovered one way to do this a few months ago, and did a cleanup, which restored my ability to record for a while. Unfortunately, I do not remember the details of the approach that I was using at that time.

Recently my (Media) disk became full again, and I asked on the forum; the suggestion was given to use "D" after positioning on a recording to be deleted in the "Previously Recorded" list, and indeed the recording disappears from the list of available recordings.

However, the files containing the recorded program (.ts and .ts.png) do not get removed.

I am pretty good at Linux, and understand the very basic operation of mysql. Can someone walk me through the debugging (what logs to post, what things to explore, etc.) to try and determine why I am not getting rid of the associated files?

Bill

wesnewell
Senior
Posts: 382
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Deleting a recording fails to delete the associated media files

Post by wesnewell » Mon Oct 15, 2018 12:50 pm

If you didn't want them in /var/lib/mythtv/default, why didn't you just change the storage group to where you actually wanted them to end up. For instance, my default storage group is /sdb/default and my recordings storage group is at /sdb/recordings, a separate drive from my boot drive. You can also specify more than one place for each storage group in the backend setup and myth will use all the different places to store the files.
BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

williamatwood
Junior
Posts: 39
Joined: Sun Feb 12, 2017 8:08 pm
Canada

Re: Deleting a recording fails to delete the associated media files

Post by williamatwood » Wed Oct 17, 2018 12:54 am

Thank you for the hints about changing the storage group. I will make those changes once I get my file space back.

My real concern is that deleting the recording using "D" did not delete the associated media file. (I understand, from some other reading, that it may have only "enabled" the deletion, but the deletion itself has not happened after several days, and I can no longer make new recordings.)

So, my question remains: how do I go about determining what is failing, and fix it, so that I can again record shows?

Bill

wesnewell
Senior
Posts: 382
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Deleting a recording fails to delete the associated media files

Post by wesnewell » Wed Oct 17, 2018 4:12 am

Pull up any file manager and delete the files manually. If you don't have permissions to do so, then su to root first or change permissions to give yourself access to do so.
BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

User avatar
paulh
Developer
Posts: 358
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Deleting a recording fails to delete the associated media files

Post by paulh » Wed Oct 17, 2018 8:57 am

I wouldn't use the file manager to delete them that will really confuse Myth and make things worse.

If you go to the System Status screen and in the last tab "Auto Expire List" can you see the Recordings you deleted there? If you select one on there and choose "Delete Now" does it get deleted (it may take a few minutes if it is a large file and if slow deletes are being used)?

I suspect what you are seeing is the files you delete are just marked to auto expire so you can if required un-delete them later. They should be deleted properly when the disk space is needed for new recordings but sounds like that may not be working for you. Usually when this happens it is due to file permissions caused by running the BE under different users at different times in my experience.

User avatar
dizygotheca
Developer
Posts: 247
Joined: Wed Sep 03, 2014 9:02 am
Great Britain

Re: Deleting a recording fails to delete the associated media files

Post by dizygotheca » Wed Oct 17, 2018 12:16 pm

use "D" after positioning on a recording to be deleted in the "Previously Recorded" list, and indeed the recording disappears from the list of available recordings.
The "Previously Recorded" list shows the history log. Deleting things there only declutters the log; it won't delete any recordings.
To delete recordings press "D" on the "Watch Recordings" screen/list.
Easier to press "M" (for Menu) and select an option. That should explain what you're about to delete.

wesnewell
Senior
Posts: 382
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Deleting a recording fails to delete the associated media files

Post by wesnewell » Thu Oct 18, 2018 3:17 pm

william...
You need to use the delete "D" in the Watch Recordings to delete the recordings. Deleting them from the previous recordings list won't delete the actual recordings, just removes them from that list so myth won't see them as previously recorded for the scheduler. If they don't show up in the watch recordings list of myth, it's perfectly safe to delete them manually. I've done it many times, or moved them to the videos dir if I haven't seen them and want to watch them later.
BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

williamatwood
Junior
Posts: 39
Joined: Sun Feb 12, 2017 8:08 pm
Canada

Re: Deleting a recording fails to delete the associated media files

Post by williamatwood » Sat Oct 20, 2018 1:08 am

Thank you, all who commented.

The comment by dizygotheca got me to the correct screen to do the deletions, and the comment by paulh allowed me to see the recordings move into the auto expire list, and then actually get deleted some time later (more than a few minutes; less than 8 hours).

Post Reply