⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quotas.html

📁 这是很好的学习嵌入式LINUX的文章
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p>Soft limits, on the other hand, can be exceeded for a limited amount of time. Thisperiod of time is known as the grace period, which is one week by default. If a userstays over his or her soft limit longer than the grace period, the soft limit will turninto a hard limit and no further allocations will be allowed. When the user drops backbelow the soft limit, the grace period will be reset.</p><p>The following is an example of what you might see when you run the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=edquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">edquota</span>(8)</span></a> command.When the <a href="http://www.FreeBSD.org/cgi/man.cgi?query=edquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">edquota</span>(8)</span></a> command isinvoked, you are placed into the editor specified by the <tt class="ENVAR">EDITOR</tt>environment variable, or in the <b class="APPLICATION">vi</b> editor if the <ttclass="ENVAR">EDITOR</tt> variable is not set, to allow you to edit the quota limits.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">edquota -u test</kbd></pre><pre class="PROGRAMLISTING">Quotas for user test:/usr: blocks in use: 65, limits (soft = 50, hard = 75)        inodes in use: 7, limits (soft = 50, hard = 60)/usr/var: blocks in use: 0, limits (soft = 50, hard = 75)        inodes in use: 0, limits (soft = 50, hard = 60)</pre><p>You will normally see two lines for each file system that has quotas enabled. One linefor the block limits, and one line for inode limits. Simply change the value you wantupdated to modify the quota limit. For example, to raise this user's block limit from asoft limit of 50 and a hard limit of 75 to a soft limit of 500 and a hard limit of 600,change:</p><pre class="PROGRAMLISTING">/usr: blocks in use: 65, limits (soft = 50, hard = 75)</pre><p>to:</p><pre class="PROGRAMLISTING"> /usr: blocks in use: 65, limits (soft = 500, hard = 600)</pre><p>The new quota limits will be in place when you exit the editor.</p><p>Sometimes it is desirable to set quota limits on a range of UIDs. This can be done byuse of the <var class="OPTION">-p</var> option on the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=edquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">edquota</span>(8)</span></a> command.First, assign the desired quota limit to a user, and then run <tt class="COMMAND">edquota-p protouser startuid-enduid</tt>. For example, if user <tt class="USERNAME">test</tt>has the desired quota limits, the following command can be used to duplicate those quotalimits for UIDs 10,000 through 19,999:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">edquota -p test 10000-19999</kbd></pre><p>For more information see <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=edquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">edquota</span>(8)</span></a> manualpage.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN25668" name="AEN25668">16.14.3 Checking Quota Limits and DiskUsage</a></h2><p>You can use either the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=quota&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">quota</span>(1)</span></a> or the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=repquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">repquota</span>(8)</span></a> commandsto check quota limits and disk usage. The <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=quota&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">quota</span>(1)</span></a> command canbe used to check individual user or group quotas and disk usage. A user may only examinehis own quota, and the quota of a group he is a member of. Only the super-user may viewall user and group quotas. The <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=repquota&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">repquota</span>(8)</span></a> commandcan be used to get a summary of all quotas and disk usage for file systems with quotasenabled.</p><p>The following is some sample output from the <tt class="COMMAND">quota -v</tt> commandfor a user that has quota limits on two file systems.</p><pre class="PROGRAMLISTING">Disk quotas for user test (uid 1002):     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace           /usr      65*     50      75   5days       7      50      60       /usr/var       0      50      75               0      50      60</pre><p>On the <tt class="FILENAME">/usr</tt> file system in the above example, this user iscurrently 15 blocks over the soft limit of 50 blocks and has 5 days of the grace periodleft. Note the asterisk <var class="LITERAL">*</var> which indicates that the user iscurrently over his quota limit.</p><p>Normally file systems that the user is not using any disk space on will not show up inthe output from the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=quota&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">quota</span>(1)</span></a> command, evenif he has a quota limit assigned for that file system. The <var class="OPTION">-v</var>option will display those file systems, such as the <tt class="FILENAME">/usr/var</tt>file system in the above example.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN25700" name="AEN25700">16.14.4 Quotas over NFS</a></h2><p>Quotas are enforced by the quota subsystem on the NFS server. The <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=rpc.rquotad&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rpc.rquotad</span>(8)</span></a> daemonmakes quota information available to the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=quota&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">quota</span>(1)</span></a> command onNFS clients, allowing users on those machines to see their quota statistics.</p><p>Enable <tt class="COMMAND">rpc.rquotad</tt> in <ttclass="FILENAME">/etc/inetd.conf</tt> like so:</p><pre class="PROGRAMLISTING">rquotad/1      dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotad</pre><p>Now restart <tt class="COMMAND">inetd</tt>:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">kill -HUP `cat /var/run/inetd.pid`</kbd></pre></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="snapshots.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="disks-encrypting.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">File System Snapshots</td><td width="34%" align="center" valign="top"><a href="disks.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Encrypting Disk Partitions</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -