Solved

Quota does not seem to be working

Posted on 2010-09-06
13
809 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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
 

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 77

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 77

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

808 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