Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with quota :(

Status
Not open for further replies.

haneo

Programmer
Jan 2, 2002
274
CA
I want to set quota on our mail server 100Go SCSI HD+1GO RAM
+4 CPU Xeon 1.40GHz, with RedHat 8.0 (smp enabled in kernel)

for /home partition so i have read the quota mini howto,
i have changed my /etc/fstac like this:

/dev/sda7 /home ext2 defaults,usrquota,grpquota 1 2

and added the files :
touch /home/quota.user
touch /home/quota.group

i reboot my Linux server.

but i get this error:
#edquota -u SOMEUSER
edquota: Quota file not found or has wrong format.
No filesystems with quota detected.



when i issue :
#quotaon -a
i get :
quotaon: Cannot find quota file on /home [/dev/sda7] to turn quotas on/off.
quotaon: Cannot find quota file on /home [/dev/sda7] to turn quotas on/off.

where is the problem ?


i have used

/home/quota.user
/home/quota.group instead but always the same problem

in my /var/log/message i have this after reboot:




Mar 8 10:37:31 mail quotaon: quotaon:
Mar 8 10:37:31 mail quotaon: Cannot find quota file on /home [/dev/sda7] to turn quotas on/off.
mar 8 10:37:31 mail rc.sysinit: Enabling local filesystem quotas: failed
Mar 8 10:37:31 mail quotaon: quotaon: Cannot find quota file on /home [/dev/sda7] to turn quotas on/off.
 
I haven't done quotas myself, but found this link:

After the creating those two quota files, you 'chmod 600' them, then you "must initialize the files" with the 'edquota' command (check the examples at the link above). Then you need to reboot, and then finally use 'edquota' to set quota values. --
JR
 
try this..........

#!/usr/bin/perl

if (! -e "/vsrvmgrq") {
system("/sbin/quotaoff -a 2>/dev/null");
system("cp -f /etc/fstab /etc/fstab.quotas");
}

open(FTQ,"/etc/fstab.quotas");
while(<FTQ>) {
$line = $_;
/^(\S+)/;
$dsk = $1;
$dsk =~ s/^LABEL=//g;
if ($line =~ /ext2/ || $line =~ /ext3/) {
if (/defaults/) {
if ($line =~ /\S+\s*(\S+)/) {
$mntpoint = $1;
unlink(&quot;$mntpoint/quota.user&quot;);
unlink(&quot;$mntpoint/aquota.user&quot;);
}
}
}
}
close(FTQ);


system(&quot;/scripts/initquotas&quot;);

system(&quot;/scripts/resetquotas&quot;);


if (! -e &quot;/vsrvmgrq&quot;) {
system(&quot;/sbin/quotaon -a 2>/dev/null&quot;);
}

[afro]
 
Instead of /home/quota.user,touch /home/aquota.user.This step will solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top