Skip to content

            Lost ?  |  Need an account:
 
Linux Quota Tutorial PDF Print E-mail
(3 votes, average 4.67 out of 5)
Written by Tom Hirt   
Tuesday, 26 May 2009 13:52
Article Index
Linux Quota Tutorial
Quota Configuration
Assigning Quota Policies
All Pages

 

Quota Tutorial


In this series, we will walk you though enabling quota support within Linux.  Quotas are important as a system administrator because they allow us to limit (by user or group) the number of inodes and/or blocks a user/group can use on a particular file system.

Blocks in the Linux world are a measurement of 1K increments.  Every file system has a finite number of blocks, better know as free space.  Once a file system runs out of blocks (free space), the file system can not be written to further until free blocks are made available.  One can easily examine the number of free/used blocks on a file system with the df command (see example output below.)  Enabling a block quota can ensure that any given user/group does not consume all the available free disk space.

[root@Linux01 ~]# df
Filesystem
1K-blocks
Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol04
3999424 2212740 1580248 59% /
/dev/sda1
101086
12174 83693 13% /boot
tmpfs
1029908
0 1029908 0% /dev/shm
/dev/mapper/VolGroup00-LogVol00 1015704 41504 921772 5% /home
/dev/mapper/VolGroup00-LogVol02 1015704 70652 892624 8% /tmp
/dev/mapper/VolGroup00-LogVol03
2031440
153976 1772608 8% /var
Note: 1,240 blocks = 1 MB.  So the /dev/mapper/VolGroup00-LogVol04 file system above with 3999424 blocks has a total size of 3.8GB (3999424 blocks / 1024K = 3905.6MB / 1024K = 3.8GB)

For those not familiar with the term inode or index node, they provide the ext3 file system with attribute values such as:

  • File type (executable, block, special etc)
  • Ower
  • Group
  • Permisions (read, write, executable)
  • File size
  • File access information (modification time, last access time, creation time etc.)
  • Number of links (soft or hard)
  • Extended attributes
  • Access Control List information (ACL)

Every file on an ext3 file system has a inode, and just like disk space, you can run out of inodes.  You can use the command df -i to inspect your free inode count (see below), but once the number of free inodes reaches 0, you will no longer be able to create new files on a file system.  Enabling a inode quota will provide you with a means to limit the number of inodes a user/group can create.  This has a direct correlation with the number of files the user/group will be able to create but can ensure that any one given user/group doesn't accidentally (or on purpose) use all the free indoes on the file system.

[root@Linux01 ~]# df -i
Filesystem
Inodes
IUsed IFree IUse% Mounted on
/dev/mapper/VolGroup00-LogVol04
1032192 89266 942926 9% /
/dev/sda1
26104
33 26071 1% /boot
tmpfs
257477
1 257476 1% /dev/shm
/dev/mapper/VolGroup00-LogVol00 262144 28 262116 1% /home
/dev/mapper/VolGroup00-LogVol02 262144 20 262124 1% /tmp
/dev/mapper/VolGroup00-LogVol03
524288
900 523388 1% /var
Note: You can see we have plenty of free inodes on each file system




Comments
Add New Search
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Tuesday, 02 June 2009 10:07
 

Forum Activity

Author: helenaprincesss
Aug.21.10
Author: helenaprincesss
Aug.21.10
Author: iinfotech10
Jul.30.10
Author: thirt
Jun.17.10
Author: data2020
May.28.10

Online Stats

Guests Online: 45
Members Online: 0