duv User Manual

duv version 2.0  2005-11-01
Last updated 2005-11-01
BitWagon Software LLC
http://www.BitWagon.com
duv overview
Accounting for disk space
Installing duv
Invocation and input
Limitations
Tips
Copyright © 2001, 2005 BitWagon Software LLC.  All rights reserved.

duv overview

duvTM Visual Disk Usage lets you see where the disk space went.  duv draws a multicolor picture with area proportional to disk usage.  The picture may be based on file and directory hierarchy, ownership, last portion of filename, or number of days since last access or modification.  As you move the pointer over the display, duv annotates the filename and size.  As you enter commands via keyboard or button clicks, duv enters or leaves portions of the hierarchy, sorts the displayed regions by size, or does a print/copy/clip of the complete pathname.  duv also can display remaining free space, and generate a PostScript rendering of the current picture for printing.

Disk space accounting

duv accounts for space used by a file as, "How much more free space would there be if the file were deleted?"  This works well until there are links.  In UNIX file systems, space is really allocated for inodes, and a filename is just a pointer to the inode.  If there is only one pointer to an inode then it is easy to think of the space as belonging to the filename.  But if there are two or more filenames linked to an inode, then it is no longer so easy.  duv handles this by constructing a top level pseudo directory called & with a sub directory for each regular file inode that has two or more links.  The entries in the sub directory are the complete pathnames that are linked to the inode. The space for the inode is divided evenly among the links, with any remainder assigned to the sub directory.  Soft links (/bin/ln -s) are just name-to-name translations.  If the name of the target is short enough (59 bytes or less on ext2) then the soft link itself takes no space other than directory space in the origin directory.

The space required to make a backup copy on a storage medium can be either more or less than the usage reported by duv, depending on the use of compression, filtering (selection based on name, ownership, permissions, time of last access or modification, etc.), policies with regard to links, and recognition of blocks which are all zero.
 

Installing duv

duv is distributed as a compressed tarball source archive, and as pre-compiled executables for i586, x86_64, and ppc32. Build an executable from source, or put the appropriate pre-compiled executable somewhere in $PATH, such as $HOME/bin, /usr/local/bin, etc.
 

Running duv

duv flags... paths...

duv prints a banner and all query output to stderr.

duv flags

short long description
--help print usage summary, then exit
-ln --lg=n set logical display size to 2**n dots; default n=16
-mn --magnify=n set dot size to n by n pixels; default 2 by 2
-h --horizontal horizontal orientation (landscape) when 2:1 (default)
-v --vertical vertical orientation (portrait) when 2:1
-P"cmd" --print="lpr" print filter command; substitutions: %n serial number; %k kind (stroke, fill, text)
-L--nolinks force n_hardlink==1 (some DVD/CD)
-M--nomount do not traverse mount points
-un --uids=n restrict to n UID lookups; default 10
-gn --gids=n restrict to n GID lookups; default 10
-wn --fdlimit=n restrict to n file descriptors; default 512
-8 TrueColor display acts as 8-bit PseudoColor instead
-a --noannotate omit annotation of name and size
-f --nofree omit free space
-c --nocopy omit copy of pathname
-k --noclip omit clip of pathname
-p --noprint omit print of pathname
-- optional explicit end of flags

 

duv input

action key button
print+copy+clip pathname
any unused
Button1
enter directory
+ F5 F4
Shift+Button1
leave directory
- F6 F3
Control+Button1
sort by size
* F7 F2
Control+Shift+Button1
cycle dir->uid->  .->aday->mday
/ F8 F1
Mod1Mask+Button1
move pointer dot-by-dot
arrow keys
print text to --print filter
#
[%k==>3]
(stroke) print PostScript to --print filter
!
[%k==>1]
(fill) print PostScript to --print filter
%
[%k==>5]

 

Limitations

Tips

In many cases, adding the option nodiratime to /etc/fstab will enable faster data gathering. Example:
  /dev/hda7 /home ext2 defaults,nodiratime 1 2
Caution: Some backup programs may use time of last access to a directory to make decisions about what to backup. Consult the documentation for your backup program, or ask your system administrator.

On a busy system, or when several instances of duv are gathering data at the same time, it may be more friendly to use the invocation option --fdlimit=64 to reduce the chance that other processes will run out of file descriptors. duv copes dynamically, but many other processes do not.

On some systems, converting every numerical UID to a username can take a long time. Adjust with --uids=n, which limits lookups to the UIDs with the largest usage.

If the usage reported by duv does not seem right, then please use standard utilities (du, df, ls, sort, etc.) instead.