Quota 相關的命令
Quota 相關的幾個命令如下。啟用quota:quotaon
[root@rhce /]# quotaonBad number of arguments.
quotaon: Usage:
quotaon [-guvp] [-F quotaformat] [-x state] -a
quotaon [-guvp] [-F quotaformat] [-x state] filesys ...
-a, --all turn quotas on for all filesystems
-f, --off turn quotas off
-u, --useroperate on user quotas
-g, --group operate on group quotas
-p, --print-state print whether quotas are on or off
-x, --xfs-command=cmd perform XFS quota command
-F, --format=formatnameoperate on specific quota format
-v, --verbose print more messages
-h, --helpdisplay this help text and exit
-V, --version display version information andexit
關閉quota:quotaoff
[root@rhce /]# quotaoffBad number of arguments.
quotaoff: Usage:
quotaoff [-guvp] [-F quotaformat] [-x state] -a
quotaoff [-guvp] [-F quotaformat] [-x state] filesys ...
-a, --all turn quotas off for allfilesystems
-f, --off turn quotas off
-u, --useroperate on user quotas
-g, --group operate on group quotas
-p, --print-state print whether quotas are on or off
-x, --xfs-command=cmd perform XFS quota command
-F, --format=formatnameoperate on specific quota format
-v, --verbose print more messages
-h, --helpdisplay this help text and exit
-V, --version display version information andexit
配額傳送警告:warnquota
[root@rhce /]# warnquota -hwarnquota: Usage:
warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile][-a adminsfile]
-u, --user warn users
-g, --group warn groups
-s, --human-readable send information in more humanfriendly units
-i, --no-autofsavoid autofs mountpoints
-d, --no-details do not send quota informationitself
-F, --format=formatname use quotafiles of specific format
-c, --config=config-file non-default config file
-q, --quota-tab=quotatab-file non-default quotatab
-a, --admins-file=admins-file non-default admins file
-h, --help display this help messageand exit
-v, --version display version informationand exit
Bugs to [email protected]
[root@rhce /]#
編輯配額屬性:edquota
[root@rhce /]# edquotaedquota: Usage:
edquota [-rm] [-u] [-F formatname] [-p username] [-f filesystem]username ...
edquota [-rm] -g [-F formatname] [-pgroupname] [-f filesystem] groupname ...
edquota [-rm] [-u|g] [-F formatname] [-f filesystem] -t
edquota [-rm] [-u|g] [-F formatname] [-f filesystem] -Tusername|groupname ...
-u, --user edit user data
-g, --group edit group data
-r, --remote edit remote quota (via RPC)
-m, --no-mixed-pathnames trim leading slashes from NFSv4mountpoints
-F, --format=formatname edit quotas of a specific format
-p, --prototype=name copy data from a prototype user/group
--always-resolve alwaystry to resolve name, even if it is
composed only ofdigits
-f, --filesystem=filesystem edit data only on a specific filesystem
-t, --edit-periodedit grace period
-T, --edit-times edit grace time of a user/group
-h, --help display this help text andexit
-V, --versiondisplay version informationand exit
Bugs to: [email protected]
[root@rhce /]#
顯示配額信息:repquota
[root@rhce /]# repquota -hrepquota: Utility for reporting quotas.
Usage:
repquota [-vugsi] [-c|C] [-t|n] [-Fquotaformat] (-a | mntpoint)
-v, --verbosedisplay also users/groups withoutany usage
-u, --user display information aboutusers
-g, --groupdisplay information aboutgroups
-s, --human-readable show numbers in human friendly units(MB, GB, ...)
-t, --truncate-names truncate names to 8 characters
-p, --raw-graceprint grace time in seconds sinceepoch
-n, --no-names do not translate uid/gid to name
-i, --no-autofsavoid autofs mountpoints
-c, --batch-translation translate big number of ids at once
-C, --no-batch-translationtranslate ids one by one
-F, --format=formatname report information for specific format
-h, --help display this help message andexit
-V, --versiondisplay version information andexit
檢查並修復quota 配置檔案:quotacheck
#quotacheck –cvug/tmp
[root@rhce ~]# quotacheck -h
Utility for checking and repairing quotafiles.
quotacheck [-gucbfinvdmMR] [-F<quota-format>] filesystem|-a
-u, --user check user files
-g, --groupcheck group files
-c, --create-files create new quota files
-b, --backup create backups of old quota files
-f, --forceforce check even if quotas areenabled
-i, --interactive interactive mode
-n, --use-first-dquot use the first copy of duplicated structure
-v, --verboseprint more information
-d, --debugprint even more messages
-m, --no-remount do not remount filesystem read-only
-M, --try-remount try remounting filesystem read-only,
continue even if itfails
-R, --exclude-root exclude root when checking allfilesystems
-F, --format=formatname check quota files of specific format
-a, --allcheck all filesystems
-h, --help display this message and exit
-V, --versiondisplay version information andexit
Bugs to [email protected]
[root@rhce ~]#
[root@rhce ~]#quotacheck -cvug /dave
quotacheck: Your kernel probably supportsjournaled quota but you are not using it. Consider switching to journaled quotato avoid running quotacheck after an unclean shutdown.
quotacheck: Scanning /dev/sdc1 [/dave] done
quotacheck: Cannot stat old user quotafile: No such file or directory
quotacheck: Cannot stat old group quotafile: No such file or directory
quotacheck: Cannot stat old user quotafile: No such file or directory
quotacheck: Cannot stat old group quota file:No such file or directory
quotacheck: Checked 3 directories and 2files
quotacheck: Old file not found.
直接設定配額:setquota
[root@rhce ~]# setquota -hsetquota: Usage:
setquota [-u|-g] [-rm] [-F quotaformat] <user|group>
<block-softlimit> <block-hardlimit> <inode-softlimit><inode-hardlimit> -a|<filesystem>...
setquota [-u|-g] [-rm] [-F quotaformat] <-p protouser|protogroup><user|group> -a|<filesystem>...
setquota [-u|-g] [-rm] [-F quotaformat] -b [-c] -a|<filesystem>...
setquota [-u|-g] [-F quotaformat] -t <blockgrace><inodegrace> -a|<filesystem>...
setquota [-u|-g] [-F quotaformat] <user|group> -T<blockgrace> <inodegrace> -a|<filesystem>...
-u, --userset limits for user
-g, --group set limits for group
-a, --all set limits for allfilesystems
--always-resolve always tryto resolve name, even if is
composed only ofdigits
-F, --format=formatname operate on specific quota format
-p, --prototype=protonamecopy limits from user/group
-b, --batch read limits from standard input
-c, --continue-batch continue in input processing in case ofan error
-r, --remoteset remote quota (via RPC)
-m, --no-mixed-pathnames trim leading slashes from NFSv4mountpoints
-t, --edit-period edit grace period
-T, --edit-times edit grace times for user/group
-h, --helpdisplay this help text andexit
-V, --version display version information andexit