Top Ad unit 728 × 90

Latest updates

recent

DISK QUOTAS PRACTICAL STEPS


#### TO IMPLEMMENT THE DISK QUOTAS ON PARTITION ####

'Step 1:-Create One Partition & Format'
# fdisk /dev/sda (to create)
# partx -a /dev/sda (to update)
# mkfs.ext4 /dev/sda8 (for example-to format)
# mkdir /quota (create a new mount point)

'Step 2:-Apply Quotas Permission on the Partition'
# mount -o usrquota,grpquota /dev/sda8 /quota
# mount (to check)

'Step 3:-Create Quota Database in the Partition'
# quotacheck -cugv /quota

'Step 4:-Enable the Quota Service'
# quotaon /quota (to enable)
# quotaon -p /quota (to check)

'Step 5:-Apply Full Permission on Mount Point'
# chmod 777 /quota

'Step 6:-Define the Quota Limit Based on Inode or Block'
Create 2 Users
# useradd tom
# useradd jack


'### Defining Quotas Based on User Level ###'

(A)Implemmenting quotas based on inode for User:tom
# edquota -u tom
Filesystem block soft hard inode soft hard
/dev/sda8 0 0 0 0 5 10
:wq(save & quit the file)
# su - tom (login as a user to check the result)
# cd /quota (access mount point)
# touch tom{1..10} (create 10 files)
# ls (to check)
# touch tom11 (try to create 11th file)
# exit (logout)

(B)Implemmenting quotas based on block for User:jack
# blockdev --getbsz /dev/sda8 (to check block size)
# edquota -u jack
Filesystem block soft hard inode soft hard
/dev/sda8 0 12 20 0 0 0
:wq(save & quit the file)
# su - jack (login as a user to check the result)
# cd /quota (access mount point)
# mkdir jack{1..5} (create 5 dir's)
# ls (to check)
# mkdir jack6 (try to create 6th dir)
# exit (logout)

NOTE:-If the block size of the partition is 4096 bytes
then the size of each empty dir will be 4kb
(1 block=1kb)
'Defining the Quotas Based on Group Level'
Create 3 Users (for example:a1 to a3)
# groupadd zoom (create one group)
# usermod -g zoom a1 (to add user as a primary)
# usermod -g zoom a2
# usermod -g zoom a3

(A)Implemmenting quotas based on inode for group:zoom
# edquota -g zoom
Filesystem block soft hard inode soft hard
/dev/sda8 0 0 0 0 10 15
:wq(save & quit the file)
# su - a1
# cd /quota
# touch file{1..5} (create 5 files as user:a1)
# exit (logout)
Then Create 5 files each as a user:a2 & a3
# touch file16 (try to create 16th file as user:a3)
# exit (logout)
DISK QUOTAS PRACTICAL STEPS Reviewed by Unknown on 3:50 PM Rating: 5
© 2007 - 2016. All Rights Reserved by Babashaheer Blog

Contact Form

Name

Email *

Message *

Powered by Blogger.