How to create quota:
1. Remount the with quota options
the quota options are: grpquota,usrquota
vi /etc/fstab
/dev/VolGroup00/LogVol02 /home                   ext3    defaults,usrquota,grpquota        1 2
2. Remount
mount -o remount /home
3. Define quota
setquota user 512 1024 40 50 /home
4. Login with the user and do:
while true; do echo “############”>> t; done
It will Populate untill you get the erro:
-bash: echo: write error: Disk quota exceeded
5.Report the use of the quota:
repquota /home
[root@server118 ~]# repquota /home
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol02
Block grace time: 7days; Inode grace time: 7days
Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
———————————————————————-
root      —   10289       0       0              4     0     0
student   —      20       0       0             10     0     0
joshua    —      14       0       0              7     0     0
alex      —      14       0       0              7     0     0
dax       —      14       0       0              7     0     0
bryan     —      14       0       0              7     0     0
zak       +-    1024     512    1024  6days       3    40    50
ed        —      14       0       0              7     0     0
NOTE:
autocreate users:
for USER in joshua alex dax bryan zak ed; do echo password | passwd –stdin $USER; done

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *