Many times it is required to enable the quota on a drive where there is mostly user data in order to check the size used by a specific user on the system. For that, we must have enabled quota on the drive.
The following are the steps using which we can enable the quota:-
Step 1: First of all make sure that the ‘quota’ package has been installed on the system and if not then do install it using the command below:-
yum install quota
Step 2: Go to /etc/fstab file and write usrquota next to the default against the partition on which you want to enable the quota as below :-
———————————————————————————————————
/dev/sda1 /home ext4 defaults,usrquota 1 1
———————————————————————————————————
then save and quit the file.
Step 3: After this run the command below:-
mount -o remount /dev/vda2 and then run the command mount and you’ll see the output as below:-
————————————————————————
/dev/vda2 on /home type ext4 (rw,usrquota)
————————————————————————
Step 4: Now, run the command below to create the quota file:-
/sbin/quotacheck -mufv /home
Step 5: On the quota for /home partition
/sbin/quotaon /home
That’s all that needs to be done. After this, you can use the command below to see the users inside the /home directory.
repquota /home
Similarly to increase/decrease the quota for a particular user, you can use the commands as below:-
edquota username
e.g. edquota sachin
————————————————————————————————————————–
Disk quotas for user sachin (uid 502):
Filesystem blocks soft hard inodes soft hard
/dev/vda2 16 0 0 5 0 0
————————————————————————————————————————–
That’s it.
]]>