Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 28 Jan 2012 04:31:49 +0400
From: "Dmitry V. Levin" <ldv@...linux.org>
To: owl-dev@...ts.openwall.com
Subject: Re: disk quotas lost on unclean shutdown

Hi,

On Sat, Jan 28, 2012 at 03:31:34AM +0400, Solar Designer wrote:
> Dmitry, all -
> 
> Here's a problem: after a system that uses both OpenVZ per-container
> disk quotas and the regular per-user disk quotas inside containers is
> shutdown uncleanly (e.g., on a power outage), the per-user quotas set or
> changed during its previous uptime and per-user disk usage info changes
> are lost.
> 
> We have this cron job (suggested by Dmitry) that I had hoped would be
> helping against this problem:
> 
> # Update /var/vzquota/quota.* files, which is desirable such that the
> # containers' recorded disk usage is closer to the actual one and, even more
> # importantly, such that any per-user and per-group quotas are recorded (not
> # only usage, but also the quotas themselves).  Without a cron job like this,
> # if the server crashes, then not only the recorded usage will be way off, but
> # also any manually set per-user and per-group quotas inside the containers
> # will be lost.
> 2,7,12,17,22,27,32,37,42,47,52,57 * * * * root /usr/sbin/vzlist -H -o veid | xargs -r -n1 /usr/sbin/vzquota stat > /dev/null
> 
> However, in practice it only helps preserve the per-container quotas and
> disk usage info, but not per-user inside containers.
> 
> Any recipe for preserving the latter as well?

Try to add "-t" option to "vzquota stat", e.g.
/usr/sbin/vzlist -H -o veid | xargs -i /usr/sbin/vzquota stat '{}' -t > /dev/null

According to documentation, it should do the right thing, but I wouldn't
volunteer to make an experiment.

> At least, it looks like we'll need to edit the comment text above such
> that it won't claim that this cron job achieves more than it actually does.


-- 
ldv

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ