Quota does not seem to be working

Posted on 2010-09-06
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

Question by:Decarn
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +3
LVL 19

Expert Comment

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

Expert Comment

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

Expert Comment

ID: 33612658
also as stated above root might not use the quota.
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.


Author Comment

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?
LVL 11

Expert Comment

ID: 33612692
what is the output from quota student

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


Author Comment

ID: 33612761

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


Author Comment

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?
LVL 78

Accepted Solution

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.


Author Comment

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.

Expert Comment

ID: 33614499
What is the output of the following code?

Author Comment

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.


Expert Comment

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

LVL 78

Expert Comment

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


Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.:
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.

734 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