Page 57 - RHEL8 BOOK
P. 57
Step1. Create Required users and Group
[root@localhost ~]# useradd tom
[root@localhost ~]# groupadd salesgrp
[root@localhost ~]# groupadd fingrp
[root@localhost ~]# mkdir /salesdept
[root@localhost ~]# useradd -g salesgrp sai
[root@localhost ~]# useradd -g salesgrp ram
[root@localhost ~]# useradd -G fingrp tata
[root@localhost ~]# useradd -G fingrp birla
Step2. Create a required partition
[root@localhost ~]# fdisk -l
[root@localhost ~]# fdisk /dev/sda
Command (m for help): n
Command (m for help): w
[root@localhost ~]# mkfs.ext3 /dev/sda15
[root@localhost ~]# partprobe /dev/sda
Step3. Mount the partition with user and group quota parameters.
[root@comp1 ~]#mount -o usrquota, grpquota <part_name> <mnt_pt>
[root@localhost ~]# mount -o usrquota,grpquota /dev/sda15 /salesdept
[root@localhost ~]# mount
[root@localhost ~]# chmod 777 /salesdept/
Step4. Create the quota Database File
[root@comp1 ~]#quotacheck -cugv <quota_mnt_pt>
[root@localhost ~]# quotacheck -cugv /salesdept
[root@localhost ~]# ls /salesdept/
Step5. To Check the quota status
[root@localhost ~]# quotaon -p /dev/sda15
Step6. Enable the quota partition
[root@comp1 ~]#quotaon <quota_mnt_pt>
[root@localhost ~]# quotaon /dev/sda15
Step7. To apply the quotas for the users on quota enabled partition
[root@comp1 ~]#edquota -u <user name>
[root@localhost ~]# edquota -u tom
Disk quotas for user tom (uid 2001):
Filesystem blocks soft hard inodes soft hard
/dev/sda15 0 0 0 0 3 5
[root@localhost ~]# su – tom
[tom@localhost ~]$ cd /salesdept/
[tom@localhost salesdept]$ touch tfa
[tom@localhost salesdept]$ touch tfb
[tom@localhost salesdept]$ touch tfc
[tom@localhost salesdept]$ touch tfd
[tom@localhost salesdept]$ mkdir tda
[tom@localhost salesdept]$ mkdir tdb
S. Pradhan
(MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
Email Id:-spradhan.iiht@gmail.com
57