|
Disk Quota example and implementation RHCE Linux |
| Home | Peer to Peer | CompTIA N+ | CCNA | MCSE | MCITP | RHCE | Interview | Tips n Tricks |
Disk Quota Implementation RHCE LinuxIn our pervious article we learn about basic necessary concept used for disk quota implementation. Now we will first look at the outline of question that may be asked in RHCE exam. Example 1 Example 2 SolutionsExample 2 is extremely complicated question from Redhat. Actually question is giving scenario to you to implement quota to vinita user. You should apply the quota to vinita user on /home that vinita user shouldn’t occupied space more than 100K. To solve disk quota question follow these guides Check the quota RPM (installed by default) 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. I add both user and group quotas to the /home directory filesystem The next step is to create quota files. For user and group quotas, you will need the aquota.user and aquota.group files in the selected filesystem before you can activate actual quotas.
# mount -o remount /home # quotacheck -cugm /home The options for quotacheck are
This will check the current quota information for all users, groups, and partitions. It stores this information in the appropriate quota partitions. Once the command is run, you should be able to find the aquota.user and aquota.group files in the configured directory. or you can create these files manually #touch /home/aquota.group #touch /home/aquota.user
edquota command will edits the aquota.user or aquota.group file with the vi editor. In our example, we have a user named vinita, and we want to restrict how much disk space she is allowed to use. Set softlink to 50 and 100 to hard link
You can also set grace period for user ( set only if you are asked by examiner)
Now login from vinita When testing quotas, there is one useful technique that creates a blank file of the desired size. For example, if you want to create a 100MB file named test in the local directory, run this command
When user vinita run dd command first time to create a blank file more then 50 Mb she got an warning and the file was created. As she is allowed to exceed her soft limit for 10 days. Second time she tried to create a file of 500 Mb. As you can see in image she was able only to create a file of 20 Mb. As she can not exceed her hard limit that is set to 100 inode. In third time she is denied to use any more space as she have already crossed her hard limit. You can verify the space of created file by du command with -h options. After successfully completing your practical remove quota entry /etc/fstab
Now turn off quota by quotaoff command and remount home partition for further practical
|
|||||
|
|
|
|