When to run quotacheck?

Not quite as often as seeing someone run fsck on a live UFS file system and then regretting it but often enough someone will run quotacheck on a live file system and be surprised by the results. As usual the clue is in the manual for quotacheck:

     quotacheck expects each file system to be checked to have  a
     quota  file  named  quotas in the root directory. If none is
     present, quotacheck will not check the file system.

     quotacheck accesses the character special device  in  calcu-
     lating  the  actual disk usage for each user. Thus, the file
     systems that are checked should be  quiescent  while  quota-
     check is running.


The first paragraph implies that the file system must be mounted (and it must). The second that it is inactive.


So when can you run quotacheck?


In single user mode. Mount the file system and then run it. If you are using UFS logging you should never need to run it if you manage your users correctly. That is to say if you create a users quota before they can create any file in the file system. If you want to retrospectively add quotas then you have to drop to single user, run quota check, then boot multi user.


Once you have quotas enabled and the system is up and running the kernel will keep track of the quotas so you don't need to check them and like the fsck case if you do check them you will just introduce a corruption.


Suddenly the ZFS model of a quota for a file system and a file system per user seems like a much better way.


Tags:

Comments:

What do you do if you cannot use a filesystem per user? you're screwed if you need quoats, right?

Posted by Felix Schulte on December 27, 2006 at 01:38 PM GMT #

You are correct Felix. I think that all of the new stuff is great, but I wish they would have preserved/expanded upon existing capabilities, such as with quotas. I just deployed a new (web hosting) system a couple of months ago and had really hoped to deploy my first production ZFS installation along with it. Because of how quotas have changed in ZFS, I ended up using ufs+logging+svm raid/mirror.

Posted by Jerry Kemp on December 27, 2006 at 04:17 PM GMT #

It is a mind set change I grant you and there are currently issues with very large numbers of file systems which make using a file system per user difficult but they are being worked.

I've not yet heard of a problem with having a file system per user that is not solvable.

Returning to per user quotas would open up the same problems that are seen with UFS quotas. Either you need to be sure no files have been created for a user before you enable quotas for that user or keep a quota count all the time even when you don't have quotas being used just in case you want them in the future or you need an exhaustive search program like quotacheck which will take hours to complete on a large file system, as it does for UFS.

That is not to say per user quotas would not be nice to have but the costs of them have to be seen to worth paying. I'm not yet convinced.

Posted by Chris Gerhard on December 28, 2006 at 05:13 AM GMT #

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today