Linux quote

Linux quote【Linux quote】linux中的quote磁碟配额可以有效的管理多用户对磁碟操作的限制,由于linux是多用户作业系统,有时候可能会出现几个人同时在使用的情况,当其中一个人占用了大部分磁碟空间的时候其他人就会感觉到系统反应速度明显变慢 。为了解决这一问题所以我们要对每个用户对磁碟的操作进行限制 。注:此限制对root用户不起作用 。
基本介绍外文名:Linux quote
系统:多用户作业系统
缺点:反应速度明显变慢
限制:对root用户不起作用
Quota 相关的命令Quota 相关的几个命令如下 。启用quota:quotaon[root@rhce /]# quotaonBad number of arguments.quotaon: Usage:quotaon [-guvp] [-F quotaformat] [-x state] -aquotaon [-guvp] [-F quotaformat] [-x state] filesys ...-a, --allturn quotas on for all filesystems-f, --offturn quotas off-u, --useroperate on user quotas-g, --groupoperate on group quotas-p, --print-stateprint whether quotas are on or off-x, --xfs-command=cmdperform XFS quota command-F, --format=formatname operate 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] -aquotaoff [-guvp] [-F quotaformat] [-x state] filesys ...-a, --allturn quotas off for allfilesystems-f, --offturn quotas off-u, --useroperate on user quotas-g, --groupoperate on group quotas-p, --print-stateprint whether quotas are on or off-x, --xfs-command=cmdperform XFS quota command-F, --format=formatname operate 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-detailsdo not send quota informationitself-F, --format=formatnameuse quotafiles of specific format-c, --config=config-filenon-default config file-q, --quota-tab=quotatab-filenon-default quotatab-a, --admins-file=admins-filenon-default admins file-h, --help display this help messageand exit-v, --versiondisplay version informationand exitBugs to jack@suse.cz[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, --useredit user data-g, --groupedit group data-r, --remoteedit remote quota (via RPC)-m, --no-mixed-pathnamestrim leading slashes from NFSv4mountpoints-F, --format=formatnameedit quotas of a specific format-p, --prototype=namecopy data from a prototype user/group--always-resolvealwaystry to resolve name, even if it iscomposed only ofdigits-f, --filesystem=filesystemedit data only on a specific filesystem-t, --edit-periodedit grace period-T, --edit-timesedit grace time of a user/group-h, --helpdisplay this help text andexit-V, --versiondisplay version informationand exitBugs to: jack@suse.cz[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, --userdisplay information aboutusers-g, --groupdisplay information aboutgroups-s, --human-readableshow numbers in human friendly units(MB, GB, ...)-t, --truncate-namestruncate names to 8 characters-p, --raw-graceprint grace time in seconds sinceepoch -n, --no-namesdo not translate uid/gid to name-i, --no-autofsavoid autofs mountpoints-c, --batch-translationtranslate big number of ids at once-C, --no-batch-translation translate ids one by one-F, --format=formatnamereport information for specific format-h, --helpdisplay this help message andexit-V, --versiondisplay version information andexit检查并修复quota 配置档案:quotacheck#quotacheck –cvug/tmp[root@rhce ~]# quotacheck -hUtility for checking and repairing quotafiles.quotacheck [-gucbfinvdmMR] [-F<quota-format>] filesystem|-a-u, --usercheck user files-g, --groupcheck group files-c, --create-filescreate new quota files-b, --backupcreate backups of old quota files-f, --forceforce check even if quotas areenabled-i, --interactiveinteractive mode-n, --use-first-dquotuse the first copy of duplicated structure-v, --verboseprint more information-d, --debugprint even more messages-m, --no-remountdo not remount filesystem read-only-M, --try-remounttry remounting filesystem read-only,continue even if itfails-R, --exclude-rootexclude root when checking allfilesystems-F, --format=formatnamecheck quota files of specific format -a, --allcheck all filesystems-h, --helpdisplay this message and exit-V, --versiondisplay version information andexitBugs to jack@suse.cz[root@rhce ~]#[root@rhce ~]# quotacheck -cvug /davequotacheck: 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] donequotacheck: Cannot stat old user quotafile: No such file or directoryquotacheck: Cannot stat old group quotafile: No such file or directoryquotacheck: Cannot stat old user quotafile: No such file or directoryquotacheck: Cannot stat old group quota file:No such file or directoryquotacheck: Checked 3 directories and 2filesquotacheck: 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, --groupset limits for group-a, --allset limits for allfilesystems--always-resolvealways tryto resolve name, even if iscomposed only ofdigits-F, --format=formatnameoperate on specific quota format-p, --prototype=protoname copy limits from user/group-b, --batchread limits from standard input-c, --continue-batchcontinue in input processing in case ofan error-r, --remoteset remote quota (via RPC)-m, --no-mixed-pathnamestrim leading slashes from NFSv4mountpoints-t, --edit-periodedit grace period-T, --edit-times edit grace times for user/group-h, --helpdisplay this help text andexit-V, --versiondisplay version information andexit