[mythtv-users] Disk space is not freed from deleted recording until mythbackend exits
Yeechang Lee
ylee at pobox.com
Fri Aug 18 13:56:35 UTC 2006
Jim O'Neill <oneillji at gmail.com> says:
> I just created a script to execute df every 60 seconds and ran this
> for about 20 minutes between recordings. I'm seeing 500 KB +/- a
> few bytes being deleted every minute. If my math is correct this
> works out to 16 = hours to completely delete a 500 MB recording.
I can testify that the truncation method works, and works well;
however I don't know which of the patches listed at
<URL:http://svn.mythtv.org/trac/ticket/1835> are in the current SVN,
and if 1835-v5.patch is anything like 1835-v4.patch it may be
broken. Please see
<URL:http://www.gossamer-threads.com/lists/mythtv/users/208763#208763>
for my experiences with different iterations of the patch with
0.19-fixes.
I currently use the following patch on gradual-delete3.patch:
*** gradual-delete3.patch 2006-06-14 23:36:17.571885518 -0700
--- gradual-delete3.patch.orig 2006-06-12 18:15:14.548890000 -0700
***************
*** 86,99 ****
+int MainServer::TruncateAndClose(int fd, QString filename)
+{
+ QMutexLocker locker(&truncatelock);
! + const int sleep_time = 15; // time between truncation steps in seconds
+ int err;
+ size_t increment;
+ struct stat buf;
+
+ // Compute the truncate increment such that we delete 20% faster than the
+ // maximum recording rate.
! + increment = (m_expirer->MaxRecordRate() * sleep_time * 9) / 5;
+
+ VERBOSE(VB_FILE,
+ QString("Truncating '%1' by %2 MB every %3 seconds")
--- 86,99 ----
+int MainServer::TruncateAndClose(int fd, QString filename)
+{
+ QMutexLocker locker(&truncatelock);
! + const int sleep_time = 2; // time between truncation steps in seconds
+ int err;
+ size_t increment;
+ struct stat buf;
+
+ // Compute the truncate increment such that we delete 20% faster than the
+ // maximum recording rate.
! + increment = (m_expirer->MaxRecordRate() * sleep_time * 6) / 5;
+
+ VERBOSE(VB_FILE,
+ QString("Truncating '%1' by %2 MB every %3 seconds")
In case the annoyingly-broken mailserver breaks the patch's
formatting, the only changes I've made are to adjust sleep_time to 15
and "sleep_time * 9) / 5;" to "sleep_time * 6) / 5;".
--
Yeechang Lee <ylee at pobox.com> | +1 650 776 7763 | San Francisco CA US
More information about the mythtv-users
mailing list