Home
Username:
Password:
Linux Professional Institute: Level 2 Tutorials

Files & Filesystems / Managing Disk Quota

Subtitles of the Movie

Exam objective 1.104.4 has a weight of 3, and verifies that candidates are able to manage disk quotas for users. You should be able to set up a disk quota and then edit, check, and generate user-quota reports. You can put limits per user, or per user group on the amount of space that can be used on each file system. You set two limits for each user. The hard limit is a physically enforced maximum. The user is unable to go above it. The soft limit has a grace period. The user can actually exceed the soft limit, but only for a specified period of time. Once the grace period has expired, the soft limit is enforced as a hard limit. To set quotas and to get quota reports, you will need to have root permissions. Quotas can be set for any file system. The first step is to define which file systems are to have quotas applied to them. To do that, you add the user quota option to the file system entry in fstab; that's for user-level quota setting. If you want to set quotas for groups of users, you specify the group quota option. If you need both on one file system, you can set both. The next thing to do is to create the files that will hold the quota information. By the way, you must be logged in as root to do all this. The files must be owned by the root user, and only root can manipulate quota settings. Using the Touch utility creates an empty file. The names of the files are important. They all start with a quota and they must be named for either users or groups and you need a file on every file system for each quota setting you're going to use. And you need to set the permissions properly on all the files. The files must be owned by the root and this gives read and write permission only to the root. The disks then must all be remounted. The simplest way is to reboot the system. And the simplest way to reboot is to use the Shut Down command with a reboot option. Once you are back up and log in again as root, you can take a look at your mounted drives. The Mount command with no options will display the list of mounted file systems and the options set for them. You should see your user and group quota options set. Now you can do a quota check to verify that it's all set up. The options here, left to right, are Verbose, Group Quotas are to be listed, User Quotas are to be listed, and there should be no attempt to remount the file systems as Read-only. The exact output will vary, but it will look something like this. Now, quotacheck is more than just a simple report. The file is actually updated from the actual disk usage, and it repairs any damage to the quota files. It is suggested that quotacheck be run with the A option, that means, for all file systems, as part of the regular boot sequence. Step 5 is to turn quotas on. The quotaon program turns on quotas for all file systems. The opposite of this program is quotaoff, which can be used to turn quota checking off. Using these commands, you can turn quotas on and off for all file systems, or one file system at a time. You can set the quota levels any time you wish. Just use edquota, and name your user with the U option, or a group with a G option, and the quota setting table will appear in your editor. It comes up in the Vi Editor. The table shows the current number of blocks and inodes that the user has. The soft number is the threshold at which the user will be warned, and his grace period starts running. The hard number is an absolute maximum limit. If zero is set for any of them, as shown in this example, no limit is imposed. The quota system is now running, but there is one more thing you can do. You can get a report on all users over quota. This command will give you such a report. It will show you the status of all quota settings. It will show you how many blocks and inodes are in use, and how much grace time each user has left, and so on. There is really just one thing you can do. Until you have a bunch of users you want to impose quotas on, look up each of the programs discussed in this lesson and read about the options for it. Especially look at how edquota can be set up to use different text editors.

Tutorial Information

Course: Linux Professional Institute: Level 2
Author: Arthur Griffith
SKU: 33894
ISBN: 1-934743-79-8
Release Date: 2008-07-21
Duration: 7.5 hrs / 113 lessons
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available