Wednesday Dec 27, 2006

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:

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