Home arrow Site Administration arrow Page 4 - Kernel, Cron, and User Administration, Part 1

The Quota Package - Administration

Today, get started with your RHCE certification. Learn about shell configuration files, setting up and managing disk quotas, and the basics of the kernel. This comes from chapter five of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7).

  1. Kernel, Cron, and User Administration, Part 1
  2. Certification Objective: Shell Configuration Files
  3. Setting Up and Managing Disk Quotas
  4. The Quota Package
  5. Quota Management Commands
  6. Automating Quota Settings
  7. The Basics of the Kernel
  8. Kernel Concepts
  9. Other RHEL 3 Kernels
  10. Understanding Kernel Modules
  11. /lib/modules/kernel_version/ Directory Structure
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 11
August 25, 2004

print this article



The quota RPM package is installed by default on RHEL 3, as well as Red Hat Linux 9. You can find out more about RPMs such as quota with the following command:

# rpm -qi quota

Assuming you havenít removed the quota RPM, youíll see the following description of the package which tells you that it includes a number of tools:

The quota package contains system administration tools for monitoring and limiting user and or group disk usage per filesystem.

You can find out more about these tools by reviewing a list of associated files. You can find a list of files installed through the quota RPM with the following command:

# rpm -ql quota

As you can see for yourself, the quota package includes the following commands:

  • /sbin/quotaon /fs  Enables quotas for the /fs filesystem.
  • /sbin/quotaoff /fs  Disables quota tracking.
  • /usr/sbin/edquota name  Edits the quota settings for user name. Can also be used to set defaults, or to copy quota settings from one user to another.
  • /usr/bin/quota  Allows users to see their current resource consumption and limits.
  • /usr/sbin/repquota  Generates a report of disk consumption by all users for a quota-enabled filesystem.'
  • /sbin/quotacheck  Scans a filesystem for quota usage. Initializes the quota databases.

Iíve included the entire path to each command for your reference. But as discussed earlier in this book, I recommend that you normally work as the root user during the Red Hat exams. As the noted directories are all part of the root userís PATH, you donít need to specify the full path to each command. (You can verify the directories in your path with the echo $PATH command.)

The next step is to ensure that the quotas are active and checked when Linux boots on your system.

sysinit Quota Handling

The /etc/rc.sysinit script as described in Chapter 4 initializes Linux system services during the boot process. This script includes commands which start quota services. Specifically, this script runs both the quotacheck (to ensure that disk consumption usage records are accurate) and quotaon commands (to enable quotas on all filesystems indicated in /etc/fstab). You donít have to run these commands manually.

Quota Activation in /etc/fstab

As described in Chapter 4, the file /etc/fstab tells Linux which filesystems to mount during the boot process. The options column of this file configures how Linux mounts a directory. You can include quota settings in /etc/fstab for users and or groups.

ON THE JOB!  Before you edit a key configuration file such as /etc/fstab, itís a good idea to back it up and save it to any boot or rescue disks that you may have. If your changes lead to a catastrophic failure, you can boot your system from a rescue disk and then restore the original configuration file.

Here is a sample /etc/fstab before editing:

Device      Mount point Filesys Options          dump Fsck
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    proc    tmpfs             0    0
/dev/hda3   swap        swap    defaults          0    0
/dev/hdd1   /home       ext3    defaults          1    2
/dev/cdrom  /mnt/cdrom  udf,iso9660  noauto,owner,kudzu,ro  0 0
/dev/floppy /mnt/floppy auto    noauto,owner,kudzu 0    0

In this configuration, we may want to enable quotas on the root (/) and /home directory filesystems. You can tell Linux to start tracking user quotas by adding the keyword usrquota under the options column. Similarly, you can tell Linux to start tracking group quotas with the grpquota option. Use vi or your favorite text editor to update /etc/fstab.

In our example, we will add both user and group quotas to the /home directory filesystem:

Device      Mount point Filesys Options          dump Fsck 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    proc    tmpfs             0    0
/dev/hda3   swap        swap    defaults          0    0
/dev/hdd1   /home       ext3 exec,dev,suid,rw,usrquota,grpquota  1    2
/dev/cdrom  /mnt/cdrom  udf,iso9660  noauto,owner,kudzu,ro  0    0
/dev/floppy /mnt/floppy auto    noauto,owner,kudzu 0    0

If you edit the /etc/fstab file by hand, youíll need to ensure that the line you are editing does not wrap to the next line. If it does, the format for your /etc/fstab will be invalid and you may not be able to successfully boot Linux.

ON THE JOB!  You can test changes to /etc/fstab by rebooting your computer or remounting a filesystem. For example, if youíve just added usrquota and grpquota entries as shown to the /home directory filesystem, you can test it with the mount -o remount /home command.

This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.

>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: