1834800 Members
2603 Online
110070 Solutions
New Discussion

bdf and long FS names

 
SOLVED
Go to solution
Sébastien N
Advisor

bdf and long FS names

Hi,

I use BDF to get FS size, %used and mount point. These values are automatically added in reports used to display statistics.
The pb is when the FS name is longer than 18c, the FS is displayed on 2 lines :
/dev/vg05_bc/lvol9 12582912 12291784 282036 98% /u58_bc
/dev/vg05_bc/lvol10
12550144 12291784 250292 98% /u59_bc
/dev/vg05/lvu51 12582912 12291784 282036 98% /u51

How to obtain datas I need on only one line ?

Thanx,
Sebastien.
3 REPLIES 3
John Palmer
Honored Contributor
Solution

Re: bdf and long FS names

You can use awk to filter only the fields that you need, something like...

bdf | grep [0-9]% | awk '{if ($1 ~ /\/.*/){print $5," ",$6}else{print $4," ",$5}}'

Regards,
John
Ralph Grothe
Honored Contributor

Re: bdf and long FS names

Hi Sebastian,

are you fond of Perl?

At CPAN is a wonderful module available viz. Filesys::Statfvs which uses the Unix statvs() syscall to obtain info abt. filesystems.

You can download it from here

http://www.cpan.org/modules/by-module/Filesys/


The usage of this module requires very little Perl knowledge and is straight forward.
Once installed type "perldoc Filesys::Statvfs"
Madness, thy name is system administration
Bill Hassell
Honored Contributor

Re: bdf and long FS names

This is a feature of bdf to keep the length of the line to 80 chars or less. The line folding is very common with NFS mounts. You'll want to get a copy of bdfmegs, a script that not only keeps all the info on a single line but shows the stats in megs rather than the less useful Kbytes in bdf. It also has a -v option to show largefile capability, filesystem type/version and block/frag sizes. I've attached the latest version.


Bill Hassell, sysadmin