Avatar of Decarn
Decarn
 asked on

Quota does not seem to be working

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

Linux DistributionsLinux

Avatar of undefined
Last Comment
arnold

8/22/2022 - Mon
Julian Parker

I dont believe quotas work for the root user... Try setting up with a normal userid.
jgiordano

have you remounted the /data filesystem?
jgiordano

also as stated above root might not use the quota.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Decarn

ASKER
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?
jgiordano

what is the output from quota student

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

Decarn

ASKER
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

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Decarn

ASKER
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?
ASKER CERTIFIED SOLUTION
arnold

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Decarn

ASKER
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.
tmaleshafske

What is the output of the following code?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Decarn

ASKER
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!
JAaron Anderson

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

arnold

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

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.