VPS quota allows you to specify limits on two aspects of disk storage for your
Virtual Private Server:
- the number of inodes a user or a group of users may have;
- the number of disk blocks that may be allocated to a user or a group of users.
To enable VPS quota for all Virtual Private Servers, you need to have:
- freevps kernel (build 1056256121 or higher) installed on the host box
(steps 4-5 of VPS upgrade procedure);
- the Linux virtual server utilities (vserver-0.22-1 package)
(step 8 of VPS upgrade procedure);
- new freevps-tools (freevps-tools-x.x-n package) installed on the host box
(step 9 of VPS upgrade procedure);
- H-Sphere VPS scripts (hsphere-vps-x.x-n package) this is not necessary
(step 10 of VPS upgrade procedure);
- new quota-3.03-2 package for Virtual Private Servers installed on all VPS.
Remember that quota-3.03-2 package is only for VPS installation!
Virtual Private Servers update, if hsphere-vps-x.x-n package is installed
(see VPS upgrade)
installs quota-3.03-2 on all existing Virtual Private Servers,
enables quota on root partition (/) and
configures VPS to turn on/off quotas at the VPS start/stop.
To install quota-3.03-2 manually, you need to:
To reconfigure quota on Virtual Private Server:
- Enter Virtual Private Server:
if hsphere-vps-x.x-n package is installed
# cd /hsphere/shared/scripts/
# ./vps-enter VPS_NAME
or log into it with SSH:
# ssh root@VPS_NAME (or # ssh root@VPS_IP_ADDRESS)
or use vserver script (if VPS is running)
# /usr/sbin/vserver <VPS_NAME> enter
here VPS_NAME - name of Virtual Private Server (VPS_IP_ADDRESS - VPS IP address)
- If the /dev/hdv1 block special file does not exist, create it:
touch /dev/hdv1
- Modify /etc/fstab
Partitions where quota is not yet enabled normally look like:
/dev/hdv1 / ext2 defaults 1 1
To enable user quota on a file system (for example, on the root partition),
add "usrquota" to the fourth column - the one that contains the word "defaults"
(refer to man fstab for details):
/dev/hdv1 / ext2 defaults,usrquota 1 1
To enable both user quota and group quota on a file system:
/dev/hdv1 / ext2 defaults,usrquota,grpquota 1 1
By default, your Virtual Private Servers are to be configured with user and group quota
enabled on the root partition (/).
- Make sure that the following line is present in /etc/mtab:
/dev/hdv1 / ext2 rw,usrquota,grpquota 0 0
- Activate quota software by running quotacheck.
This will generate the files to maintain the quota databases
(refer to man quotacheck for more details):
# /sbin/quotacheck -avugm
Here:
-a - check quota for all mount points specified in /etc/fstab
-m - creates quota files
-u - check user quota
-g - check on group quota
-f - forces check
- quotaon and quotaoff
quotaon is used to turn on quota accounting:
# quotaon -augv
Run quotaoff to turn it off:
# quotaoff -augv
These commands are executed at the Virtual Private Server start and stop, respectively.
- Check the quota information for mountpoints:
# repquota -a
or
# quotastats
|