Quota Lab

We have a new hard disk to share data for all users in our company. We need to set quota on that share so that everyone has an equal part.

1. Add HDD: /dev/sdb

2. Create partition

   fdisk /dev/sdb -> /dev/sdb1

3. Create filesystem

    mkfs.ext3 /dev/sdb1

4. Create mountpoint

    mkdir /mnt/share

5. Edit fstab

    /dev/sdb1    /mnt/share    ext3    defaults,usrquota,grpquota    0 0

6. Mount

    mount /mnt/share

7. Create quota database files

  quotacheck -cug /mnt/share
quotacheck -vug /mnt/share

8. Enable quota

    quotaon /mnt/share

9. Edit quota database

    edquota -u user1

10. Test

    chmod a+w /mnt/share

11. Manage quota

    quota -uv user1
repquota /mnt/share

12. Manage grace period: When user reaches soft quota, grace period will count. After the period, if the user’s soft quota is still exceeded, although he’s still in his hard quota, he will be blocked.

edquota -t

This lab is done on:

[root@centos ~]# lsb_release -a | grep Description ; echo “Linux kernel: `uname -r`”
Description: CentOS release 5.7 (Final)
Linux kernel: 2.6.18-274.18.1.el5


About dongthao

"Man does not simply exist but always decides what his existence will be, what he will become the next moment"
This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s