first-level:per-VPS quotas
second-level:per-user and per-group quotas
First-level:
/etc/vz/vz.conf
..........
DISK_QUOTA=yes <---- 可以 per VPS 設定
VZFASTBOOT=no
..........
每個 VPS 的 quota 使用情況記錄在 /var/vzquota/quota.vpsid
而 disk quota 的單位是1024 bytes
Space
Get:
vzquota stat <VEID>
Set:
vzctl set <VEID> --diskspace 10G:11G --save
vzctl set <VEID> --quotatime 600 --save
inodes:
Get:
vzctl exec <VEID> df -i
Set:
vzctl set <VEID> --diskinodes 200000:220000 --save
P.S.
# 若不打開該 VPS 的 first-level quotas,將不能使用second-level quotas設置.
Second-level
# vzctl set 1001 --quotaugidlimit 100 --save
# 100 - means that 100 users inside VE can be limited by disk quota.
直接一次過修改:
/etc/vz/conf/1001.conf
..................................
# Qutoa Setting 10G/200k user:100
DISKSPACE="10000000:11000000"
DISKINODES="200000:220000"
QUOTATIME="600"
QUOTAUGIDLIMIT="100"
..................................
vzdqcheck
VZserver:~#vzdqcheck /vz/private/1001/
P.S.
現在(5-12-11) 支援 ext3/4 的 Second-level Quota
"Alert: Could Not Start Vps, Reason: vzquota : (error) Quota file check sum is invalid for id 14715; file is broken: vzquota on failed [4]:"
vzquota drop 14715