{"id":53,"date":"2009-05-10T14:21:46","date_gmt":"2009-05-10T12:21:46","guid":{"rendered":"http:\/\/46.105.150.90\/tstnunix\/?p=53"},"modified":"2009-05-10T14:21:46","modified_gmt":"2009-05-10T12:21:46","slug":"quota","status":"publish","type":"post","link":"https:\/\/nunix.fr\/?p=53","title":{"rendered":"Quota"},"content":{"rendered":"<p>Managing quota is not so simple, but it&rsquo;s important to save place when you use multi-user system to avoid abuses.<\/p>\n<ul>\n<li>Install quota<\/li>\n<\/ul>\n<blockquote>\n<pre>\u00a0# apt-get install quota<\/pre>\n<\/blockquote>\n<ul>\n<li>Enable quota<\/li>\n<\/ul>\n<p>To enable\u00a0 quota, we need to give \u00ab\u00a0rights\u00a0\u00bb to quota to manage a filesystem. So we need to add an option when mouting a disk :<\/p>\n<blockquote>\n<pre># vi \/etc\/fstab <br \/>\/dev\/sda3\u00a0\u00a0 \u00a0\/home\u00a0\u00a0 \u00a0ext3\u00a0\u00a0 \u00a0defaults<font color=\"#ff0000\">,usrquota<\/font>\u00a0\u00a0 \u00a00\u00a0\u00a0 \u00a00 <br \/># reboot<\/pre>\n<\/blockquote>\n<p>I added usrquota as option to the disk, but we can also define group restriction with grpquota<\/p>\n<p>finally, To apply options, reboot is required (well, easier and I didn&rsquo;t search another way to apply it)<\/p>\n<ul>\n<li>Manage quota for user<\/li>\n<\/ul>\n<p> <!--more--> <\/p>\n<p>We want to define quota for user nunix on the disk \/dev\/sda3, 256MB sounds fine. This command open a temporary file where you can edit values for the user nunix on the filesystem \/dev\/sda3. The blocks number seems to be the number of kilobyte. <\/p>\n<blockquote>\n<pre>\u00a0# edquota -u nunix -f \/dev\/sda3<br \/>Disk quotas for user nunix (uid 1001):<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\/sda3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 32\u00a0\u00a0\u00a0\u00a0 256000\u00a0\u00a0\u00a0\u00a0 384000\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9\u00a0\u00a0\u00a0 25600\u00a0\u00a0\u00a0 38400<\/pre>\n<\/blockquote>\n<ul>\n<li>Show quotas<\/li>\n<\/ul>\n<p>When you are a user, you can display your quota using the command quota<\/p>\n<blockquote>\n<pre>$ quota<br \/>Disk quotas for user nunix (uid 1001): <br \/>\u00a0\u00a0\u00a0\u00a0 Filesystem\u00a0 blocks\u00a0\u00a0 quota\u00a0\u00a0 limit\u00a0\u00a0 grace\u00a0\u00a0 files\u00a0\u00a0 quota\u00a0\u00a0 limit\u00a0\u00a0 grace<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/sda3\u00a0\u00a0\u00a0\u00a0\u00a0 32\u00a0 256000\u00a0 384000\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9\u00a0\u00a0 25600\u00a0\u00a0 38400\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 <\/pre>\n<\/blockquote>\n<p>Resources :<\/p>\n<ul>\n<li>\u00a0http:\/\/www.lea-linux.org\/documentations\/index.php\/Admin-admin_fs-quotas<\/li>\n<li>http:\/\/ubuntuforums.org\/showthread.php?t=289571 {jcomments on}<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Managing quota is not so simple, but it&rsquo;s important to save place when you use multi-user system to avoid abuses. Install quota \u00a0# apt-get install quota Enable quota To enable\u00a0 quota, we need to give \u00ab\u00a0rights\u00a0\u00bb to quota to manage a filesystem. So we need to add an option when mouting a disk : # &hellip; <a href=\"https:\/\/nunix.fr\/?p=53\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Quota&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-administration"],"_links":{"self":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53"}],"version-history":[{"count":0,"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}