Disk Limits and Quota

From Linux-VServer

Revision as of 23:54, 10 July 2009 by 190.160.40.243 (Talk)

Jump to: navigation, search

Introduction

We call Disk Limit a disk space limit in a filesystem for one context (i.e. VServer). If you are interested in using user/group quotas inside a VServer, this is not the right place, look at the Quotas page.

Of course, you can also use a dedicated partition (or logical volume) for each guest, which is another way to limit disk space usage per guest.

Activating disk limits

For VServer version 2.0, please read http://oldwiki.linux-vserver.org/Disk+Limits

For VServer 2.2+, the procedure is nearly the same, only the mount option has changed:

  1. Activate the XID tagging on the filesystem hosting the VServer, using the tag mount option. You cannot use the remount option to add the tag on an already mounted filesystem. Be warn, it is not advised to use it on the root filesystem! In the next example, we use the /dev/sdb1 partition to host all the guests, under the /vservers directory
    mount -o tag /dev/sdb1 /vservers
  2. Consider modifying your /etc/fstab file if necessary, to make the mount option persist across reboots
  3. Tag the files belonging to the VServer with its XID
    chxid -URx -c vs_name /vservers/vs_name 
  4. Write the limits under the /etc/vservers/vs_name/dlimits directory :
    1. Create this directory if necesary
    2. Create one sub-directory for each filesystem (in most cases, you should have only one), using any identifier (for example root)
    3. Under /etc/vservers/vs_name/dlimits/root/ create the following files :
      1. directory : contains the directory to which the limit should be applied
      2. inodes_total : the amount of inodes this vserver should be limited to
      3. reserved : how much space (percentage-wise) should be reserved for the root user
      4. space_total : the amount of space this vserver should be limited to (measured in blocks of 1024 bytes)


More information

Personal tools