setting up quotas EASY QUESTION

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


LVL 1
aot2002Asked:
Who is Participating?
 
Karl Heinz KremerConnect With a Mentor Commented:
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
 
aot2002Author Commented:
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
 
Karl Heinz KremerCommented:
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
owensleftfootCommented:
0
 
aot2002Author Commented:

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
 
Karl Heinz KremerCommented:
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
 
GnsCommented:
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
 
aot2002Author Commented:
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
 
GnsCommented:
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
 
aot2002Author Commented:
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
 
GnsCommented:
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
 
aot2002Author Commented:
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
 
aot2002Author Commented:
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
 
aot2002Author Commented:
i increased points to 70
0
 
GnsCommented:
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
 
GnsCommented:
... 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
 
aot2002Author Commented:
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
 
aot2002Author Commented:
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
 
GnsCommented:
Did you try a quotaoff/quotacheck/quotaon cycle?

-- Glenn (who desperately need some sleep... We'll continue tomorrow, OK?)
0
 
aot2002Author Commented:
[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
 
GnsCommented:
[root@localhost named]# quotaoff -a
[root@localhost named]# quotacheck -m -a
[root@localhost named]# quotaon -a

-- Glenn (on his way out the door)
0
 
aot2002Author Commented:
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
 
GnsCommented:
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
 
aot2002Author Commented:
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
 
GnsCommented:
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
 
aot2002Author Commented:
i still am not getting the results of it working?

is there anything i can do to diagnose this?
0
 
aot2002Author Commented:
increased for your hard work !

now help please !
0
 
GnsCommented:
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
 
aot2002Author Commented:
i'll fiddle with it and try
0
 
aot2002Author Commented:
ive decided to forget the quotas for now
0
 
GnsCommented:
Ok.
Hopefully the situation will be better with a 2.6 kernel.

-- Glenn
0
 
aot2002Author Commented:
i hope there becomes a solution sometime soon too.
but then id be working with fedora core !
0
 
GnsCommented:
Or Mkd10:-)

-- Glenn
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.