Re: Dynamic LVM resizing daemon?
On Sun, 2006-09-17 at 23:40 +0200, Petter Reinholdtsen wrote:
> Now that ext3, lvm and the linux kernel support file system resizes
> without umounting, perhaps it is time to create something that
> dynamically increases the file system sizes when they fill up, based
> on some rules.
> For example, /var/ could be increased by 2% every time it is 95% full,
> until it reaches 10 GiB, or /var/opt/ltsp/swapfiles/ could be
> increased by 128 MiB every time there is less than 64 MiB left, until
> it occupies 10% of the LVM volume group. Every time it resizes a file
> system, the sysadmin should get some notification.
> I suspect this should be possible to implement in some script
> language. Anyone know if a similar system already exist? If we had
> such system, the need to manually adjust the file system sizes should
> be drastically reduced.
sounds like a job for cfengine.
one could do everything from cfengine, but it would be easier to do some
proper error checknig in a script. and one must run cfengine from cron,
something i feel we should work towards anyway.
untested example full of typoes and logical faults.
#/filesystem freespace=size-limit define=class-list(,:.)
/var/opt/swapfiles freespace=64mb define=needmoreswap
if [ mountpoint -q /var/opt/swapfiles ] ; then
partition=$(mount | grep /var/opt/swapfiles | cut -d" " -f1)
lvresize -L +128M $partition && resize2fs $partition