LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Disk Quotas not giving warning in ext4 filesystem of CentOS 6.0 32 Bit (http://www.linuxquestions.org/questions/linux-server-73/disk-quotas-not-giving-warning-in-ext4-filesystem-of-centos-6-0-32-bit-920848/)

vikas027 12-28-2011 05:24 AM

Disk Quotas not giving warning in ext4 filesystem of CentOS 6.0 32 Bit
 
Dear All,

I am using a CentOS 6.0 32 Bit box and have set up Disk Quotas for users based on File Size and Files limitation.

I get an error when a quota (file size OR no. of files) is increased but I do NOT get any warning. Although same (almost) configuration/steps in CentOS5.X works flawlessly.

These are the steps I am following:
1) Edit /etc/fstab as follows
Code:

/dev/mapper/vg_ftp-lv_home /home                  ext4    defaults,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0        1 2
2) Quotacheck
Code:

[root@ftp ~]# quotacheck -cvgum /home
quotacheck: Scanning /dev/mapper/vg_ftp-lv_home [/home] done
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Checked 3 directories and 19 files
quotacheck: Old file not found.
quotacheck: Old file not found.
[root@ftp ~]#

3) Quota ON
Code:

[root@ftp ~]# quotaon -vgu /home
/dev/mapper/vg_ftp-lv_home [/home]: group quotas turned on
/dev/mapper/vg_ftp-lv_home [/home]: user quotas turned on
[root@ftp ~]#

4) Set Quota for user "vikas"

Warning Size of File(s) = 250 MB
Maximum Size of File(s) = 300 MB

Warning number of Files = 10
Maximum number of Files = 15

Code:

[root@ftp ~]# setquota -u vikas 256000  307200  10 15 -a /home
[root@ftp ~]# repquota /home
*** Report for user quotas on device /dev/mapper/vg_ftp-lv_home
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      20      0      0              2    0    0     
vikas    --      16  256000  307200              4    10    15     
[root@ftp ~]#



Now, this should have given me a warning for files.
Code:

[vikas@ftp ~]$ ls -la
total 20
drwx------  2 vikas ftpusers 4096 Dec 28 22:13 .
drwxr-xr-x. 5 root  root    4096 Dec 28 22:13 ..
-rw-r--r--  1 vikas ftpusers  18 Jun 22  2010 .bash_logout
-rw-r--r--  1 vikas ftpusers  176 Jun 22  2010 .bash_profile
-rw-r--r--  1 vikas ftpusers  124 Jun 22  2010 .bashrc
[vikas@ftp ~]$
[vikas@ftp ~]$ touch 1 2 3 4 5 6 7 8
[vikas@ftp ~]$
[vikas@ftp ~]$ ls -la
total 20
drwx------  2 vikas ftpusers 4096 Dec 28 22:18 .
drwxr-xr-x. 5 root  root    4096 Dec 28 22:13 ..
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 1
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 2
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 3
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 4
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 5
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 6
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 7
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 8
-rw-r--r--  1 vikas ftpusers  18 Jun 22  2010 .bash_logout
-rw-r--r--  1 vikas ftpusers  176 Jun 22  2010 .bash_profile
-rw-r--r--  1 vikas ftpusers  124 Jun 22  2010 .bashrc
[vikas@ftp ~]$

[root@ftp ~]# repquota -a
*** Report for user quotas on device /dev/mapper/vg_ftp-lv_home
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      20      0      0              2    0    0     
vikas    -+      16  256000  307200            13    10    15  6days
[root@ftp ~]#

OR on creating a file of 280 MB.

Code:

[vikas@ftp ~]$ dd if=/dev/zero of=file bs=1M count=290
290+0 records in
290+0 records out
304087040 bytes (304 MB) copied, 3.21322 s, 94.6 MB/s
[vikas@ftp ~]$ ls -lrtha
total 291M
-rw-r--r--  1 vikas ftpusers  124 Jun 22  2010 .bashrc
-rw-r--r--  1 vikas ftpusers  176 Jun 22  2010 .bash_profile
-rw-r--r--  1 vikas ftpusers  18 Jun 22  2010 .bash_logout
drwxr-xr-x. 5 root  root    4.0K Dec 28 22:13 ..
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 1
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 7
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 6
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 5
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 4
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 3
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:18 2
-rw-r--r--  1 vikas ftpusers    0 Dec 28 22:19 8
-rw-------  1 vikas ftpusers  59 Dec 28 22:19 .bash_history
drwx------  2 vikas ftpusers 4.0K Dec 28 22:21 .
-rw-r--r--  1 vikas ftpusers 290M Dec 28 22:21 file
[vikas@ftp ~]$

Any idea why RHEL 6 does not gives warning ?
Please help.

colucix 12-31-2011 07:14 AM

Hi Vikas. I don't know if it is the reason of this behaviour (I cannot test it, right now) but usually after editing /etc/fstab you have to remount the filesystem, as explicitly stated in the Red Hat documentation, here! For a filesystem in use (and /home likely is) a system reboot is recommended.

Regarding the
Code:

quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory

messages, it's normal behaviour the first time you enable quota on a filesystem. Hope this helps.

vikas027 01-01-2012 01:05 AM

Quote:

Originally Posted by colucix (Post 4562450)
Hi Vikas. I don't know if it is the reason of this behaviour (I cannot test it, right now) but usually after editing /etc/fstab you have to remount the filesystem, as explicitly stated in the Red Hat documentation, here! For a filesystem in use (and /home likely is) a system reboot is recommended.
.

Hi Colucix,

Thanks for the time. I had remounted the filesystem (even rebooted the server), my mistake I forgot to list this step in my post.


All times are GMT -5. The time now is 11:03 PM.