system quota

From: http://howtoforge.com/samba-domaincontroller-swat-fedora8

and http://howtoforge.com/samba-domaincontroller-swat-fedora8-p3

prepare the system for quota usage.

vi /etc/fstab

Add usrquota and grpquota to the line for the root partition. The options should look like in this line:

/dev/VolGroup00/LogVol00 / ext3 defaults,usrquota,grpquota 1 1

Afterwards we create the files for the quota settings and remount the root partition.

touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug

Note: You’ll get an error like this when you start quotacheck -avugm for the first time:

quotacheck: WARNING – Quotafile //aquota.user was probably truncated. Cannot save quota settings…
quotacheck: WARNING – Quotafile //aquota.group was probably truncated. Cannot save quota settings…

This is normal and nothing to worry about. How to use quota for users is explained later in this howto when we add users to our Samba domain.

add a quota to the user via:

setquota -u %username% %block-softlimit% %block-hardlimit% %inode-softlimit% %inode-hardlimit% -a

E.g.:

The following command will add a quota to the user james:

setquota -u james 40960 51200 0 0 -a

Now james has a block softlimit of 40MB, a block hardlimit of 50MB and no restrictions for inodes (folders and files).

You can check the current quota settings and quota usage via:

quota %username%

E.g.:

quota james

The output should look like this:

Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/VolGroup00-LogVol00
1108 40960 51200 104 0 0