Disk quota
• Disk quota is used to control how much disk space a
particular user can access.
• Quota tools:
• quotacheck
• quotaon
• quotaoff
• edquota
• repquota
•
Quota tools
• Quotacheck:
• It scans the file system for the current disk usage and update
the aquota.user file.
• Quotaon:
• It turns on the quota.
• Quotaoff
• It turns off the quota.
• Edquota:
• It is used to set disk quotas for a user.
• Repquota:
• It displays summary of disk quotas and the quota usage .
•
Implementing quota
• To implement disk quota for an user, set the user quota for
the home directory by replacing its “defaults” entry with
“usrquota” in fstab file.
• The following slides will guide you how to implement disk
quota for particular user.
Implementing quota
Open the
fstab file.
Implementing quota
Replace this
defaults as
usrquota.
Implementing quota
Now usrquota is
assigned to the
/home directory.
Implementing quota
Here you can see that the
Remount the /home
user quota is not updated for
directory to update.
the /home directory.
Now you can see the user
quota got assigned to
/home directory
Implementing quota
Create quota database file
named aquota.user to hold
the quota information for all
It checks the validity
users. of
quota database of the
/home directory.
Implementing quota
Turn on the quota.
Implementing quota
Let us set disk
quota for the user
jack.
Implementing quota
To assign the
quota for the user
jack.
Implementing quota
This soft The
Blocks represents limitmaximum memory space for a
will just issue
To setThis
user. softwill
limitdeny
for the user to
To set hard disk
limit a warning
forspace number
in KB. if he exceeds soft
Inode represents of limit. theifinode
access, .
he exceeds the quota
inode.
files and directories can be limit.
accessed by the user.
Implementing quota
Here we set soft limit
as 40 KBwe
Here memory
set hard limit
Here we set
space
ashard
50 .KB
limit as 20 Here we set soft
memory
inodes .so that user can. access
space limit as 15 inodes .
only max of 20 inodes.
Implementing quota
It displays summary
of disk usage.
User jack has a hard limit(block
User jack has a hard limit (file limits)
limits) of 50KB and soft limit of 40
of 20 inodes and soft limit of 15
KB, he already used 10KB. inodes , he already used 10 inodes.
Implementing quota
User jack created five files without any
warnings. But when he create sixth file a
warning message is displayed. This indicates
the user had exceeded the soft limit.
Implementing quota
Now, when the jack attempt to create
more than ten files i.e., the eleventh
file then write failed message occurs.
Implementing quota
Here jack use dd command to
create a file named ‘1’ of 30KB.
Since the user exceeds the soft
limits a warning messages is
occurred.
Implementing quota
Here jack attempt to create a file
named ‘2’ of 10KB . But since, he
has exceeded hard limit write
failed error occurred.
Implementing quota
Here we can notice that the jack
had used all this quota. So he is
restricted to create files.