Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install quota program:
- sudo apt-get install quota quotatool
- edit /etc/fstab:
- sudo nano /etc/fstab
- add usrquota and grpquota in the filesystem where you want to enforce it. it should look like below:
- # / was on /dev/sda1 during installation
- UUID=0229ace1-de12-4cfc-83cf-990dde59f043 / ext4 errors=remount-ro,usrquota,grpquota 0 1
- Restart/Reboot computer:
- sudo reboot
- After Restart check in the root(/) if aquota.user and aquota.group is present. During restart quotacheck and quotaon comand was executed. which means after restart disk quota is running:
- cd /
- ls -al
- To set or change quota size to a user, use edquota command:
- sudo edquota -u the_username_here
- change soft(kbytes) - size in kb where when the soft quota is reached, it will start the warning until the time grace period but will not exceed the hard quota.
- change hard(kbytes) - size in kb where the user should not exceed.
- To modify default grace period:
- sudo edquota -t
- To check users and quota data with repquota command:
- sudo repquota -u /
- ---------------------------------------------------------------------------------------------
- USEFUL DISK QUOTA COMMANDS:
- run quotacheck command to prepare filesystem for quota:
- sudo quotacheck -mavug
- options:
- m - don't try to remount the filesystem
- a - all filesystems in /etc/mtab
- v - verbose, display extra information
- u - only user quotas listed in /etc/mtab
- g - only group quotas listed in /etc/mtab
- turn quotas on with quotaon command:
- sudo quotaon -avug
- turn quotas off with quotaoff command:
- sudo quotaoff -avug
- options for quotaon and quotaoff:
- a - all filesystems in /etc/fstab with quotas
- v - verbose, display extra information
- u - users, manipulate user quotas
- g - groups, manipulate group quotas
- if you have a desktop environment then logout and switch to tty1(ctrl+alt+f1) to avoid some errors when running quota command, and then after running the command switch back tty7(ctrl+alt+f7) and login back to your desktop:
- ---------------------------------------------------------------------------------------------
- DISK QUOTA FOR A MOUNTED DRIVE(ex. /home):
- if you want to enforce quota on a partition other than the root(/), for example another drive with mount point /home:
- edit /etc/fstab and put usrquota and grpquota in /home mount point:
- # /home was on /dev/md0 during installation
- UUID=********** /home ext4 defaults,errors=remount-ro,usrquota,grpquota 0 2
- Restart/Reboot computer:
- sudo reboot
- After Restart check in the /home folder if aquota.user and aquota.group is present. During restart quotacheck and quotaon comand was executed. which means after restart disk quota is running:
- cd /home
- ls -al
- To set or change quota size to a user, use edquota command:
- sudo edquota -u the_username_here
- change soft(kbytes) - size in kb where when the soft quota is reached, it will start the warning until the time grace period but will not exceed the hard quota.
- change hard(kbytes) - size in kb where the user should not exceed.
- To modify default grace period:
- sudo edquota -t
- To check users and quota data with repquota command:
- sudo repquota -u /home
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement