Logwatch disk space report

Kanwar Ranbir Sandhu m3freak at rogers.com
Fri Mar 18 17:36:25 UTC 2005

Hi Everyone,

[I originally sent this using the wrong email account.  I'm not sure if
the first email will make it through, so here it is again]

So, I wanted to figure out why the logwatch report mangles the disk
space usage report.  Here's what I receive for one of my servers:

/dev/hda1             101M   15M   80M  16% /boot

That's obviously incomplete.  If I just run df -h, I get this:

                      496M  172M  299M  37% /
/dev/hda1             101M   15M   80M  16% /boot
none                  173M     0  173M   0% /dev/shm
                      434M   34M  379M   9% /home
                      496M   13M  459M   3% /tmp
                      2.9G  830M  2.0G  30% /usr
                      992M  234M  708M  25% /var

Much better (except for the ugly output).

Anyway, here's the line in the script that logwatch fires up to create
the disk usage report:

df -h | grep '^/dev/'

It appears that if the path to the device being is sufficiently long
enough, the disk usage for that device isn't printed.  I've tried the
same command on my laptop (also setup with LVM), and the same thing

/dev/hda1              99M   12M   82M  13% /boot
/dev/mapper/vg00-opt 1008M   34M  924M   4% /opt
/dev/mapper/vg00-tmp 1008M   34M  924M   4% /tmp
/dev/mapper/vg00-usr  3.9G  2.6G  1.1G  71% /usr
/dev/mapper/vg00-var 1008M  415M  542M  44% /var

Notice that /dev/mapper/vg00-home and /dev/mapper/vg00-local are both


1. Why the need to grep for /dev?  df -h alone does the job well.
2. What's the solution?
        a. change the script to use df -h ?
        b. use shorter VG labels?
        c. something else entirely?


Kanwar Ranbir Sandhu
Systems Aligned Inc.

More information about the users mailing list