2 LFS VERSION: 3.3 + (maybe all)
3 AUTHOR: Remco Jansen <remcorkz@xs4all.nl>
6 This hint describes how to setup quota support on your LFS system.
10 Wrote this hint because there's one little thing that you may come across trying
11 to setup quota-tools. Normally on an LFS system the mtab file is created as a
12 symlink to /proc/mounts. The quota-tools programs won't work with this
15 First make sure quota support is built into your kernel. If not, recompile your
18 Also you need to get the quota-tools package from
19 http://prdownloads.sourceforge.net/linuxquota/quota-3.08.tar.gz?download
20 (at the time of this writing version is 3.08).
21 Their homepage is can be found at http://sourceforge.net/projects/linuxquota/.
24 Install the quota-tools package as normally.
29 Edit the Makefile by hand to setup the directories so that they obey the LFS
30 standard. (prefix=/bin, sysconfdir=/etc)
35 Now the tools are installed properly, you have to change the /etc/mtab symlink
36 to the more-used /etc/mtab file.
37 (see http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2002/08/0387.html
38 for more information on this issue)
45 In order to let the mtab file be accurate (also when the system has crashed for
46 some reason) we add an mtab initialization part to the mountfs initscript.
48 Add the following lines to the start)-section of the mountfs initscript, right
49 after the remounting of the root file system in read-write mode lines.
51 # Because we have replaced the /etc/mtab-symlink by a file
52 # we have to update the status of /etc/mtab.
53 # First remove it. Then add an entry for the already
54 # mounted root file system to it.
56 echo "Clearing /etc/mtab..."
59 echo "Update mtab file with root file system..."
62 echo "Update mtab file with proc file system..."
67 Create the quota initscript as follows:
70 # Begin $rc_base/init.d/quotas
72 # Based on sysklogd script from LFS-3.1 and earlier.
73 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
75 source /etc/sysconfig/rc
80 echo "Checking quotas on all filesystems..."
81 /usr/sbin/quotacheck -augM
83 echo "Turning quota administration on..."
84 /usr/sbin/quotaon -aug
89 echo "Turning off quota administration..."
90 /usr/sbin/quotaoff -aug
95 echo "Restarting quota administration not allowed."
99 echo "Usage: $0 {start|stop|reload|restart|status}"
104 # End $rc_base/init.d/quotas
107 The last step is editing your /etc/fstab.
109 For each filesystem on which you want to enable quota support add either
110 usrquota or grpquota or the two of them to the options section of that file-
111 system. (for this information you can also have a look at one of the thousands
114 Reboot your system. (You may also update the mtab file by issueing the
115 mount -f filesystem command for each already mounted filesystem, remount the
116 filesystems on which you're installing quota support and then start quota
117 administration by running quotaon -aug. However it is better to run the
118 quotacheck tool as well... So if possible: reboot.)
120 The quotaon program will create the quota.user and/or quota.group files for each
121 desired filesystem automatically.
123 You're finished. Good luck.