What the quot

One of the joy's of UNIX is that even after 16 years of using it, the opportunity to trip over new useful/interesting commands/features which have been around for a while. Even better if you find something when you are not looking for it.

NAME
     quot - summarize file system ownership

SYNOPSIS
     quot [-acfhnv] filesystem...

     quot -a [-cfhnv]

DESCRIPTION
     quot displays the number of blocks (1024 bytes) in the named
     filesystem (one or more) currently owned by each user. There
     is a limit of 2048 blocks. Files larger than  this  will  be
     counted as a 2048 block file, but the total block count will
     be correct.

This is the output from a root filesystem on a V890 with Solaris 10. The -v option is interesting in that it gives 3 extra columns of blocks not accessed in 30, 60 and 90 days. Yet to think of a use for the -v, but I am sure we will find one.

# quot -f -v /
/dev/rdsk/c1t0d0s0:
3956446 173808  root            3679449 3491876 3301515
  901      73   uucp              503     502     467
  133      19   adm                21      21       4
  118     115   smmsp              57       4       0
   74       5   svctag              3       2       0
   48      41   noaccess           47       4       0
   28      28   lp                 24      23       2
   11       3   bin                11      11      11
    8       8   daemon              8       4       0
    8      16   nobody              8       8       0
    8       8   postgres            8       8       0
    4       4   gdm                 4       4       0
    4       4   webservd            4       4       0
    3       9   clivek              1       1       1
Comments:

ufs is dead. Long live zfs.

Posted by Chris Gerhard on March 24, 2008 at 07:27 AM GMT #

For Chris's next trick, he will show you how to do this with ZFS!

Posted by Clive King on March 24, 2008 at 07:49 AM GMT #

Well the first thing to point out is that quot, like so many of the ufs only utilities grubs around on the raw device to get it's data. So you have to really use it on a snapshot to make it "safe". Even then it is just a brute force search made easier as it only has to scan the inodes which in UFS are all preallocated.

In ZFS you would do the brute search from the file system, or more safely using a snapshot of that file system. At that point this degenerates into a script which if you use a modern scripting language can be done in one hit or as a filter to find. That said ZFS would encourage you to have a file system per administrative unit so what becomes interesting is how much space the file system is taking.

Posted by Chris Gerhard on March 25, 2008 at 01:56 AM GMT #

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

clive

Search

Categories
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