[mythtv-users] deleted files not gone, taking up space

David Scammell davescammell at gmail.com
Mon Jun 17 23:17:49 UTC 2013


Hi all,

While browsing about myth I happened to be looking at
http://mbe-address:6544/ in the information/backend status area I found
'space used by deleted recordings to have a large amount (100GB+). While no
significant deletes or auto expires were underway.

With a little poking about in the database I found the deletepending column
of the recordings table had a number of entries with a value of 1, most of
these stretching back to when I had a mythtv bug causing the backend to
delete/expire recordings prematurely and then die, last year.

I speculate that if a recording is deleted or expired and then the backend
fails before the actual recording and metadata are removed, the file and
recording row will become orphaned but still take up space on disk.

I guess its possible many people would have one of more files like this, if
your backend has ever failed then its possible.  This bit of sql should
show all pending deletes, those in the delete recording group and any
'extras' you may have:
select * from recorded where deletepending=1;

I ran into the database:
update recorded set deletepending=0 where deletepending=1;
[the where clause may well be unnecessary]

It did kill my mbe, so I recommend doing this with your backend(s)
shutdown. After restarting I can now see all of the recordings which were
supposedly removed previously while I had the bug last year, these will
shortly expire (being old) and I'll get my space back.

Perhaps mythbackend should clear this flag on startup, to make the files
re-appear or restart the slow delete process with data from the recorded
table where the flag set. I dunno exactly what the correct behaviour should
be.

I hope this helps someone else. have fun.
dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130618/630ae18f/attachment.html>


More information about the mythtv-users mailing list