Set Quota on your Linux system | All about OS

Set Quota on your Linux system

Категория: Securing and Optimizing

• To reboot your system, use the following command:
[root@deep /]# reboot
Assigning Quota for Users and Groups
After your system has been rebooted you can assign quotas to users or groups of users on your system. This operation is performed with the “edquota” command, edquota (8).
The edquota program
The edquota program is a quota editor that creates a temporary file of the current disk quotas used by the super-user “root” to set quotas for users or group of users in the system. The example below shows you how to setup quotas for users or groups on your system.
Assigning quota for a particular user
Consider, for example, that you have a user with the login id “wahib” on your system. The following command takes you into the editor (vi) to edit and set quotas for user “wahib” on each partition that has quotas enabled:
Stepi
• To edit and modify quota for user “wahib”, use the following command: [root@deep /]# edquota -u wahib Quotas for user wahib:
/dev/sda6: blocks in use: 6, limits (soft = 0, hard = 0) inodes in use: 5, limits (soft = 0, hard = 0)
After the execution of the above command, you will see the following lines related to the user “wahib” appear on the screen. The “blocks in use:” display the total number of blocks (in kilobytes) the user has consumed on a partition. The “inodes in use:” display the total number of files the user has on a partition. These parameters (”blocks in use, and inodes in use”) are controlled and set automatically by the system and you don’t need to set or change them.
Step 2
To assign 5MB of quota for user “wahib”, change the following parameters in the vi editor:
Quotas for user wahib:
/dev/sda6: blocks in use: 6, limits (soft = 0, hard = 0)
inodes in use: 5, limits (soft = 0, hard = 0) To read:
Quotas for user wahib: /dev/sda6: blocks in use: 6, limits (soft = 5000, hard = 0)
inodes in use: 5, limits (soft = 0, hard = 0)
The “soft limit” (soft =) specifies the maximum amount of disk usage a quota user is allowed to have.
The “hard limit” (hard =) specifies the absolute limit on the disk usage a quota user can’t go beyond it. Take a note that the “hard limit” value works only when the “grace period” parameter is set.

Страниц: 1 2 3 4 5

« Securities Software (Management & Limitation).Linux GnuPG