Solved

Quota does not seem to be working

Posted on 2010-09-06
13
805 Views
Last Modified: 2013-12-06
Hi Folks,

I'm using Red Hat Enterprise 5.4 and I'm trying to implement the quota on a new partition.
I practiced creating the quota on the /home directory was successfully and I now want to create a new directory mounted on a new partition and enable quota.

I created a new directory /data and mounted it on a new ext3 partition sdb3. Quota seem to be enabled but I just can't assign quota based on individual user. Can I set the quota on /data for individual user?
[root@example ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        2610    20860402+  8e  Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         123      987966   83  Linux
/dev/sdb2             124         186      506047+  82  Linux swap / Solaris
/dev/sdb3             187         311     1004062+  83  Linux
[root@example ~]# 
[root@example ~]# repquota /dev/sdb3
*** Report for user quotas on device /dev/sdb3
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --   17652       0       0              4     0     0       


[root@example ~]# 
[root@example ~]# cat /etc/fstab
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/sdb1               /mnt/partition_sdb1     ext3    defaults        0 0
/dev/sdb2               swap                    swap    defaults        0 0
/dev/sdb3               /data                   ext3    defaults,usrquota       0 0

Open in new window

0
Comment
Question by:Decarn
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 19

Expert Comment

by:jools
ID: 33612608
I dont believe quotas work for the root user... Try setting up with a normal userid.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 33612632
have you remounted the /data filesystem?
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 33612658
also as stated above root might not use the quota.
0
 

Author Comment

by:Decarn
ID: 33612668
hi jools,

That's the problem I have set quota for user but it is not showing.

I have entered the command:

setquota student 512 1024 0 0 /data

even tried

setquota student 512 1024 0 0 /dev/sdb3

When I tyep "edquota student", I can see that the parameter has been set but when I run repquota /dev/sdb3 only the root quota is shown.

Tried loging in as student and do a sudo but password is invalid. Strange but I don't think I need to login as student to set quota ya?
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 33612692
what is the output from quota student

make sure quotas are on and enabled quotaon -vug /data

0
 

Author Comment

by:Decarn
ID: 33612761
Hi,

Just restarted the comp to be sure. I did what you mention but still no luck.
[root@example ~]# quota student
Disk quotas for user student (uid 507): none
[root@example ~]# quotao
quotaoff  quotaon   
[root@example ~]# quotaon -vug /data
quotaon: using /data/aquota.user on /dev/sdb3 [/data]: Device or resource busy
[root@example ~]# quotaoff /data
[root@example ~]# quotaon -vug /data
/dev/sdb3 [/data]: user quotas turned on
[root@example ~]# quota student
Disk quotas for user student (uid 507): none
[root@example ~]# setquota -u student 256 512 0 0 /data/
[root@example ~]# quota student
Disk quotas for user student (uid 507): none
[root@example ~]#

Open in new window

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Decarn
ID: 33612811
Any ideas guys? I really want to get this working.

I can reset to the snapshot since I'm using a VM. How about a step by step guide to set quota on /data on /dev/sdb3 and to check each step?
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
ID: 33614084
When you run quota username, you will only get responses when the quota is in soft/hard condition i.e. over the softlimit or over the hard limit when/if set.
To see the quota, use quota -v username
This will out put the quota information for the user without regard to their condition.

0
 

Author Comment

by:Decarn
ID: 33614376
Hi arnold,

thanks. I see the quota when using quota-v username.

The problem seem to be resolved when I log in as student, cd to that directory and then dd a file size that exceeded the quota. When I run the quota command as student, the quota appears. At root repquota also shows its. Very weird.

I figured out some points which are important.
quotaon -vug /data //I tested with quotaon /data and it doesn't work. Switches is important
user must have permissions to the /data dir.
0
 
LVL 2

Expert Comment

by:tmaleshafske
ID: 33614499
What is the output of the following code?
0
 

Author Comment

by:Decarn
ID: 33659787
Hi tmaleshafske,

Apologies but I have shut down the VM but the code will show the quota of the user. One more thing that I found out. After applying quota on that particular partition or folder, I will have to log in as that user and copy a file in. Only then will the quota be shown.

Cheers!
0
 

Expert Comment

by:jandersonwidener
ID: 34369889
I am missing something...

when I perform ::.
setquota myusername 400 1024 0 0 /home
I get this error

Mountpoint (or device) /home not found.

NOT all specified mountpoints are using quota.

Open in new window

0
 
LVL 76

Expert Comment

by:arnold
ID: 34370461
run mount to see whether you have quota as an option on the /home volume
alternative look in /etc/fstab to see if quota is set as an option when mounting /home.

i.e. output from running mount
/dev/mapper/VolGroup01-LogVol02 on /home/ type ext3 (rw,quota)

fstab example:

device                   mountpoint              type                      options          dump fsck
/dev/VolGroup01/LogVol02 /home                    ext3    defaults,quota        0 0

Open in new window

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

12 Experts available now in Live!

Get 1:1 Help Now