vzquota(8)
πΈ NAME πΈ
vzquota β manipulate containers disk quotas. This is the vzquota(8) Containers manual page, bestie π
β¨ SYNOPSIS β¨
vzquota [quota_options] command quota_id [command_options]
π¦ DESCRIPTION π¦
Okay so vzquota controls disk quotas for Virtuozzo/OpenVZ container. These are per-container disk quotas set from Virtuozzo/OpenVZ host system. No cap, itβs giving host-level quota management energy π
The command can be one of the following: init, drop, on, off, setlimit, setlimit2, reload2, stat, show.
The quota_id must be numeric-only identifier. Note, that quota ID is not the same as container ID (CTID). One container can mount several filesystems and each of them can have its own quotas. So yeah, quota_id is its own main character here π
π OPTIONS π
General
-hβ Print usage information.-Vβ Print utility version.-qβ Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are displayed.-vβ Verbose mode. Causesvzquotato print debugging messages about its progress. Multiple-voptions increase verbosity. Maximum is 2.-bβ Batch mode. in this mode outputs (usually onstatandshowcommands) will be in format better suitable for parsing by a script.
Quota Commands
The following commands are available:
initβ A necessary preliminary for any other quota command work: create a new quota file, calculating current disk usage from given path. This command requires full set of quota soft- and hardlimits given as command-line options. Limits are also stored in quota file, so subsequentvzquota ondoesn't requires any quota limit as command-line parameter, although accepts them as well. New specified limits and flags will also be stored in the quota file.
You can also create your own quota files for arbitrary quota accounting points. Quota file location and path to quota accounting point can be specified via -c and -p options (see below). You can use also -R option instead of -c option, to set relative quota file location. In this case quota file resides one dirrectory upper than quota accounting point and has special name (see below).
dropβ Remove quota file. Command checks if quota is running and refuses to remove file in this case, option-fallows to override that rule.onβ Turn quota on. If previous quota session wasn't switched off properly (quota is not running, but quota file indicates it is), initialization procedure will be performed.-foption allow to force initialization procedure regardless of the shutdown status. Commandondoesn't work in case specified quota id is running.offβ Turn quota off, write usage statistic back to the quota file. Doesn't work if quota file cannot be accessed, also accepts-foption (force switching off, even if usage statistic will be lost). This is possible that quota will still be in a stopped state, even if-fflag is used.setlimitβ Set new quota parameters. Requires at least one quota parameter or flag specified. Applies new parameters immediately if quota with givenquota_idis running. Stores new limits and flags in the quota file. Option-fspecifies to mark quota as dirty, so at the next quota start, disk will be rescanned and usage updated.setlimit2β Set second-level quota parameters. Applies new parameters immediately if quota with givenquota_idis running and second-level quota is on. Stores new limits in the quota file.reload2β Reload second-level quota limits from quota file for givenquota_id.statβ Show usage statistics and update it in quota file. Option-fcauses to do not read and update quota file, just print statistics from kernel. Option-tspecifies to show and update user/group based quota statistics for a container. Works on running containers only. The command with-toption flushes all quota statistics from kernel to file and thus may be used for backup purposes.showβ Show usage and limits info from quota file. Option-tspecifies to show user/group quota information as well.
Setting quota limits
All these options are required in init command, and optionally accepted in on and setlimit commands.
-s,--sub-quotas 1|0β Enables or disables user/group based quota inside the container. Here1means to enable, and0β to disable. By default user/group quota is disabled. This option is accepted byinit,onandsetlimitcommands.-u user_idβ Forsetlimit2command only. Limits will be applied to the specifieduser_id.-g group_idβ Forsetlimit2command only. Limits will be applied to the specifiedgroup_id.-u,--ugid-limit limitβ Foronandsetlimitcommands only. Specifies maximum number of user and group IDs allowed in the container. If the value is0, user/group quota will not be accounted. Default value is0. There is one note concerningsetlimitcommand. If first-level quota is running, second-level quota is active and not all ugid objects were loaded into kernel byoncommand due to insufficientugid_limitvalue (this can be checked by issuingstat -tcommand and observing whether ugid limit was exceeded), thensetlimitwith new limit value updates it in kernel and file but this change does not take immediate effect. Modification will be applied after quota restart.-b,--block-softlimit bslβ Disk quota block soft limit. Soft limit is amount of blocks which excess is allowed in time equalexptime. On the expiration of this time soft limit becomes hard limit. Block limits are set in 1k sized blocks.-B,--block-hardlimit bhlβ Disk quota block hard limit. Hard limit is amount of blocks which excess is not allowed.-e,--block-exptime betβ Disk quota expiration time for excess of a block soft limit. Time can be given in two different formats:dd:hh:mm:ssFor instance:30β 30 seconds;12:00β 12 minutes;20:15:11:00β 20 days, 15 hours, 11 minutesxxA, whereAβh/H(hour);d/D(day);w/W(week);m/M(month);y/Y(year). For instance:7Dβ 7 days;01wβ 1 week;3mβ 3 months
-i,--inode-softlimit islβ Disk quota inode soft limit. Similarly to block soft limit.-I,--inode-hardlimit ihlβ Disk quota inode hard limit.-n,--inode-exptime ietβ Disk quota expiration time for excess of a inode soft limit.
Other options
-p pathβ Point of quota accounting for givenquota_id. This option required forinitcommand and can be used also with any another command to override quota path obtained from quota file. Foronandsetlimitcommands, this option can be used to set and save new quota accounting path for givenquota_id.-Rβ Set special relative path toquota_file. If this option is specified, quota file location will depends on path to quota accounting dir: if your quota accounting path is/path/to/somewhere/than quota file will be/path/to/quota.somewhere. If this option is not specified, quota file location is/var/lib/vzquota/quota.quota_id. All commands accept this option.-c quota_fileβ This option allows to specify aquota_fileto work with. All commands accept this option. If this option is not specified, default file location depends on whether-Roption is specified or not (see above).-fβ Force option. Accepted bydrop,on,off,stat,setlimitandsetlimit2commands. Action of this option differs for different commands and is described above for each command separately.-tβ Forstatandshowcommands only. Processes user/group quota statistics. Specifies whether to show (update in file) user/group quota information.-tβ Forsetlimit2command. Set second-level quota time grace parameters.
π LIMITATIONS π
It is impossible to start or stop quota accounting if the directory given by -p option is busy. This is rather limitation of kernel part of disk quota implementation.
π DISPLAY π
vzquota stat and vzquota show display the following information:
resourceβ Either1k-blocksorinodes.usageβ Current usage of resource.softlimitβ Resource limit. Current usage can exceed this limit up to hard limit during grace time.hardlimitβ Resource limit. Current usage can't exceed this limit.graceβ During this amount of time usage can exceedsoftlimit. If a soft limit has not been exceeded the grace column is blank. If the grace period has expired, the grace column contain specialnonevalue.
In case option -t is specified, the following information is also displayed:
User/group quota:β Status of the 2nd level quota. This can beonoroff,activeorinactive. Valueson/offdefine the state of the 2nd level quota at the next start of container quota. Valuesactive/inactiveindicate the current state of the 2nd level quota in the kernel.Ugids:β Three values are shown:loaded,totalandlimit.loadedis the number of records (uids or gids) in the kernel.totalis the number of unique records located in the kernel and quota file.limitis the current kernel limit of records amount. Note thatloadedandtotalmay be greater thenlimit.Ugid limit was exceeded:β Can beyesorno.yesindicates thatvzquotadid not loaded all records into the kernel. In this case you should reduce the number of unique records (remove files which belong to unnecessary users) or increase the ugid limit. After that you should restart quota.User/group grace times and quotafile flags:β Grace times and quota file flags (internal parameters of standard linux kernel quota v.3).
π₯ EXIT STATUS π₯
okay bestie, when vzquota finishes it tells you exactly how it went, and the number it hands back is the whole story. here's the decoder ring, no cap:
0β it worked!! command executed successfully, we love to see it π1β system error. not us, it's the system π2β usage error. something in how you called it was off π3β Virtuozzo syscall error. the syscall said no β4β quota file error. the quota file is being dramatic π5β quota is already running. girl it's already up π6β quota is not running. and it's supposed to be π³7β can not get lock on this quota id. the lock is taken π8β directory tree crosses mount points. it's giving boundary issues π§9β quota is running but user/group quota is inactive. this one comes back from thestat -tcommand and it's just for info purposes β it does not mean there's an error, so breathe π«Ά10β quota is marked as dirty in file. this one is returned by theshowcommand, again for information purposes, and again it does not indicate an error. it's just dirty, not broken π§Ό11β quota file does not exist. it's not there, bestie π»12β internal error. our bad π13β can't obtain mount point. the mount point is playing hard to get πΈ
lowkey important:9and10are information, not failure. don't panic-fix a thing that isn't broken, iykyk β¨
π COPYRIGHT π
Copyright (C) 2000-2011, Parallels, Inc. Licensed under GNU GPL.
like, iconic of them honestly. licensed under GNU GPL, periodt π
and that's the whole page, bestie!! π this lil manual page is from Virtuozzo/OpenVZ and it's dated 27 Jun 2011, which makes it a genuine vintage queen at this point ππ¦ go forth and quota responsibly, ily, mwah πβ¨π
π¦ where this page comes from
- ubuntu jammy: vzquota 3.1-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms