"Fossies" - the Fresh Open Source Software Archive

Member "quotactl-1.00/quotactl.html" (9 Oct 2005, 11382 Bytes) of package /linux/privat/old/quotactl-1.00.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <html>
    2 <head>
    3 <title>quotactl manual</title>
    4 <body>
    5 <h1>quotactl manual</h1>
    6 
    7 <p><b>quotactl</b> manages disk quotas.  It is a simple command line
    8 interface to the Linux kernel quotactl() system call.
    9 
   10 <h2>Example</h2>
   11 
   12 <pre>
   13 <kbd>
   14 $ quotactl quotaon /dev/hda1 -user -quotafile=/var/lib/diskquota/home
   15 </kbd>
   16 <kbd>
   17 $ quotactl quotaoff /dev/hda1 -group
   18 </kbd>
   19 <kbd>
   20 $ quotactl getquota /dev/hda1 -uid=500
   21 </kbd>
   22 <kbd>
   23 $ quotactl setquota /dev/hda -gid=500 \
   24     -space=10m -inodes=100 -curspace=0 -curinodes=0
   25 </kbd>
   26 <kbd>
   27 $ quotactl setlimit /dev/hda1 -uid=500 -space=10m -inodes=1000
   28 </kbd>
   29 <kbd>
   30 $ quotactl setusage /dev/hda1 -uid=500 -curspace=4k -curinodes=1
   31 </kbd>
   32 <kbd>
   33 $ quotactl sync /dev/hda1 -user
   34 </kbd>
   35 <kbd>
   36 $ quotactl getinfo /dev/hda1 -group
   37 </kbd>
   38 <kbd>
   39 $ quotactl getstats /dev/hda1
   40 </kbd>
   41 </pre>
   42 
   43 
   44 <h2>Synopsis</h2>
   45 
   46 <p>
   47 <b>quotactl</b> <b>quotaon</b>
   48 
   49 <i>device_file</i>
   50 
   51 {<b>-user</b>] <b>-group</b>}
   52 
   53 <b>-quotafile=</b><i>filename</i>
   54 
   55 <p>
   56 <b>quotactl</b> <b>quotaoff</b>
   57 
   58 <i>device_file</i>
   59 
   60 {<b>-user</b>] <b>-group</b>}
   61 
   62 <p>
   63 <b>quotactl</b> <b>getquota</b>
   64 
   65 <i>device_file</i>
   66 
   67 {<b>uid=<i>uid</i></b> | <b>gid=</b><i>gid</i>}
   68 
   69 <p>
   70 <b>quotactl</b> <b>setquota</b>
   71 
   72 <i>device_file</i>
   73 
   74 {<b>uid=</b><i>uid</i> | <b>gid=</b><i>gid</i>}
   75 
   76 {
   77 <b>-inodes=</b><i>n</i> |
   78    <b>inodes_hard=</b><i>n</i> <b>inodes_soft=</b><i>n</i>
   79 }
   80 {
   81 <b>-space=</b><i>n</i> |
   82    <b>space_hard=</b><i>n</i> <b>space_soft=</b><i>n</i>
   83 }
   84 
   85 <b>-curinodes=</b><i>n</i> <b>-curspace=</b><i>n</i>
   86 
   87 <p>
   88 <b>quotactl</b> <b>setlimit</b>
   89 
   90 <i>device_file</i>
   91 
   92 {<b>uid=</b><i>uid</i> | <b>gid=</b><i>gid</i>}
   93 
   94 {
   95 <b>-inodes=</b><i>n</i> |
   96    <b>inodes_hard=</b><i>n</i> <b>inodes_soft=</b><i>n</i>
   97 }
   98 {
   99 <b>-space=</b><i>n</i> |
  100    <b>space_hard=</b><i>n</i> <b>space_soft=</b><i>n</i>
  101 }
  102 
  103 <p>
  104 <b>quotactl</b> <b>setusage</b>
  105 
  106 <i>device_file</i>
  107 
  108 {<b>uid=</b><i>uid</i> | <b>gid=</b><i>gid</i>}
  109 
  110 <b>-curinodes=</b><i>n</i> <b>-curspace=</b><i>n</i>
  111 
  112 <p>
  113 <b>quotactl</b> <b>getinfo</b>
  114 
  115 <i>device_file</i>
  116 
  117 {<b>-user</b>] <b>-group</b>}
  118 
  119 <p>
  120 <b>quotactl</b> <b>getstats</b>
  121 
  122 <i>device_file</i>
  123 
  124 <p>
  125 <b>quotactl</b> <b>sync</b>
  126 
  127 <i>device_file</i>
  128 
  129 {<b>-user</b>] <b>-group</b>}
  130 
  131 <br>
  132 
  133 
  134 <h2>Description</h2>
  135 
  136 <p><b>quotactl</b> controls Linux disk quotas.  It sets and queries
  137 limits, sets and queries current usage, turns quota enforcement and
  138 usage tracking on and off, and syncs usage information from the
  139 kernel cache to the quota file.
  140 
  141 <p><b>quotactl</b> is a simple command line interface to the Linux
  142 <b>quotactl()</b> system call.  Its goal is to give you a way to do
  143 anything the system call can do, while not providing any higher level
  144 functions that would be part of a normal quota administration system.
  145 
  146 <p>The <a href="sourceforge.net/projects/linuxquota/"><b>quota-tools</b>
  147 </a> package provides a higher level quota management system.
  148 
  149 <h2>Arguments</h2>
  150 
  151 <p>The first argument is a command.  It is one of the following:
  152 
  153 <ul>
  154 <li><b>quotaon</b>
  155 <li><b>quotaoff</b>
  156 <li><b>getquota</b>
  157 <li><b>setquota</b>
  158 <li><b>setlimit</b>
  159 <li><b>setusage</b>
  160 <li><b>getinfo</b>
  161 <li><b>getstats</b>
  162 <li><b>sync</b>
  163 </ul>
  164 
  165 <p>The second argument identifies the filesystem image.  It is the
  166 name of a device special file.
  167 
  168 <p>In Linux, a filesystem image is identified by a device number.
  169 Traditionally, a filesystem was always the contents of a particular
  170 block device, so it made sense to identify a filesystem image by the
  171 device number of the device on which the filesystem resided.  Now,
  172 that still works for many filesystem images, but not for others.
  173 Still, Linux fakes device numbers where necessary so that it can
  174 identify any filesystem image with a device number.
  175 
  176 <p>So you identify a filesystem image with the <b>quotactl</b> argument
  177 by naming a device special file which represents the device number which
  178 identifies the filesystem image.
  179 
  180 <p>In normal usage, this is the same device special file you used to
  181 create and mount the filesystem image, e.g. <b>/dev/hda1</b>.  If the
  182 filesystem image is not of a traditional filesystem, though, you'll
  183 have to do some extra work to make or find a device special file that
  184 indicates the device number for the filesystem image.x
  185 
  186 
  187 <h2>Command Types</h2>
  188 
  189 <p>The first argument determines the command type.
  190 
  191 <h3>quotaon</h3>
  192 
  193 <p>A command of this type turns on quota accounting for the subject
  194 filesystem image.  That means the kernel enforces quotas and keeps
  195 track of usage.
  196 
  197 <p>You must identify the quota file with a <b>-quotafile</b> option.
  198 This is the file that contains all the quota limits and current usage.
  199 The kernel caches its contents and buffers updates for performance
  200 reasons.
  201 
  202 <p>You need CAP_SYSADMIN capability for this to succeed.
  203 
  204 <p>You can turn off quota administration with a <b>quotaoff</b>
  205 command.  It gets turned off automatically when you destroy the
  206 filesystem image (umount the filesystem).  It is always off when
  207 you first create a filesystem image (mount the filesystem).
  208 
  209 
  210 <h3>quotaoff</h3>
  211 
  212 <p>A command of this type turns off quota accounting for the subject
  213 filesystem image.
  214 
  215 <p>You need CAP_SYSADMIN capability for this to succeed.
  216 
  217 <h3>getquota</h3>
  218 
  219 <p>A command of this type prints to Standard Output the limits and
  220 current usage for a user or group in the subject filesystem image.
  221 
  222 <P>Use a <b>-uid</b> or <b>-gid</b> option to specify the user or group.
  223 
  224 <p>You need CAP_SYSADMIN capability for this to succeed unless you
  225 are querying your own quota.  &quot;Your own&quot; means for a uid
  226 that matches your effective uid or for a gid that matches your
  227 effective gid.
  228 
  229 <h3>setquota</h3>
  230 
  231 <p>A command of this type sets the limits and current usage for a user
  232 or group in the subject filesystem image.
  233 
  234 <p>Specify the limits and current usage to set with options from this
  235 set: <b>-space</b>*, <b>-inodes</b>*, <b>curinodes</b>, <b>curspace</b>.
  236 
  237 <p>You need CAP_SYSADMIN capability for this to succeed.
  238 
  239 <h3>setlimit</h3>
  240 
  241 <p>A command of this type sets the limits for a user or group in the
  242 subject filesystem image.  Specify the limits with options from
  243 this set: <b>-space</b>*, <b>-inodes</b>*.
  244 
  245 <p>You need CAP_SYSADMIN capability for this to succeed.
  246 
  247 <h3>setusage</h3>
  248 
  249 <p>A command of this type sets the current usage for a user or group in the
  250 subject filesystem image.  Specify the limits with <b>-curinodes</b>
  251 and <b>-curspace</b> options.
  252 
  253 <p>Note that while quota accounting is on, the kernel maintains
  254 current the current usage count.  But it maintains it as a independent
  255 count, increasing and decreasing it as you allocate and free space
  256 and inodes.  If that count is wrong when you first turn on quota
  257 accounting, it will stay wrong by the same amount.  That's why you
  258 need to set the current usage sometimes.
  259 
  260 <p>You need CAP_SYSADMIN capability for this to succeed.
  261 
  262 <h3>getinfo</h3>
  263 
  264 <p>A command of this type prints on Standard Output general
  265 information about quota accounting for the subject filesystem image.
  266 
  267 <p>The information is:
  268 
  269 <ul>
  270 <li>The grace periods (one for user quotas, one for group).
  271 <li>Internal structure of the quota file.
  272 </ul>
  273 
  274 <p>Specify a <b>-user</b> or <b>-group</b> option to indicate which
  275 kind of quota accounting.
  276 
  277 <p>You don't need any privilege to do this.
  278 
  279 <h3>getstats</h3>
  280 
  281 <p>A command of this type prints on Standard Output statistics about
  282 the state of the quota system and history since the filesystem (yes,
  283 filesytem; not filesystem image) was created for the subject
  284 filesystem image.
  285 
  286 <p>There are no options that are meaningful.
  287 
  288 <p>You don't need any privilege to do this.
  289 
  290 <h3>sync</h3>
  291 
  292 <p>A command of this type writes all buffered changes to current usage
  293 to the quota file.  You do this for safety: if the system crashes while
  294 there are buffered changes, when the system comes back the current
  295 usage information in the quota file will be wrong.
  296 
  297 <p>You don't normally need to do this because part of syncing the file
  298 cache of a filesystem image includes syncing the quota current usage
  299 data.  Also, when you turn off quota accounting, including when you
  300 destroy the filesystem image, the kernel updates the quota file.
  301 
  302 <p>Specify a <b>-user</b> or <b>-group</b> option to indicate which
  303 kind of quota data to sync.
  304 
  305 <p>You don't need any privilege to do this.
  306 
  307 
  308 <h2>Options</h2>
  309 
  310 <dl>
  311 
  312 <DT><b>-quotafile=</b><i>filename</i>
  313 
  314 <dd>This option identifies a quota file.  The quota file typically resides
  315 in the filesystem to which it pertains, but it doesn't have to.
  316 
  317 <p>You can create a starter quota file with <a
  318 href="mkquota.html"><b>mkquota</b></a>.
  319 
  320 <DT><b>-uid=</b><i>uid</i>
  321 
  322 <dd>This option identifies a user.
  323 
  324 <DT><b>-gid=</b><i>gid</i>
  325 
  326 <dd>This option identifies a group.
  327 
  328 <DT><b>-inodes=</b><i>n</i>
  329 
  330 <dd>This option gives hard and soft inode limits.  It's equivalent to
  331 specifying <b>inodes_hard=</b><i>n</i> and <b>inodes_soft=</b><i>n</i>.
  332 
  333 <DT><b>-inodes_hard=</b><i>n</i>
  334 
  335 <dd>This option gives a hard inode limit.  <i>n</i> is the maximum number of
  336 inodes a particular user or group is allowed to own.
  337 
  338 <DT><b>-inodes_soft=</b><i>n</i>
  339 
  340 <dd><dd>This options gives a soft inode limit. <i>n</i> is the maximum
  341 number of inodes a particular user or group is allowed to own, except
  342 that the user or group may temporarily own more.  The grace period is
  343 a property of the filesystem image.
  344 
  345 <DT><b>-space=</b><i>n</i>
  346 
  347 <dd>This option gives hard and soft space limits.  It's equivalent to
  348 specifying <b>space_hard=</b><i>n</i> and <b>space_soft=</b><i>n</i>.
  349 
  350 <DT><b>-space_hard=</b><i>n</i>
  351 
  352 <dd>This option gives a hard space limit.  <i>n</i> is the maximum
  353 amount of space, in bytes, that files owned by a particular user or
  354 group may occupy.  It doesn't include fixed per-file overhead -- limit
  355 that with <b>-inodes_hard</b>.
  356 
  357 <p><i>n</i> can have suffix &quot;k&quot;, &quot;m&quot;, &quot;g&quot;,
  358 &quot;t&quot;, and &quot;p&quot; for kibibytes, mebibytes, etc.  Upper
  359 case letters work too.
  360 
  361 <p>This must be a multiple of the quota block size, which is 1K.
  362 
  363 <DT><b>-space_soft=</b><i>n</i>
  364 
  365 <dd>This option gives a soft space limit.  <i>n</i> is the maximum amount
  366 of space, in bytes, that fiels owned bya particular user or group may
  367 occupy, except that the user or group may temporarily own more.
  368 The grace period is a property of the filesystem image.
  369 
  370 <p><i>n</i> can have suffix &quot;k&quot;, &quot;m&quot;, &quot;g&quot;,
  371 &quot;t&quot;, and &quot;p&quot; for kibibytes, mebibytes, etc.  Upper
  372 case letters work too.
  373 
  374 <p>This must be a multiple of the quota block size, which is 1K.
  375 
  376 <DT><b>-curinodes=</b><i>n</i>
  377 
  378 <dd>This options specifies a number of inodes currently owned by a
  379 particular user or group.  The value makes sense only when it matches
  380 the actual situation in the filesystem.  Ordinarily, you scan the
  381 filesystem and count the inodes owned by someone, and then use this
  382 option to indicate what you found.
  383 
  384 <DT><b>-curspace=</b><i>n</i>
  385 
  386 <dd>This option is analogous to <b>-curinodes</b>, but for space.
  387 
  388 <p><i>n</i> is an amount of space in bytes.  
  389 
  390 <p><i>n</i> can have suffix &quot;k&quot;, &quot;m&quot;, &quot;g&quot;,
  391 &quot;t&quot;, and &quot;p&quot; for kibibytes, mebibytes, etc.  Upper
  392 case letters work too.
  393 
  394 <DT><b>-user</b>
  395 
  396 <dd>This option indicates user quotas as opposed to group quotas.
  397 
  398 <DT><b>-group</b>
  399 
  400 <dd>This option indicates group quotas as opposed to user quotas.
  401 
  402 </dl>
  403 
  404 
  405 <address>
  406 <a href="mailto:bryanh@giraffe-data.com">Bryan Henderson</a>
  407 </address>
  408 </html>