hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : Enable Quota Support for Plain Red Hat Linux
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

Enable Quota Support for Plain Red Hat Linux

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 01-17-2004, 12:05 AM
choon choon is offline
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,790

Enable Quota Support for Plain Red Hat Linux


Hi everyone,

These are the steps I used to enable quota support for all my managed plain Red Hat Linux servers so that you can set user or/and group quota.

What is Quota?
Quoted from http://www.tldp.org/HOWTO/Quota-1.html#ss1.1
Quote:
Quota allows you to specify limits on two aspects of disk storage: the number of inodes a user or a group of users may possess; and the number of disk blocks that may be allocated to a user or a group of users.

The idea behind quota is that users are forced to stay under their disk consumption limit, taking away their ability to consume unlimited disk space on a system. Quota is handled on a per user, per file system basis. If there is more than one file system which a user is expected to create files, then quota must be set for each file system separately. Various tools are available for you to administer and automate quota policies on your system.
Step 1: Gain root access to your server using SSH.

Step 2: Check whether the quota package is install or otherwise please install it before continue.
Code:
rpm -qa|grep quota
Step 3: Modify /etc/fstab file
Partitions that you have not yet enabled quota normally look something like:
Code:
/dev/hda5     /home           ext3            default   1 2
To enable user quota support for that partition, simply add in usrquota next to default such as below:
Code:
/dev/hda5     /home           ext3            default,usrquota   1 2
To enable group quota, just add grpquota.
To enable both user and group quotas, add in both usrquota,grpquota.

Step 4: Reboot or Not to Reboot.
Normally I won't reboot, you can try this command on the partition that you have modified or added in quota support:
Code:
mount -o remount /home
Step 5: Quota Check
Code:
/sbin/quotacheck -cguvamf -F vfsv0
Step 6: Rerun Quota Check for old version
Code:
/sbin/quotacheck -cguvamf -F vfsold
Step 7: Turn on Quotas
Code:
/sbin/quotaon -a
To see the report of quotas, issue this command:
Code:
repquota -a
To set a user quota, issue the following command:
Code:
setquota -u USERNAME SOFTQUOTA HARDQUOTA SOFTFILELIMIT HARDFILELIMIT -a
Where:
USERNAME is the user
SOFTQUOTA in kilobytes
HARDQUOTA in kilobytes
SOFTFILELIMIT set it to 0 normally
HARDFILELIMIT set it to 0 also

You are done )

References:
Quota mini-HOWTO

Thanks.

Kindest regards,
Choon


Last edited by SoftWareRevue; 01-17-2004 at 01:34 PM.
Reply With Quote


Sponsored Links
  #2  
Old 01-17-2004, 01:28 AM
BP Steven BP Steven is offline
WHT Addict
 
Join Date: Feb 2003
Posts: 132
Nice howto, however you may want to explain what quota does in the intro as I'm sure there will be newbies who don't know what it does.

Reply With Quote
  #3  
Old 01-17-2004, 01:32 AM
choon choon is offline
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,790
Thanks for your feedback and I can't edit my post but those newbies will have a reference URL in my post that they can read the Quota Intro.

Once again, thanks.

Reply With Quote
Sponsored Links
  #4  
Old 01-17-2004, 06:36 AM
Knogle Knogle is offline
Web Hosting Master
 
Join Date: Feb 2002
Posts: 3,727
choon, report your post to a CL, and state the update you want to make. We can do it for you.

<edit>signature removed</edit>


Last edited by choon; 04-12-2004 at 08:39 AM.
Reply With Quote
  #5  
Old 01-17-2004, 10:59 PM
propcgamer propcgamer is offline
Aspiring Evangelist
 
Join Date: Oct 2002
Posts: 437
Nice guide! Thanks!

<edit>signature removed</edit>


Last edited by choon; 04-12-2004 at 08:39 AM.
Reply With Quote
  #6  
Old 04-03-2004, 04:40 PM
LynxPrime LynxPrime is offline
Junior Guru Wannabe
 
Join Date: Mar 2004
Location: LA
Posts: 45
i needed that haha thx

<edit>signature removed</edit>


Last edited by choon; 04-12-2004 at 08:40 AM.
Reply With Quote
  #7  
Old 06-08-2004, 01:34 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
worked for me, thanks!

Reply With Quote
  #8  
Old 06-08-2004, 02:25 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
when i do repquota -a it shows me one of the user using 11600 blocks (i.e. 11.6Mb) whereas when i do a du -sk inside the user's home directory it shows 17Mb disk space used.

Why does the repqota doesn't match the actual disk usage?

I also did /sbin/quotacheck -avug still the results are the same.

Reply With Quote
  #9  
Old 08-01-2005, 09:47 AM
heislyc heislyc is offline
New Member
 
Join Date: Aug 2005
Posts: 0
Quote:
Originally posted by choon
Thanks for your feedback and I can't edit my post but those newbies will have a reference URL in my post that they can read the Quota Intro.

Once again, thanks.
Choon,
Its not working for me, How? Everyone, i need serious help for the mail server quota setup. I've followed every steps in man How-To, but still, the quota i've set(edquota) for any user couldn't take effect while the user login into his mail box. The mail box limit wasn't updated according to the aquota.user. Is that possible the problem with my Sendmail? How to rectify this?

Reply With Quote
  #10  
Old 08-01-2005, 02:47 PM
choon choon is offline
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,790
Quote:
Originally posted by hostchamp
when i do repquota -a it shows me one of the user using 11600 blocks (i.e. 11.6Mb) whereas when i do a du -sk inside the user's home directory it shows 17Mb disk space used.

Why does the repqota doesn't match the actual disk usage?

I also did /sbin/quotacheck -avug still the results are the same.
Did you check for ownership in the user home directory? Are all the files in it owned by that user?

Reply With Quote
  #11  
Old 08-01-2005, 02:59 PM
choon choon is offline
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,790
Quote:
Originally posted by heislyc
Choon,
Its not working for me, How? Everyone, i need serious help for the mail server quota setup. I've followed every steps in man How-To, but still, the quota i've set(edquota) for any user couldn't take effect while the user login into his mail box. The mail box limit wasn't updated according to the aquota.user. Is that possible the problem with my Sendmail? How to rectify this?
Show me output of the following commands:
Code:
cat /etc/fstab
mount
And your MTA is sendmail which those mailboxes are in /var/spool/mail directory ? You might want to see the location of the user mailbox and its ownership... ... mailbox quota is different from system user quota though... ...

Reply With Quote
  #12  
Old 08-01-2005, 09:52 PM
heislyc heislyc is offline
New Member
 
Join Date: Aug 2005
Posts: 0
Quote:
Originally posted by choon
Show me output of the following commands:
Code:
cat /etc/fstab
mount


Code:
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
LABEL=/home             /home                   ext3    defaults,usrquota,grpquota        1 1
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
/dev/sda8               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0

mount:
/dev/sda6 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /home type ext3 (rw,usrquota,grpquota)
none on /dev/shm type tmpfs (rw)
/dev/sda7 on /tmp type ext3 (rw)
/dev/sda5 on /usr type ext3 (rw)
/dev/sda3 on /var type ext3 (rw)
Quote:
And your MTA is sendmail which those mailboxes are in /var/spool/mail directory ? You might want to see the location of the user mailbox and its ownership... ... mailbox quota is different from system user quota though... ...
Yes, /var/spool/mail. The location of user mailbox is located at /home/<user>. Shall i make sure all <user>'s file and group ownership is <user>? or some <user>, some mail group?

I found ..../openwebmail/etc/users.conf/ What is the correct ownership and mod for these <user> config files? and what's the correct ownership and mod for users.conf directory? How to make edquota able to edit the users.conf/<user> files?

Reply With Quote
  #13  
Old 08-01-2005, 10:32 PM
choon choon is offline
Retired Moderator
 
Join Date: Jul 2001
Location: Singapore
Posts: 1,790
If each user real mailbox are stored in /var/spool/mail directory and /home/<user>/mail/mailbox is a symlink to /var/spool/mail/<user>-mailbox... then you need to enable quota support for your /var partition. If it is the other way, then you don't need to but it is a good idea to enable it though.

User quota support is only taken those files owned by their respective user in the partition that you enable usrquota support. Likewise for grpquota is only taken those files which are owned by the <group>. Whereby for anything related to your mail/MTA setting/configuration is going a bit off-topic... ...

Reply With Quote
  #14  
Old 08-01-2005, 11:49 PM
heislyc heislyc is offline
New Member
 
Join Date: Aug 2005
Posts: 0
Can anyone tell me the default permission/ownership settings for /openwebmail/*?

Reply With Quote
  #15  
Old 08-02-2005, 04:52 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
Choon is my /etc/fstab setup correctly to support quota?

---------------------------------------------------------------------------
/dev/hda2 / ext3 grpquota,usrquota,dev,suid,exec 0 1
/dev/hda1 /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 0 0
#/dev/hdc5 /mnt/oldbackup ext2 noauto 0 3
#/dev/hdd2 /mnt/oldprimary ext3 noauto 0 0

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
The Linux Foundation Partners with Xen for Open Source Cloud Project Web Hosting News 2013-04-15 15:19:00
DreamHost-Connected Cloud Storage Spinoff InkTank Joins Linux Foundation Web Hosting News 2012-08-28 16:20:56
Red Hat Surpasses $1 Billion in Revenue, Illustrates Open Source, Linux Popularity Web Hosting News 2012-03-29 16:43:31
Data Center Firm Colocation America Donates Dedicated Server to Mepis.org Web Hosting News 2011-07-26 15:12:24
Web Host SoftLayer Adds Ksplice Uptrack for No-Reboot Linux OS Updates Web Hosting News 2011-06-09 11:50:15


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?