Assuming that /home is created and mounted on separate partition such as /dev/sda2
First edit your /etc/fstab file and enable disk quota
Make sure it look like as follows
Code:
LABEL=/home /home ext3 defaults,usrquota 1 2
Save and close file. Now remount file system
Code:
mount -o remount /home
Now create /home/aquota.user file and set permission
Code:
> /home/aquota.user
chmod 600 /home/aquota.user
Initialize disk quota
Setup disk quota for user called vivek, 50 MB:
You need to setup soft and hard limit let us say soft is 49 MB and hard is 50 Mb
Disk quotas for user vivek (uid 1001):
Code:
Filesystem blocks soft hard inodes soft hard
/dev/hdb1 24 50000 51000 3513 0 0
You need to specify unit in KB. Generally
1000 = 1 MB so 50MB = 51000 (it is 1024 actually)
Save and close the file. Now user vivek cannot exceed his disk quota.