Quota's can only be enabled on a per-filesystem basis. If /home and /var are on different filesystems, then you can do this. Is this the case in your situation?
Quotas
- quotas limit the amount of available space to a user or group
- quotas can only be applied to a partition
- hard limits are maximum amount of space a user can have on the system
- soft limits send a warning instructing the user to clean up while still allowing her to work, when the user reaches a specified limit
- when a user reaches a soft limit, it enters a grace period. When the grace period ends, the soft limit becomes a hard limit
Enabling Quotas
1. Edit the fourth field in /etc/fstab to include either usrquota, grpquota, or both
• /dev/hda3 /home ext2 defaults,usrquota,grpquota 1 2
2. Create the aquota.user and/or aquota.group files at the root of the partion. In this example, you would create /home/aquota.user and /home/aquota.group.
3. Set the permissions on this file 600.
4. Run ‘quotacheck -avug’ to initialize the databases (aquota.user and aquota.group)
5. Check the /home/quota.* files sizes to make sure they aren’t a size zero anymore
6. Run ‘quotaon -a’ to enable the quota system
7. Verify your systems initialization script will turn on quotas.
8. Add a command script to a system crontab directory (/etc/crontab.weekly) to execute quotacheck on a routine basis - ‘quotacheck -avug’
quota
- displays quota limits on user or group
- quota -q - shows only over-quota situations
- quota -v - displays quotas even if no storage space is allocated
- quota -u - view a users quota (only root can do this)
- quota -g - view group limits
quotaon
- enables quotas on one or more filesystems
- quotaon -a - turns quotas on for all fileystems in /etc/fstab that are marked
- quotaon -v - displays a message for each filesystem where quotas are turned on
quotaoff
- disables disk quotas on one or more filesystems
- quotaoff -a - turns quotas off for all filesystems in /etc/fstab
- quotaoff -v - displays a message for each filesystem where quotas are turned off
quotacheck
- examine filesystems and compile quota databases
- quotacheck -avug should be run on a routine basis using cron
- quotacheck -a - checks all of the quotas for the filesystems mentioned in /etc/fstab
- quotacheck -v - verbose mode
edquota
- modify user or group quotas using a text editor (vi is the default)
- edquota -u - modify user quotas (default action) - this is ignored if -g is used
- edquota -g - modify group quotas
- edquota -p - use an already configured user’s quota configuration settings and copy to other users. ie, “edquota -up olduser newuser1 newuser2 newuser3”
- edquota -t - modify soft limits
repquota
- used to report on the status of quotas
- repquota reads the quota.user and quota.group files
- repquota -a - reports on all quotas mentioned in /etc/fstab
- repquota -g - reports on group quotas
- repquota -u - reports on user quotas (default)
- repquota -v - adds a descriptive head to the output
You can use the edquota command to apply quotas to all users on your system. For example, the following command applies the quotas that you’ve already set on user “chris” to all other real users on the system…
edquota -p chris `awk -F: ‘$3 > 499 {print $1}’ /etc/passwd
ChrisP
RHCE, LPIC-1, CCNA, CNE, MCSE, +10 others