OpenVZ quota bug

Here one can find interesting information about OpenVZ management and maintenance. OpenVZ control panels information also goes here

OpenVZ quota bug

Postby lik » Wed Jun 29, 2011 10:45 am

Can't find filesystem to check or filesystem not mounted with quota option
http://bugzilla.openvz.org/show_bug.cgi?id=1904

(0) Traditionally, /etc/mtab is a symlink to /proc/mounts in all the templates
we provide. This is for df utility to work.

(1) When quotaugidlimit is set, vzctl used to (via set_ugid_quota.sh dist
script that creates /etc/init.d/vzquota script inside a CT) delink /etc/mtab
and make it a file with grpquota,usrquota options, for quota* utilities to
work.

(2) Newer quota tools (quota-3.17 in Fedora 14, quota-4.0 in latest Ubuntu) now
read /proc/mounts directly, so (1) is not working.

(3) Therefore, newer OpenVZ kernels add grpquota,usrquota options directly to
/proc/mounts for the newer quota tools to work.

(4) quotaon and quotacheck utilities are sensible to value of filesystem field
in /etc/mtab (or /proc/mounts) -- i.e. the third field. These utils have a list
of recognized file systems and reject others (such as simfs).

(5) Therefore, newer OpenVZ kernels check the name of the process reading
/proc/mounts, and for quotaon and quotacheck they show fs as ext3. You can
check that by doing 'cat /proc/mounts; cp /bin/cat ./quotaon; ./quotaon
/proc/mounts'

(6) Therefore, recent vzctl (3.0.28) has set_ugid_quota.sh script modified: it
now does what is described in item (1) conditionally -- if usrquota,grpquota
options are already there, it skips making /etc/mtab, leaving it a symlink to
/proc/mounts.

(7) The above modification also changed the filesystem type from 'reiserfs' to
'simfs'.

(8) While quotaon is happy with ext3, quotacheck has some additional
assumptions about ext3 -- it tries to do something extra and fails. Ancient
authors of vzctl knew that and this is because they put 'reiserfs' as a
filesystem in /etc/mtab. Modern authors of the OpenVZ kernel and vzctl forgot
about that and put ext3, so quotacheck fails.

(9) Alternatively, one can put 'simfs,ext3' as a filesystem value: quotaon sees
ext3 which makes it happy, and quotacheck sees ext3 which make it happy, but
then because of simfs it doesn't try to do extras for ext3.

(10) By the way, running quotacheck inside CT is useless -- quota is
initialized from CT0 using vzquota util (which is hidden behind vzctl but can
be used directly if you like, see vzquota man page).

Now to the conclusions.

A. Kernel needs to be fixed to have something other than ext3 ('reiserfs' or
'simfs,ext3') in filesystem field for /proc/mounts inside CT.

B. vzctl needs to be fixed to have something other than simfs ('reiserfs' or
'simfs,ext3') in filesystem field for /etc/mtab inside CT.

C. quota utils are complicated to deal with, and generally this world is tough.
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to OpenVZ related

 


  • Related topics
    Replies
    Views
    Last post
cron