{"id":132,"date":"2013-10-03T06:33:00","date_gmt":"2013-10-03T06:33:00","guid":{"rendered":"http:\/\/259@jodohost.com\/\/blog\/"},"modified":"2013-10-03T06:33:00","modified_gmt":"2013-10-03T06:33:00","slug":"how-to-enable-the-quota-on-a-drive-partition-in-linux","status":"publish","type":"post","link":"http:\/\/www.jodohost.com\/blog\/index.php\/2013\/10\/03\/how-to-enable-the-quota-on-a-drive-partition-in-linux\/","title":{"rendered":"How to Enable the Quota on a drive\/partition in Linux"},"content":{"rendered":"<p>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. <\/p>\n<p>The following are the steps using which we can enable the quota:- <\/p>\n<p>Step 1: First of all make sure that the &#8216;quota&#8217; package has been installed on the system and if not then do install it using the command below:- <\/p>\n<p>yum install quota<\/p>\n<p>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 :- <br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\/dev\/sda1 \u00a0\u00a0 \u00a0\/home\u00a0\u00a0\u00a0\u00a0 ext4\u00a0\u00a0\u00a0 defaults,usrquota\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 \u00a0\u00a0 \u00a01<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>then save and quit the file.<\/p>\n<p>Step 3: After this run the command below:- <\/p>\n<p>mount -o remount \/dev\/vda2 and then run the command mount and you&#8217;ll see the output as below:-<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\/dev\/vda2 on \/home\u00a0 type ext4 (rw,usrquota)<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Step 4: Now, run the command below to create the quota file:- <\/p>\n<p>\/sbin\/quotacheck -mufv \/home<\/p>\n<p>Step 5: On the quota for \/home partition<\/p>\n<p>\/sbin\/quotaon \/home<\/p>\n<p>That&#8217;s all that needs to be done. After this, you can use the command below to see the users inside the \/home directory.<\/p>\n<p>repquota \/home<\/p>\n<p>Similarly to increase\/decrease the quota for a particular user, you can use the commands as below:- <\/p>\n<p>edquota username<\/p>\n<p>e.g. edquota sachin<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>Disk quotas for user sachin (uid 502):<br \/>\u00a0 Filesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 blocks\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 soft\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 hard\u00a0\u00a0\u00a0\u00a0 inodes\u00a0\u00a0\u00a0\u00a0 soft\u00a0\u00a0\u00a0\u00a0 hard<br \/>\u00a0 \/dev\/vda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 16\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>That&#8217;s it.<\/p>\n<p> ]]><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/132"}],"collection":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":0,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}