Friday, January 24, 2014

Set up Disk Quota On LInux

[root@srinivas ~]# vi /etc/fstab 

# add "usrquota" for the line like follows
/dev/mapper/vg_dlp-lv_root / ext4 defaults 1 1
UUID=87d7a761-7c79-4cdf-869f-6adb50af67d9 /boot ext4 defaults 1 2
/dev/mapper/vg_data-lv_data /home ext4 defaults,usrquota 1 2
/dev/mapper/vg_dlp-lv_swap  swap swap defaults 0 0
tmpfs /dev/shm  tmpfs defaults 0 0

 [root@srinivas ~]# reboot
[root@srinivas ~]# quotacheck -um /home # create a file for quota

[root@srinivas ~]# quotaon -uv /home # enable quota
/dev/mapper/vg_data-lv_data [/home]: user quotas turned on
[root@srinivas ~]#  quotaon -p -a # make sure settings

group quota on /home (/dev/mapper/vg_data-lv_data) is off
user quota on /home (/dev/mapper/vg_data-lv_data) is on 

# specify quota. the example below set 1G for it

Disk quotas for user ramani (uid 8035):   
Filesystem blocks   soft hard  inodes  soft hard
/dev/mapper/vg_data-lv_data  32  1024000 1024000  8   0 0
[root@srinivas ~]# repquota -a # make sure status

*** Report for user quotas on device /dev/mapper/vg_data-lv_data

Apply a setting for a user to another user. 


[root@srinivas ~]# edquota -p ramani srini # apply quota for 'srinivas' to user 'srini'

[root@srinivas~]# repquota -a # make sure status

No comments:

Post a Comment