+ <para>The design of quotas on Lustre has management and enforcement
+ separated from resource usage and accounting. Lustre software is
+ responsible for management and enforcement. The back-end file
+ system is responsible for resource usage and accounting. Because of
+ this, it is necessary to begin enabling quotas by enabling quotas on the
+ back-end disk system. Because quota setup is dependent on the Lustre
+ software version in use, you may first need to run
+ <literal>lfs get_param version</literal> to identify
+ <xref linkend="whichversion"/> you are currently using.
+ </para>
+ <section>
+ <title>Enabling Disk Quotas (Lustre Software Prior to Release 2.4)
+ </title>
+ <para>
+ For Lustre software releases older than release 2.4,
+ <literal>lfs quotacheck</literal> must be first run from a client node to
+ create quota files on the Lustre targets (i.e. the MDT and OSTs).
+ <literal>lfs quotacheck</literal> requires the file system to be quiescent
+ (i.e. no modifying operations like write, truncate, create or delete
+ should run concurrently). Failure to follow this caution may result in
+ inaccurate user/group disk usage. Operations that do not change Lustre
+ files (such as read or mount) are okay to run.
+ <literal>lfs quotacheck</literal> performs a scan on all the Lustre
+ targets to calculates the block/inode usage for each user/group. If the
+ Lustre file system has many files,
+ <literal>quotacheck</literal> may take a long time to complete. Several
+ options can be passed to
+ <literal>lfs quotacheck</literal>:</para>
+ <screen>
+# lfs quotacheck -ug /mnt/testfs
+</screen>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>u</literal>-- checks the user disk quota information</para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>g</literal>-- checks the group disk quota information</para>
+ </listitem>
+ </itemizedlist>
+ <para>By default, quota is turned on after
+ <literal>quotacheck</literal> completes. However, this setting isn't
+ persistent and quota will have to be enabled again (via
+ <literal>lfs quotaon</literal>) if one of the Lustre targets is
+ restarted.
+ <literal>lfs quotaoff</literal> is used to turn off quota.</para>
+ <para>To enable quota permanently with a Lustre software release older
+ than release 2.4, the
+ <literal>quota_type</literal> parameter must be used. This requires
+ setting
+ <literal>mdd.quota_type</literal> and
+ <literal>ost.quota_type</literal>, respectively, on the MDT and OSTs.
+ <literal>quota_type</literal> can be set to the string
+ <literal>u</literal> (user),
+ <literal>g</literal> (group) or
+ <literal>ug</literal> for both users and groups. This parameter can be
+ specified at
+ <literal>mkfs</literal> time (
+ <literal>mkfs.lustre --param mdd.quota_type=ug</literal>) or with
+ <literal>tunefs.lustre</literal>. As an example:</para>
+ <screen>
+tunefs.lustre --param ost.quota_type=ug $ost_dev
+</screen>
+ <para>When using
+ <literal>mkfs.lustre --param mdd.quota_type=ug</literal> or
+ <literal>tunefs.lustre --param ost.quota_type=ug</literal>, be sure to
+ run the command on all OSTs and the MDT. Otherwise, abnormal results may
+ occur.</para>
+ <warning>
+ <para>
+ In Lustre software releases before 2.4, when new OSTs are
+ added to the file system, quotas are not automatically propagated to
+ the new OSTs. As a workaround, clear and then reset quotas for each
+ user or group using the
+ <literal>lfs setquota</literal> command. In the example below, quotas
+ are cleared and reset for user
+ <literal>bob</literal> on file system
+ <literal>testfs</literal>:
+ <screen>
+$ lfs setquota -u bob -b 0 -B 0 -i 0 -I 0 /mnt/testfs
+$ lfs setquota -u bob -b 307200 -B 309200 -i 10000 -I 11000 /mnt/testfs
+</screen></para>
+ </warning>
+ </section>