Setup_Quota

1.    Take a backup of /etc/fstab file first and then put following entry in /etc/fstab

 

LABEL=/local/1          /local/1                ext3    defaults,usrquota,grpquota      1 2

 

P.S. If there is already an entry like below, replace it with the above line

 

/dev/sdb1               /local/1                ext3    defaults        1 2

 

2.    Issue following command

 

#mount -o remount /local/1/

# quotacheck -vc /local/1/

Check using following command if userquota and grpquota attributes are applied to /local/1

 

root@tksddvm003lx01jee:/local/1/home# mount|grep /local/1

/dev/sdb1 on /local/1 type ext3 (rw,usrquota,grpquota)

 

3.    Issue following commands one by one.

 

#/sbin/quotaoff -vug /local/1

#

 

# ls -ltr /local/1/aquota.*

-rw------- 1 root root 35840 Nov 18 18:44 /local/1/aquota.user

-rw------- 1 root root 19456 Nov 18 18:44 /local/1/aquota.group

 

#/sbin/quotaon -vug /local/1

/dev/sdb1 [/local/1]: group quotas turned on

/dev/sdb1 [/local/1]: user quotas turned on

 

# /sbin/quotaon -p /local/1

group quota on /local/1 (/dev/sdb1) is on

user quota on /local/1 (/dev/sdb1) is on

 

# /usr/sbin/warnquota

root@tksddvm003lx01jee:/local/1/home

An over-limit quota generates a mail message to the user on login. Which file would you modify to customize the mail delivered ?

    A: /etc/warnquota.conf

4.    Quota is set. You can list is using following command

 

# /usr/sbin/repquota –a

 

5.    Now set quota limits to one of the service id (we are using tketrwfd as an example)

 

# /usr/sbin/edquota -u tketrwfd

Disk quotas for user tketrwfd (uid 1208137):

 Filesystem                   blocks       soft       hard     inodes     soft     hard

 /dev/sdb1                    312088       1020000    1500000       6187        0        0

 

Confirmation:

 

# /usr/sbin/repquota -a|grep tketrwfd

tketrwfd  --  312088 1020000 1500000           6187     0     0

 

P.S. We implement quota limits on the blocks and not on inodes. So entries needs to be made under belonging to Blocks columns.

6.    Now use above service id’s (tketrwfd) quota limits as template and create quota limits for all jfarm service id’s using following command.

 

# cd /local/1/home;for i in `ls -1`;do /usr/sbin/edquota -p tketrwfd $i;done

 

Confirmation:

 

#/usr/sbin/repquota -a

*** Report for user quotas on device /dev/sdb1

Block grace time: 7days; Inode grace time: 7days

                        Block limits                File limits

User            used    soft    hard  grace    used  soft  hard  grace

----------------------------------------------------------------------

root      --  192348       0       0             52     0     0

tketrwfd  --  312088 1020000 1500000           6187     0     0

tkjbppmq  --  441588 1020000 1500000           1501     0     0

tkjbxenq  --   20380 1020000 1500000             20     0     0

tkjbcprq  --  423928 1020000 1500000             49     0     0

tkjbsrqq  --      48 1020000 1500000             10     0     0

tkeqrwfd  --  902960 1020000 1500000          13997     0     0

.

.