I can't believe I'm the only one going through the logwatch email! :)
With lvm/dm, the Disk Space information is not very useful: /dev/mapper/knuth-root /dev/hda1 99M 20M 74M 22% /boot /dev/mapper/knuth-build /dev/mapper/knuth-tmp /dev/mapper/knuth-var
another: /dev/mapper/servervol-root /dev/hda1 99M 23M 72M 24% /boot /dev/mapper/servervol-tmp /dev/mapper/servervol-var /dev/drbd0 87G 36G 47G 44% /exports /dev/drbd1 9.8G 104M 9.2G 2% /servicos
df -h: Filesystem Size Used Avail Use% Mounted on /dev/mapper/knuth-root 9.9G 4.3G 5.1G 46% / /dev/hda1 99M 21M 74M 22% /boot /dev/mapper/knuth-build 1008M 34M 924M 4% /build none 123M 0 123M 0% /dev/shm /dev/mapper/knuth-tmp 2.0G 36M 1.9G 2% /tmp /dev/mapper/knuth-var 4.0G 246M 3.5G 7% /var
On Thu, Jan 27, 2005 at 12:43:03PM +0000, Luciano Miguel Ferreira Rocha wrote:
I can't believe I'm the only one going through the logwatch email! :)
With lvm/dm, the Disk Space information is not very useful: /dev/mapper/knuth-root /dev/hda1 99M 20M 74M 22% /boot /dev/mapper/knuth-build /dev/mapper/knuth-tmp /dev/mapper/knuth-var
Yeah, I just "fixed" this on my system:
/etc/log.d/scripts/services/zz-disk_space
Change:
df -h | grep '^/dev/'
To:
df -h | grep -A1 '^/dev/'
It's somewhat of a hack, but it works in my case...
/dev/sda8 1012M 846M 116M 89% / /dev/sda3 99M 26M 69M 27% /boot none 1014M 0 1014M 0% /dev/shm /dev/sda9 1012M 33M 928M 4% /tmp /dev/sda5 9.7G 1.9G 7.3G 21% /usr /dev/mapper/vg01-lv_data 111G 24G 81G 23% /var /dev/sda7 9.7G 97M 9.1G 2% /home /dev/mapper/vg02-content 1.5T 140G 1.3T 10% /srv
On Thu, Jan 27, 2005 at 08:02:33AM -0500, Charles R. Anderson wrote:
On Thu, Jan 27, 2005 at 12:43:03PM +0000, Luciano Miguel Ferreira Rocha wrote:
I can't believe I'm the only one going through the logwatch email! :)
With lvm/dm, the Disk Space information is not very useful: /dev/mapper/knuth-root /dev/hda1 99M 20M 74M 22% /boot /dev/mapper/knuth-build /dev/mapper/knuth-tmp /dev/mapper/knuth-var
Yeah, I just "fixed" this on my system:
/etc/log.d/scripts/services/zz-disk_space
Change:
df -h | grep '^/dev/'
To:
df -h | grep -A1 '^/dev/'
It's somewhat of a hack, but it works in my case...
I get a line in the middle with only '--'. Not pretty... df -h | grep -E '^(/dev/| )' works better for me.
Thanks, Luciano Rocha
On Thu, Jan 27, 2005 at 01:20:04PM +0000, Luciano Miguel Ferreira Rocha wrote:
On Thu, Jan 27, 2005 at 08:02:33AM -0500, Charles R. Anderson wrote:
df -h | grep -A1 '^/dev/'
It's somewhat of a hack, but it works in my case...
I get a line in the middle with only '--'. Not pretty... df -h | grep -E '^(/dev/| )' works better for me.
No good for me. That includes the continuation line on excluded devices. (In my case, tons of loopback mounts that I don't care to see):
[...] /dev/mapper/vg02-content 1.5T 140G 1.3T 10% /srv 645M 645M 0 100% /srv/ftp/pub/mnt/psyche-i386-disc1 636M 636M 0 100% /srv/ftp/pub/mnt/psyche-i386-disc2 [...]
On Thu, Jan 27, 2005 at 08:44:58AM -0500, Charles R. Anderson wrote:
On Thu, Jan 27, 2005 at 01:20:04PM +0000, Luciano Miguel Ferreira Rocha wrote:
On Thu, Jan 27, 2005 at 08:02:33AM -0500, Charles R. Anderson wrote:
df -h | grep -A1 '^/dev/'
It's somewhat of a hack, but it works in my case...
I get a line in the middle with only '--'. Not pretty... df -h | grep -E '^(/dev/| )' works better for me.
No good for me. That includes the continuation line on excluded devices. (In my case, tons of loopback mounts that I don't care to see):
[...] /dev/mapper/vg02-content 1.5T 140G 1.3T 10% /srv 645M 645M 0 100% /srv/ftp/pub/mnt/psyche-i386-disc1 636M 636M 0 100% /srv/ftp/pub/mnt/psyche-i386-disc2 [...]
Hm.. I was trying to avoid a complicated script: df -h | { while read dev size used avail perc mount do [ "${dev%%/dev/*}" ] && continue [ -z "$size" ] && read size used avail perc mount S="${#dev}" if [ $S -gt 23 ]; then T="\n\t\t\t" elif [ $S -gt 15 ]; then T="\t" elif [ $S -gt 7 ]; then T="\t\t" else T="\t\t\t" fi echo -e "$dev$T$size\t$used\t$avail\t$perc\t$mount" done }
What about: df -h | sed -ne '/^/dev/[^ ]*$/N' -e '/^/dev//p'
Regards, Luciano Rocha
On Jan 27, 2005, Luciano Miguel Ferreira Rocha strange@nsk.no-ip.org wrote:
Hm.. I was trying to avoid a complicated script:
df -hP seems to work for me. It's not exactly pretty in that long device names will cause the output to be misaligned, but that's sort of ok, I guess.