1

Is it possible to relocate the quota files for one filesystem to a different filesystem (e.g. using a symlink)?

Rationale: testing SSD with quota, and I am worried that the constant writing to the quota files may lead to early wear-out.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
Alien Life Form
  • 2,279
  • 2
  • 21
  • 31

1 Answers1

3

A quick cut and paste from the Kernel documentation seems to indicate you can appoint different files with a mount option usrjquota:

quota           These options are ignored by the filesystem. They
noquota         are used only by quota tools to recognize volumes
grpquota        where quota should be turned on. See documentation
usrquota        in the quota-tools package for more details
            (http://sourceforge.net/projects/linuxquota).
jqfmt=<quota type>  These options tell filesystem details about quota
usrjquota=<file>    so that quota information can be properly updated
grpjquota=<file>    during journal replay. They replace the above
            quota options. See documentation in the quota-tools
            package for more details
            (http://sourceforge.net/projects/linuxquota).

With regards to you worry that updating the quota file may lead to more wear and tear, yes it contributes, but the not nearly as much as you may think. Not every update to the file-system leads to an immediate update of the *.quota files. Doing that would halve the actual IO performance of the disk (when each modified block written to disk would trigger writes to the quota files as well), regardless of whether or not it's a SSD or spinning disk.

The impact of quota on the SSD life-time will be marginal, because the assigned quota and current quota usage, changes and transgressions are maintained by the kernel and the *.quota files are only infrequently updated with the current quota stats. Hence the reason strong recommendation to run quotacheck each time the system boots and mounts non-valid filesystems (which is most likely to happen after a system crash and then the quota status must be suspect as well).

There are two sysctl settings to tune quota behaviour by the kernel: dquot-max & dquot-nr:

The file dquot-max shows the maximum number of cached disk quota entries.
The file dquot-nr shows the number of allocated disk quota entries and the number of free disk quota entries. If the number of free cached disk quotas is very low and you have some awesome number of simultaneous system users, you might want to raise the limit.

HBruijn
  • 72,524
  • 21
  • 127
  • 192