Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install quota
- yum install quota
- edit /etc/fstab
- nano /etc/fstab
- ------------------------------------------------------------------------------------------------------------------
- /dev/sda1 /home ext4 defaults,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 1 2
- ------------------------------------------------------------------------------------------------------------------
- remount /home
- mount -o remount /home
- 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.
- quotacheck -avugm
- sample output which is Ok.
- ------------------------------------------------------------------------------------------------------------------
- quotacheck: Scanning /dev/sda2 [/home] done
- quotacheck: Cannot stat old user quota file: No such file or directory
- quotacheck: Cannot stat old group quota file: No such file or directory
- quotacheck: Cannot stat old user quota file: No such file or directory
- quotacheck: Cannot stat old group quota file: No such file or directory
- quotacheck: Checked 131 directories and 865 files
- quotacheck: Old file not found.
- quotacheck: Old file not found.
- ------------------------------------------------------------------------------------------------------------------
- Activate the quota
- quotaon -avug
- To see which users uses what amount of space (blocks) and files (inodes)
- repquota /home
- set user quota
- 0 – no soft quota for block size
- 1000000 – 1000 MB hard quota
- 0 – no soft quota for file amount
- 0 – no hard quota for file amount
- setquota -u user1 -F vfsv0 0 1000000 0 0 /dev/sda1
- edit user quota
- edquota john
- edit group quota (press i to enable edit, change the values and press Esc. Then enter :wq! to save the changes)
- edquota -g sambagrp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement