[Users] disk use/empty files question

Kirill Kolyshkin kolyshkin at gmail.com
Thu May 31 16:26:22 EDT 2012


On 31 May 2012 23:41, Keith Keller <kkeller at wombat.san-francisco.ca.us> wrote:
>
> Hello openvz users,
>
> I am brand new to OpenVZ, evaluating it to see if it will work in my
> environment.  I have been playing around, and had a question about disk
> usage.
>
> I noticed that, when I first started using my new VZ container, that df
> always reported 0 blocks in use:
>
> # df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/simfs            693G     0  693G   0% /
> none                   16G  4.0K   16G   1% /dev
>
> This is even after having copied quite a bit of data into the container.


Assuming you don't have DISK_QUOTA=no in global config (ie /etc/vz/vz.conf),
the figures shown come from vzquota, and in order for vzquota to work correctly
when you want to copy something to container you have to have it mounted (ie
vzctl status 21 should show the word 'mounted' among others) and copy the
data to VE_ROOT (ie /vz/root/21) but not to VE_PRIVATE (/vz/private/21).

If you have already done it wrong (I assume you did *), you have to recalculate
vzquota, the easiest way is to stop container, do vzquota drop 21 and
start container
again. This should fix your issue.

* what happened I guess is you have copied something big to under /vz/private/21
(bypassing vzquota) and then removed it from either /vz/root/21 or
right from inside the container
(not bypassing the vzquota), leading to disk space being accounted on
removal and the negative
result, which is shown as 0.

A nice alternative is to use ploop (http://wiki.openvz.org/Ploop)
instead of simfs+vzquota.
But I suggest you to fix your problem first.

>
> Recently, the hardware node seems to have had a hard crash (which I'm
> still checking out).  On restart, a large number of files that I'd
> previously added were truncated to be empty, for example:
>
> # ls -l /usr/lib64/libMagickWand.so.2.0.0
> -rwxr-xr-x 1 root root 0 May  7 12:07 /usr/lib64/libMagickWand.so.2.0.0


I believe this is because of file system crash and the fsck (or journal replay)
which truncated your files. In other words, this is not directly
related to what you
have described above.

Speaking of kernel crashes, it's nice to have some console logger installed,
such as netconsole so whenever you have an oops you can report the bug.
See http://wiki.openvz.org/Remote_console_setup

>
> I'm not sure how to interpret these events.  Could they possibly be
> related?  Is there an issue with my configuration that's causing
> problems with container storage?

Configuration below looks fine to me, except...

>
> I am using a CentOS 6.2 on the hardware node, and the stock packages
> available from the OpenVZ repos.  In addition, after the file size issue
> occurred I modified the VZ's config to increase the disk space limits
> (it was previously 2G:1000G), which I wonder might be the cause.
>
> Some additional info below.  If you need any more details please let me
> know.  Thanks!
>
>
>
> # uname -a
> Linux dhcp-128-32-252-85.lips.berkeley.edu 2.6.32-042stab055.10 #1 SMP
> Thu May 10 15:38:32 MSD 2012 x86_64 x86_64 x86_64 GNU/Linux
>
> # rpm -qa |grep vz
> vzctl-3.2.1-1.x86_64
> vzkernel-firmware-2.6.32-042stab055.10.noarch
> vzctl-lib-3.2.1-1.x86_64
> vzquota-3.0.12-1.x86_64
> vzkernel-2.6.32-042stab055.10.x86_64
>
> # cat /etc/vz/conf/21.conf
>
> # RAM (this particular server has 128GB of physical memory)
> PHYSPAGES="0:32G"
>
> # Swap
> SWAPPAGES="0:512M"
>
> # Disk quota parameters (in form of softlimit:hardlimit)
> DISKSPACE="1000G:2000G"


It looks like you have set disk quota values to more than your really
have. Since this doesn't make sense
my question is -- did you meant to disable disk space limit entirely?
If yes, you can just have
DISK_QUOTA=no in this config.


> DISKINODES="400000:500000"
> QUOTATIME="0"
>
> # CPU fair scheduler parameter
> CPUUNITS="1000"
> VE_ROOT="/vz/root/$VEID"
> VE_PRIVATE="/vz/private/$VEID"
> OSTEMPLATE="centos-6-x86_64"
> ORIGIN_SAMPLE="vswap-256m"
> FEATURES=" nfs:on"
>
>
> --
> kkeller at wombat.san-francisco.ca.us
>
>
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users



More information about the Users mailing list