Configuring Individual Partitions on Linux machines

an article added by: Daniel K. at 11282007


In: Root » Computers and technology » Linux Commands » Configuring Individual Partitions on Linux machines

French Spanish Portuguese Italian German Japanese Chinese Korean Russian Arabic

Managing Quotas

In any multiuser environment, you’re bound to run across users who—either refusing to play fair or because they’re oblivious to common courtesy—practice the fine art of disk hogging, taking up more than a reasonable amount of disk space. This problem can be managed in several ways. The first and most obvious solution is to beg and plead. This rarely works. The second approach is peer pressure: You regularly and publicly post the amounts of disk space being hogged by these users. If people are at all sensitive to what others think of them, this may work. The final and most successful technique is to institute disk quotas, allowing each user to consume a certain amount of disk space and no more. Enforcement is done by the operating system. Disk quotas are usually the best option for system administrators, because the quotas are automated and don’t require that you confront the offending users. However, technical and/or political barriers may be standing in the way of using them. (For instance, the CEO may not

like being told she can use only 5MB of the server disk space.) Quotas are, of course, optional— your system will be quite happy to hum along without them. Whether they will work in your environment is up to you and your management.

Preparing a Disk for Quotas

Preparing to use disk quotas works in two steps. Step 1 is to make the necessary settings in the /etc/fstab file and add the necessary files in each partition for which you want quota control. Step 1 must be repeated for every partition you want under quota control. Step 2 is to run the quotacheck command to set up the quotas on each of the partitions you’ve configured.

Configuring Individual Partitions

Disk quotas work on either a per-user or per-group basis, with each partition allowing for their own quotas. For example, it’s possible for all users to have a quota associated with their home directories on one partition and another quota on another partition for a group project they’re part of. For each partition on which you want a quota, you’ll need to set up the usrquota option and the grpquota option, and then remount the partition. The usrquota Option Edit the /etc/fstab file so that, for each partition needing quotas, the mount options contain the usrquota option. For example, if /dev/hda5 is mounted to the /home directory and you want that directory to have user quotas, the /etc/fstab entry would be something like this:

    /dev/hda5 /home ext3 defaults,usrquota 1 1

The grpquota Option Partitions needing group quota support should have the grpquota option in the /etc/fstab file, just like the usrquota option as just described. (Note that it’s acceptable to have both options enabled.) For example, if /dev/hda5 is mounted to the /home directory and you want that directory to have group quotas, the /etc/fstab entry would be similar to this:

    /dev/hda5 /home ext3 defaults,grpquota 1 1

Remount the partition Now you simply need to remount the partition using umount and mount.While this act alone won’t make your quota system ready to use, you can’t skip this step! To continue this example, remounting /home on the /dev/hda5 partition would look like this:

    [root@tedford /root]# umount /home
    [root@tedford /home]# mount /home

legal disclaimer

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

related articles

1. Lunux who command who is logged in
Learning Who Is Logged In: who On systems that allow users to log in to other users’ machines or special servers, you will want to know who is logged in. You can generate such a report by using the who command: [michael@workbox michael]$ who The who report looks like this: michael tty1 Jun 14 18:22 rwhite pts/9 Jun 14 18:29 (:0) root pts/11 Jun 14 21:12 (:0) root pts/12 Jun 14 23:38 (:0) A Variation on who: w The w command di...

2. X offers the ability to display content on other hosts
Remote X Displays In Linux tutorial 1, I said that X offers the ability to display content on other hosts’ screens. This makes it possible to log in to a server that has a special program on it and have the display redirected to the screen in front of you. Allowing this to happen is a two-step process. The first step is telling your machine that it should allow connections from another host for X displays. This is done with the xhost command: [michael@workbox michael]$ xhost +ungerer...

3. Editing text filesin Linux Red Hat
Editing Text Files Editors are by the far the bulkiest of common tools, but they are also the most useful. Without them, making any kind of change to a text file would be a tremendous undertaking. Regardless of your Linux distribution, you will have gotten a few editors. You should take a few moments to get comfortable with them before you’re busy fighting another problem. NOTE Although all of the editors listed here come with Red Hat 8, not all of them are installed by default. ...

4. Reviewing Linux File System Standards
Reviewing Linux File System Standards One argument you hear regularly against Linux is that there are too many different distributions, and that multiple distributions lead to fragmentation. This fragmentation will eventuate in different, incompatible Linux versions. This is, without a doubt, complete nonsense that plays on “FUD” (Fear, Uncertainty, and Doubt). These types of arguments usually stem from a misunderstanding of the kernel and distributions. However, the Linux community has realized that it h...

5. Linux is built upon the foundation of file systems
File Systems Linux is built upon the foundation of file systems. They are the mechanisms by which the disk gets organized, providing all of the abstraction layers above sectors and cylinders. In this module, you’ll learn about the composition and management of these abstraction layers supported by the default Linux file system, ext2, and its more robust counterpart, ext3. This module covers the many aspects of managing disks. This includes creating partitions, establishing file systems, automating the process ...

6. Mounting and Unmounting Local Disks
Linux’s strong points include its flexibility and the way it lends itself to seamless management of file locations. Partitions are mounted so that they appear as just another subdirectory. Even a substantial number of file systems look, to the user, like one large directory tree. This characteristic is especially helpful to the administrator, who can relocate partitions to various servers but can have the partitions still mounted to the same location in the directory tree; users of the file system need not know abou...

7. The fsck tool short for File System ChecK
Using fsck The fsck tool, short for File System ChecK, is used to diagnose and repair file systems that may have become damaged in the course of daily operations. Such repairs are usually necessary after a system crash in which the system did not get a chance to fully flush all of its internal buffers to disk. (Although this tool’s name bears a striking resemblance to one of the expressions often uttered after a system crash, that this tool is part of the recovery process is strictly coincidence.) Us...

8. The process of adding a disk under Linux on the Intel
Adding and Partitioning a Disk The process of adding a disk under Linux on the Intel (x86) platform is relatively easy. Assuming you are adding a disk that is of similar type to your existing disks (e.g., adding an IDE disk to a system that already has IDE drives or adding a SCSI disk to a system that already has SCSI drives), the system should automatically detect the new disk at boot time, and all that is left is partitioning it and creating a file system on it. If you are adding a new type of disk (...

9. With the partitions created you need to put file systems on them
Syncing disks. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. [root@tedford /root]# If you needed to write an /etc/fstab file yourself for this configuration, it would look something like this: /dev/hdb1 / ext3 defaults 1 1 /dev/hdb2 swap swap defaults 0 0 /dev/hdb3 /usr ext3 defaults 1 2 /dev/hdb5 /home ext3 defaults 1 2 /dev/hdb6 /var ext3 defaults 1 2 /dev/hdb...

10. Mounting NFS partitions works much the same way as mounting local partitions
Mounting NFS Partitions Mounting NFS partitions works much the same way as mounting local partitions. The only difference is in how the partition is addressed. On local disks, partitions are addressed by their device name, such as /dev/hda1. In NFS mounts, partitions are referenced by their hostnames and export directories. Thus, if the server named ungerer is allowing your host to mount the directory /export/SL1200/MK2 and you want to mount this to /projects/topsecret1, you would use this command:...