Advertisement
shokti

centos 6.5 - diskquota

Jun 27th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. install quota
  2. yum install quota
  3.  
  4. edit /etc/fstab
  5. nano /etc/fstab
  6. ------------------------------------------------------------------------------------------------------------------
  7. /dev/sda1 /home ext4 defaults,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 1 2
  8.  
  9. ------------------------------------------------------------------------------------------------------------------
  10.  
  11. remount /home
  12. mount -o remount /home
  13.  
  14. run an initial quotacheck command which will analyse all files on the partition and creates the aquota.user and aquota.group files in the /home root.
  15. quotacheck -avugm
  16.  
  17. sample output which is Ok.
  18. ------------------------------------------------------------------------------------------------------------------
  19. quotacheck: Scanning /dev/sda2 [/home] done
  20. quotacheck: Cannot stat old user quota file: No such file or directory
  21. quotacheck: Cannot stat old group quota file: No such file or directory
  22. quotacheck: Cannot stat old user quota file: No such file or directory
  23. quotacheck: Cannot stat old group quota file: No such file or directory
  24. quotacheck: Checked 131 directories and 865 files
  25. quotacheck: Old file not found.
  26. quotacheck: Old file not found.
  27. ------------------------------------------------------------------------------------------------------------------
  28.  
  29.  
  30. Activate the quota
  31. quotaon -avug
  32.  
  33. To see which users uses what amount of space (blocks) and files (inodes)
  34. repquota /home
  35.  
  36. set user quota
  37. 0 – no soft quota for block size
  38. 1000000 – 1000 MB hard quota
  39. 0 – no soft quota for file amount
  40. 0 – no hard quota for file amount
  41.  
  42. setquota -u user1 -F vfsv0 0 1000000 0 0 /dev/sda1
  43.  
  44.  
  45. edit user quota
  46. edquota john
  47.  
  48. edit group quota (press i to enable edit, change the values and press Esc. Then enter :wq! to save the changes)
  49. edquota -g sambagrp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement