Solved

quota

Posted on 2013-05-16
8
509 Views
Last Modified: 2013-05-28
Here's my /etc/fstab file
/dev/mapper/fedora-root /                       ext4    defaults,usrquota,grpquota        1 1

I ran  
1. mount -o remount /
2. quotacheck -cug /
3.quotaon /
4.edquota  root
5. quota root  shows
Disk quotas for user root (uid 0):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/mapper/fedora-root
                4538640*      1       1   7days  123318       0       0        


dd if=/dev/urandom of=/test.txt bs=32768 count=279

It succeded in creating this file. I thought this should have failed with disk quota exceede ??
0
Comment
Question by:perlperl
  • 4
  • 3
8 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 39173701
it is not clear from your post whether you have hard quota setting.

using root as the test account is not adviseable nor is it advisable to set quota on / versus creating a separate partition for /home

the other issue is you have two quota enforcement mechanisms: quota and grpquota.
root:other the group  might extend roots quota.

 create a new non admin user set their quota making sure it is a hard restriction.
then test the enforcement.
0
 

Author Comment

by:perlperl
ID: 39174543
I created a user  test

[root@localhost ~]# quota test
Disk quotas for user test (uid 17073):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/mapper/fedora-root
                     28*     10      10   6days       9       0       0        
[root@localhost ~]# su test
[test@localhost root]$

Added test to sudoers file

[test@localhost root]$ sudo dd if=/dev/urandom of=/root/test.txt bs=32768 count=169
169+0 records in
169+0 records out
5537792 bytes (5.5 MB) copied, 0.487241 s, 11.4 MB/s

SHOULDN"T the above fail? Not sure what I am missing??

/etc/fstab has
/dev/mapper/fedora-root /                       ext4    defaults,usrquota,grpquota        1
0
 

Author Comment

by:perlperl
ID: 39174546
Do I have to create seperate partition for home? How can I do that?
0
 
LVL 8

Expert Comment

by:Pepe2323
ID: 39174826
If /home is part of the same partition or in this case logical volume then no

Quotas are only able to restrict by Filesystem
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 39174893
IMHO, using a separate /home is better.

Your two last options are set to unlimited. If I am not mistaken the first are soft enforcement options. The last hard are enforcement options

i.e. for user test set the following:
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/mapper/fedora-root
 28*     10      10   6days       9       12       10

see what that does.
0
 

Author Comment

by:perlperl
ID: 39175056
I was suppose to write in /home/test/test.txt and now it worked .
It properly fails with quota exceeded
0
 

Author Comment

by:perlperl
ID: 39175060
this worked
 dd if=/dev/urandom of=/home/test/test.txt bs=32768 count=169

THis is because "test" is the user
0
 
LVL 77

Expert Comment

by:arnold
ID: 39175722
you have quota allocation per user and per group. test user is the one you setup with edquota username
edquota -g group see what options it lets you set here.
Note it is very dangerous to set a group quota where there are multiple users as that will enforced based on their combined space usage.

root may have one restriction, but the group other has none so at some point the group quota for other allows for root to have additional space beyond its own.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now