Solved

setting up quotas EASY QUESTION

Posted on 2004-04-04
33
527 Views
Last Modified: 2008-02-01
below is my /etc/fstab file which i tried setting up quotas on but...i get this error ?



[root@localhost root]# quotacheck -c /var/www/html/test/
quotacheck -c /var/www/html/test/
quotacheck: Mountpoint (or device) /var/www/html/test not found.
quotacheck: Can't find filesystem to check or filesystem not mounted with quota option.




LABEL=/                 /                       ext3    defaults,usrquota,grpquota        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0


0
Comment
Question by:aot2002
  • 17
  • 12
  • 3
  • +1
33 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 400 total points
ID: 10751469
Quotas are on a per-filesystem basis, and not per directory, this means that you have to specify a filesystem that is actually mounted on your system and not just a directory on that partition. I assume your /var/ directory is part of the / (root) partition, so try this:

quotacheck -c /

0
 
LVL 1

Author Comment

by:aot2002
ID: 10752856
quotacheck -c /
quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right.
Please stop all programs writing to filesystem or use -m flag to force checking.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10753351
The program told you that it cannot remount the root directory, and that's true.
Just use the -m flag. The results may be slightly inaccurate, but it should work:
quotacheck -c -m /

0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 10753467
0
 
LVL 1

Author Comment

by:aot2002
ID: 10756188

well i followed some documentation here
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-disk-quotas.html

now i had to post a issue for the fstab mistake
http://www.experts-exchange.com/Operating_Systems/Linux/Q_20943410.html#10755861


I tried this line first
LABEL=/           /               ext3    defaults        1 1
as
LABEL=/           /               ext3    defaults,usrquota,grpquota        1 1


then I added this line to the fstab and reverted the above back to normal.....
LABEL=/home       /home           ext3    defaults,usrquota,grpquota 1 2


didnt work and now i cannot boot?
What is so difficult about adding quotas?
i checked some online docs and found one that ran kernel program and it said quotas was already built into the kernel !
i tried compiling the quota tools, seemed ok ?
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10756560
In general, you should leave the root partition alone as far as quotas are concerned. This usually means that / only contains stuff that really has to be on the root partition. Anything else (like e.g. /var, /usr/ or /tmp is on it's own partition).
0
 
LVL 20

Expert Comment

by:Gns
ID: 10756721
Ah, if but I've seen this before... Then your "non-boot" situation would make more sense to me... Oh well:-).

Your first take on things was actually the right one!-)
The line
LABEL=/           /               ext3    usrquota,grpquota,defaults        1 1
in fstab should be just fine.
Then you need do two more things:
touch /aquota.user /aquota.group
quotaon -a
You actually don't need edit fstab to turn on quotas... It's used during startup (by a "quotaon -a" call) to turn it on for all entries in the fstab that have any one of quota, usrquota and/or grpquota ... mount just ignores them.
So if it is just to have a look at it, you could have done
mount -o remount,usrquota,grpquota /
quotaon /dev/hda1
assuming of course that /dev/hda1 is your root filesystem:-). The remount is so that the stupid quota tools actually get a "heads up" that there is quota in effect. Sigh.
Then do the quotacheck to rebuild the aquota files....As per Karl Heinz suggestion, with -m option.
But having quotas turned on will have next to no effect unless you actually assign quotas with edquota.
But you knew most of this, right?-)

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 10758949
Glenn

Wazz up !


ok well i did the touch command and linux said it doesnt have any fingers !
heheh just kiddn

i ran the below
touch /aquota.user /aquota.group
quotaon -a

nothing showed on screen !

edquota -u mark
No filesystems with quota detected.


remember here is my fstab !
cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0


0
 
LVL 20

Expert Comment

by:Gns
ID: 10759272
Less words (from me), and hopefully more correct:-)...:
mount -o remount,usrquota,grpquota /
(you already did the touch, so we'll skip that... And you probably don't need it... Some ol version needed it, so I do it out of habit:-)
quotaon -a
quotacheck -m /
edquota username
...
As I said, the real important thing is the remount... The quota utils are a bit stupid this way;-).
Hm, just checked on a RH9 near me... It might complain a bit, and it does need the files "touched"... OK, here's a list of commands for RH9...
mount -o remount,usrquota,grpquota /
touch /aquota.user /aquota.group
quotacheck -m -a
quotacheck -m -a -g
quotaon -a
edquota username
...

You need do both quota for the user as well as group if you plan on using both... That's why you need the second quotacheck.

Good Luck:)

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 10759523
ok it worked im in the edquota in VI
now i see
Disk quotas for user mark (uid 504):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/hdc2                     22716          0          0        402        0        0
~
~

ausome !
so now i can make quotas for each user ! YOU DA MAN ! im not sure how to setup quotas but i will look into it right now.
im using only user quotas right now Is the quotacheck needed if not using groups right now?

also do i need to run each command once setup or just the quotaon -a command
thanks !

0
 
LVL 20

Expert Comment

by:Gns
ID: 10759965
The first quotacheck builds the file for user (the -u option is the implicit default)... The second (... -g ...) is the one you could well ditch. As well as the grpquota from the mount line.
Once setup, you shouldn't need run anything;-)... It should turn on quotas during bootup...And then the kernel is resposible for keeping the quotas in sync (you'd use the quotacheck command pretty much like you do fsck with a journalized filesystem... When something seems to have hit the fan, and you need rebuild/recover:-).
But this means that we're back at editing /etc/fstab, since you need change the line
LABEL=/                 /                       ext3    defaults        1 1
so that it instead reads
LABEL=/                 /                       ext3    defaults,usrquota        1 1
so that quotaon -a works... on reboot.
Similarily quotaoff -a will be run at system shutdown.
... And since you now have a working setup, it'll actually work too:-).
You might like setquota better than edquota... man setquota
In edquota, the "first" column in blocks/inodes is "currently used by user", the "second column" is the soft limit (0 if unset) and the "third column" is the hard limit... remeber that it is in blocks...:-)

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 10760315
i set the quota's and setup the users to limits then tried to upload a 30meg file and it shouldnt of let me i guess but it did

heres the users data

 repquota -a|grep versatile
versatile --    1992   10000   12000            109     0     0


du -H /var/www/html/versatile.com/
30MB    /var/www/html/versatile.com


hummm doesnt seem to be working ?
0
 
LVL 1

Author Comment

by:aot2002
ID: 10760425
if you notice the 1992 is used but yet they are really using 30mb why didnt it recognize the change in diskspace????


ive bought more points and when they adjust my account i will up the points for your ausome expertise help
0
 
LVL 1

Author Comment

by:aot2002
ID: 10760435
i increased points to 70
0
 
LVL 20

Expert Comment

by:Gns
ID: 10760448
Default grace period == 6 days might have something to do with this:).
Or not... Is this owned by user versatile?
You might need do a quotaoff/quotaon efter editing... It works for me after doing that.

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 10760487
... and I set the grace time to 0 seconds:-).
setquota -u -t 0 0 /
then both
quota versatile
and
repquota -a
should reflect this.
If not, do a quotaoff -a followed by a quotaon -a ... still no joy?

-- Glenn
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 1

Author Comment

by:aot2002
ID: 10760490
Default grace period == 1 days

is this a bad setting???

i just want to block users who try to go over the 10meg limit and not allow grace periods


i did a remount and it worked ok
versatile +-   28384   10000   12000            110     0     0

now it shows the 28megs in there but yet i can still upload files ????


0
 
LVL 1

Author Comment

by:aot2002
ID: 10760506
ok changed to your above code just posted at 03:52PM EDT
and i still can use ftp to upload more files????

the directorys are owned by this user versatile

0
 
LVL 20

Expert Comment

by:Gns
ID: 10760547
Did you try a quotaoff/quotacheck/quotaon cycle?

-- Glenn (who desperately need some sleep... We'll continue tomorrow, OK?)
0
 
LVL 1

Author Comment

by:aot2002
ID: 10760593
[root@localhost named]# quotaoff -a
[root@localhost named]# quotacheck versatile
[root@localhost named]# quotaon -a

ok we can continue tommorrow if you wish.
i will read some documentation if i figure it out i will assign the points
0
 
LVL 20

Expert Comment

by:Gns
ID: 10760652
[root@localhost named]# quotaoff -a
[root@localhost named]# quotacheck -m -a
[root@localhost named]# quotaon -a

-- Glenn (on his way out the door)
0
 
LVL 1

Author Comment

by:aot2002
ID: 10804093
where are we on this ?
i would like to fix this and get it working as should ?

i show the quota's being used when running the commands to display the quotas on system

but i can still go over my limit when uploading via ftp ?

what should i do?
0
 
LVL 20

Expert Comment

by:Gns
ID: 10812060
Try setting the hard quota ridiculously low for versatile, then repeat the quotaoff/quotacheck/quotaon ... then
su - versatile
cp <somefile> <newname>
... should trigger the quota. Then exit and raise the quota back to "normal" (whatever you've set it to:-).
It should be working already, tehrefor the "frobbing":-)

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 10855654
i didnt see this before then again i did change my fstab back to this

 cat /etc/fstab.....

LABEL=/                 /                       ext3    defaults,usrquota,grpquota        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0



 quotaon -a.....
quotaon: using //quota.group on /dev/hdc2: Invalid argument
quotaon: using //quota.user on /dev/hdc2: Invalid argument
0
 
LVL 20

Expert Comment

by:Gns
ID: 10857486
The /quota.* files are for version 1 quota. You should be using the /aquota.* files.
If you really have the spurious /quota.* files, remove them:
rm /quota.*
...
I presume that edquota & friends still work? And that you have the aquota files... so you should only need the "quotaon -a" then...

-- Glenn

0
 
LVL 1

Author Comment

by:aot2002
ID: 10969765
i still am not getting the results of it working?

is there anything i can do to diagnose this?
0
 
LVL 1

Author Comment

by:aot2002
ID: 10978322
increased for your hard work !

now help please !
0
 
LVL 20

Expert Comment

by:Gns
ID: 10984332
Sorry.... Very very busy with paying work ATM. So the quality isn't guaranteed;-):-)

In the mean time... Check that everything we've gone over already still is ,,, OK:-).
One perhaps shouldn't say this, but I've usually needed to ... "fiddle and frob" a bit with this... But when it has started working, then it's just kept working:-).

Um, is this still Rh 8/9? I'm sure we've mentioned it, but you should move to something else, in that case. Mandrake 10 Official Edition is out;-).

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 10990689
i'll fiddle with it and try
0
 
LVL 1

Author Comment

by:aot2002
ID: 11182384
ive decided to forget the quotas for now
0
 
LVL 20

Expert Comment

by:Gns
ID: 11186644
Ok.
Hopefully the situation will be better with a 2.6 kernel.

-- Glenn
0
 
LVL 1

Author Comment

by:aot2002
ID: 11187554
i hope there becomes a solution sometime soon too.
but then id be working with fedora core !
0
 
LVL 20

Expert Comment

by:Gns
ID: 11188220
Or Mkd10:-)

-- Glenn
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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.:

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

8 Experts available now in Live!

Get 1:1 Help Now