Disk Quota

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Free shopping LOW COST -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-3647473415094616"
     data-ad-slot="8200015080"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});

</script>


Disk Quota -


Disk Quota’s

   Restricting a user or a group by creating files in a specific location.
   Restricting a user or a group by the disk space in a specific location.
    
The idea behind quotas is that users are forced to stay under their disk consumption limit or with number of files in a particular location.


Quota is handled on a per user, per file system basis.

Quotas are of two types :


   User level quotas      - usrquota
   Group level quotas     - grpquota



To apply userquota

vi /etc/fstab

/dev/sda5     /home    ext4   defaults,usrquota   0 0

(add usrquota beside defaults)

#mount -o remount,rw /home       (rw - read , write)

(to remount /home partition)      


to check quotas


#quotacheck -cvug  /home


to on quota

# quotaon /home

to set quota for an user

# edquota -u  <username>

/dev/sda5      blocks    soft    hard  inodes  soft     hard
                       32          0          0         12        0         0



Blocks means the data already present in that users home directory
soft means at which space u want to send a warning to user 
hard means at which space u want to restrict user to write into his home directory
note: for both soft&hard we have to add block size
by defaults quotas will be in off mode we have to manually switchon quotas

#quotaon /home

to check:
login as user

type dd if=/dev/zero of=myfile bs=1024 count=10

dd =diskdrive
if = input file (/dev/zero means it's  a null file)
of = output file 
bs=blocksize(default in bytes)
count= howmany no.of blocks u want to create


to check quota as an admin

#repquota /home


to set users mahesh quota for user suresh

#edquota -p mahes suresh

To work with group quota


 to work with groupquota we have to create quota enabled partition


create a partition
format with ext4 file system
create a new mountpoint

#mount -o  usrquota,grpquota <mountpoint>

#quotacheck -cugv  <qoutamountpoint>


edquota -g <groupname> 

Comments