[mythtv-users] Cant delete programs when HD files up

chris at cpr.homelinux.net chris at cpr.homelinux.net
Wed Nov 30 00:15:17 EST 2005


On Tue, Nov 29, 2005 at 09:47:57AM -0600, Dave Sherohman wrote:
> As seen in `man mke2fs`:
>        -m reserved-blocks-percentage
>               Specify  the  percentage  of  the filesystem blocks
>               reserved for the super-user.  This  value  defaults
>               to 5%.
> 
> The purpose of this is basically to ensure that user processes are
> not able to bring the system down by filling up the disk, preventing
> root-owned daemons from being able to function.

I did some investigation (thanks, Google!) and found out that while the 
reservation does allow root (and some daemons) to keep running when a 
user has filled the disk, the main reason it was set at 5% was because 
ext2/ext3 have problems with fragmentation and start thrashing at the 
95% full mark.  Filesystems that don't have fragmentation problems 
reserve little or no space for root.  If you are only using an 
ext2/ext3 partition to store large files then you can use tune2fs to 
reduce the reserved space.

This may or may not be a red herring, though.  It depends on how 
MythTV's auto-expire is checking the free space.  The only safe way is 
to use the statfs call and check the f_bavail value as it corrects for 
the reservation while f_bfree does not.

The values reported in 'df' demonstrate the space lost to the 
reservation.  I created a 8Mb file and formatted it with an ext2 
filesystem with '-m 50' to reserve half of the space.  After mounting 
it via '-o loop' the df results are:

Filesystem           1K-blocks      Used Available Use% Mounted on
/home/chris/test.bin      7931         1      3880   1% /home/chris/test

The file was large enough to hold 8192 blocks, but some was skipped to 
leave room for a boot sector and superblock.  Of the remaining 7931 
blocks, 1 holds the filesystem's root directory, 3880 are free, and 
4050 are "missing" since only root can use them.

-- 
Joke template: Three guys walk into a bar. One of them is a wee bit
stupid, and the whole scene unfolds with a tedious inevitability.


More information about the mythtv-users mailing list