[mythtv-users] auto stop record
Joseph A. Caputo
jcaputo1 at comcast.net
Wed Feb 22 14:53:06 UTC 2006
On Wednesday 22 February 2006 8:52, CyberSource wrote:
> Michael T. Dean wrote:
> > On 02/21/2006 08:41 AM, CyberSource wrote:
> >> I have the auto stop record set to 300mb but twice now I have had
> >> people that I have setup screw up their Linux systems because the
> >> recordings went over and filled up the entire hard drive. I was
> >> able to fix after but this is not cool. Can anyone tell me what I
> >> might be missing that the auto stop record function does not work?
> > Truthfully, you're missing autoexpire.
> > That being said, though, also realize that the "auto stop record"
> > is actually:
> > New Recording Free Disk Space Threshold (in Megabytes)
> > MythTV will stop scheduling new recordings on a backend when its
> > free disk space falls below this value.
> > Which means that if you've set the MinRecordDiskThreshold to 300MB
> > and your disk has 301MB available when a recording is scheduled to
> > begin, Myth will start the recording. Then, with a very low
> > bitrate (low-quality) recording, 20 minutes later you will have
> > exhausted the disk space. If your bitrate is higher, you'll run
> > out of space in less time.
> > Note, also, that there's a setting:
> > Extra Disk Space (in Gigabytes)
> > Extra disk space you want on the recording file system beyond what
> > MythTV requires. This is useful if you use the recording file
> > system for data other than MythTV recordings.
> > But, I don't think this will cause Myth to halt a recording in
> > progress, either.
> > The only way to prevent filling the disk is manual disk space
> > management (delete the files before you can run out of space) or
> > autoexpire. The preferred approach is autoexpire.
> > Mike
> Hello Michael,
> Thanks for the reply. I don't like the sound of either option, I
> wouldn't want someone to loose a good recording they have because it
> timed out and the other option just fills up the drive anyway, or at
> least that's how I'm reading your reply.
> I have had the following happen,
> 1. The guy goes to record a 6 hour nascar show, not thinking how huge
> this will be, it fills up his hard drive completely, Linux can't
> boot, inodes get lost, I end up having to boot his system with a
> rescue cd to fix the lost inodes, etc.
> 2. Another guy sets his system to record CIS whenever it's on and
> forgets about it, fills up his hard drive, same as above.
> Probably the safest way would be to have a separate partition for
> the holding of the recordings, etc. This way the whole system wouldnt
> come to a crashing halt.
BINGO! I would *definitely* recommend keep your recordings storage on a
separate partition or drive from your root filesystem. At the very
least, /var should be on a different filesystem from your recordings
(since this is mostly where other processes write things). This should
allow the system to keep running nicely even if the recordings
partition fills up.
> I would like to have some option in Myth so
> that I can say, when there is like 500MB left, stop recording. I
> currently have the 300MB option (that's the default in .018 anyway)
> and it didnt work in either instance, it just filled up the drive
> completely anyway, so I was wondering if I missed another choice that
> is suppose to go with it, i.e. the way skip commercials has all the
> options but will not do anything without the one choice as to
> actually do it (notify, skip, etc.)
No, there is no option to automatically stop an in-progress recording
whtn disk space gets too low. That's why it's important to (1) keep
your recordings on a separate partition, and (2) set your "New
Recording Free Disk Space Threshold (in Megabytes)" to a large enough
value. To find a "large enough" value, try:
- for each tuner:
- calculate the maximum size of a recording at the highest quality
profile. This can be figured as:
<max bitrate> * <max length in seconds> / 8 = <max size in bytes>
3 hours (10800 seconds) is probably a good maximum length to figure on,
as it should allow for most sporting events and movies.
Do this for each tuner and sum up the result, then add some padding.
That should be the minimum disk space you need to start a new recording
and virtually guarantee that you'll have enough disk space to finish
Note that this calculation will not be 100% effective if you have other
processes writing to your video partition (i.e., you don't have a
separate partition for at least /var, if not your whole root
filesystem), as Myth cannot account for simultaneous disk space
consumption by other processes.
Also, even if you have / or /var on a separate partition, your system
can still get screwed up. Processes are constantly writing log files
to /var, thus changing the amount of free space on the disk.
Mythbackend can fill up a /var partition pretty quickly if something
goes wrong with a tuner or a recording. Two ways to mitigate this are
(1) configure logrotate appropriately to prevent mythbackend's log file
from getting too big over the long term, and (2) lower the verbosity of
mythbackend's logging for production systems.
More information about the mythtv-users