Operating System - HP-UX
1753386 Members
5461 Online
108792 Solutions
New Discussion

bdfmegs - Feb2014 version

 
Bill Hassell
Honored Contributor

bdfmegs - Feb2014 version

bdfmegs is a reformatter script for bdf along with several options that are not in bdf itself.

The version has added:

 

-- stdin is available (-D) so that a copy/paste from a listing can be formatted. It will handle bdf -i (inodes) by ignoring them.

-- READ-ONLY filesystems are tagged with a "*"

-- Default sort is column 1 (source). Use -c # to sort on other columns

-- The divisor is 1024 but can be changed to 1000 with -d (reported with -v option)

-- Handles VxVM volumes

-- Will display terabytes and petabytes with useful scaling

 

You can use it as an enhanced bdf. Here are the options:

 

Usage:  bdfmegs [ -cDdeghlNPpqstuVv ] [ <file(s) or dir(s)> ]
  where:
    -c # = Sort on column #, default=1
    -D = use bdf from stdin pipe (display another bdf)
         Cannot be used with -l, -t or -v
    -d = Toggle divisor (1000 or 1024, current=1024)
    -e = enhancement for percentage and errors
         d=dim h=halfbright i=inverse u=underline b=blink
    -g = show gigabytes, otherwise megabytes
    -h = Usage
    -l = local (no NFS)
    -M   <mountpoints> = skip (grep -v) mountpoints
    -N   <VGnames> = skip one or more volume groups
         Repeat -N or use commas: -N vg10,vg24
    -p   ## = highlight % -ge ##
    -P   ## = show only % -ge ##
    -q = suppress header, line and no char enhancements
    -s = summarize total, used and available
    -t   <fs> = filesystem type, one of:
         hfs nfs cdfs autofs cachefs ffs lofs nfs3 procfs vxfs cifs pipefs
    -u = usage
    -v = verbose (FStype, FSversion, largefiles)
         (VG version needs read permission for devicefile)
    -V   <VGname> = select one or more volume groups
         Repeat -V or use commas: -V vg00,vg01

File(s) or dirpath(s) may be specified to reduce the output of bdfmegs:

       bdfmegs -vg /usr/contrib/bin . .. /var/tmp

If bdfmegs is run as bdfgigs (ie, a link), then -g is default.
                                         (bdfmegs ver 6.4_Feb2014)

 

Some examples:

 

File-System                  Mbytes    Used   Avail %Used Mounted on
/dev/vg00/lvol1                 291      82     180   31% /stand
/dev/vg00/lvol3                 544     349     194   64% /
/dev/vg00/lvol4                 200      54     145   27% /tmp
/dev/vg00/lvol5                 100      28      71   28% /home
/dev/vg00/lvol6                6144    4703    1429   77% /opt
/dev/vg00/lvol7                3616    2487    1119   69% /usr
/dev/vg00/lvol8                 9.8g   3387    6574   34% /var
/dev/vgstore/ReallyLongName     128       1     118    1% /mnt2
/dev/vgstore/lvol1            195.3g  106.5g   83.3g  56% /var/opt/ignite
/dev/vgstore/lvol2            488.3g  336.4g  142.5g  70% /var/tmp/Packages
/dev/vgstore/lvol3             48.8g   8153    38.3g  17% /var/tmp/CustomerData
/dev/vgstore/lvol4             48.8g   28.7g   18.9g  60% /var/tmp/Training
/dev/vgstore/lvol5             21.9g   4866    16.1g  23% /var/tmp/Docs

 bdfmegs never splits the line. It adjusts the layout to fit the largest source device.

-v gives additional information:

 

File-System               Mbytes    Used   Avail %Used  Type Vr Lrg VGv Mounted on
/dev/vg00/lvol1             1792     721    1062   40%  vxfs  5  no 1.0 /stand
/dev/vg00/lvol3             1024     660     360   65%  vxfs  6 yes 1.0 /
/dev/vg00/lvol4              512     382     129   75%  vxfs  6 yes 1.0 /tmp
/dev/vg00/lvol5              128       7     119    6%  vxfs  6 yes 1.0 /home
/dev/vg00/lvol6             12.7g   11.4g   1306   90%  vxfs  6 yes 1.0 /opt
/dev/vg00/lvol7             6016    4472    1531   74%  vxfs  6 yes 1.0 /usr
/dev/vg00/lvol8             8704    6569    2117   76%  vxfs  6 yes 1.0 /var
/dev/vg2.0/lvol1            97.7g     89    91.5g   0%  vxfs  7 yes 2.0 /lvol2.0a
/dev/vg2.0/lvol2             112       2     103    2%  vxfs  7 yes 2.0 /lvol2.0b *
/dev/vg2.2/lvol1            97.7g     89    91.5g   0%  vxfs  7 yes 2.2 /lvol2.2a
/dev/vg2.2/lvol2             112       2     103    2%  vxfs  7 yes 2.2 /lvol2.2b *
atl1:/var/tmp/Packages     488.3g  336.4g  142.5g  70%   nfs  3  -- n/a /mnt2
atl1:/var/tmp/labsystems     9.8g   3387    6574   34%   nfs  3  -- n/a /mnt4
memfs                        256       0     256    0% memfs na  -- n/a /memfs
                                                                         (divisor = 1024)

* means filesystem is mounted read-only

You can select (-Vvg_name) (or deselect with -Nvg_name) volume groups.

You can also use -s for a sum total of the displayed mountpoints.

 

File-System      Mbytes    Used   Avail %Used Mounted on
/dev/vg00/lvol1    1792     721    1062   40% /stand
/dev/vg00/lvol3    1024     660     360   65% /
/dev/vg00/lvol4     512     382     129   75% /tmp
/dev/vg00/lvol5     128       7     119    6% /home
/dev/vg00/lvol6    12.7g   11.4g   1306   90% /opt
/dev/vg00/lvol7    6016    4472    1531   74% /usr
/dev/vg00/lvol8    8704    6567    2119   76% /var
-- sum totals -    30.4g   23.9g   6626   --- sum totals ---

You can find any mountpoints that are more than a given percentage full (-P 70):

 

File-System      Mbytes    Used   Avail %Used Mounted on
/dev/vg00/lvol4     512     382     129   75% /tmp
/dev/vg00/lvol6    12.7g   11.4g   1306   90% /opt
/dev/vg00/lvol7    6016    4472    1531   74% /usr
/dev/vg00/lvol8    8704    6567    2119   76% /var

 And you can remove the headers and trailers for scripts with -q (this was bdfmegs -lq -c3):

 

memfs                        256       0     256    0% /memfs
/dev/vg2.0/lvol2             112       2     103    2% /mntlvol2.0b
/dev/vg2.2/lvol2             112       2     103    2% /mntlvol2.2b
/dev/vg00/lvol5              128       7     119    6% /home
/dev/vg2.0/lvol1            97.7g     89    91.5g   0% /mntlvol2.0a
/dev/vg2.2/lvol1            97.7g     89    91.5g   0% /mntlvol2.2a
/dev/vg00/lvol4              512     382     129   75% /tmp
/dev/vg00/lvol3             1024     660     360   65% /
/dev/vg00/lvol1             1792     721    1062   40% /stand
atl1:/var/tmp/labsystems     9.8g   3387    6574   34% /mnt4
/dev/vg00/lvol7             6016    4472    1531   74% /usr
/dev/vg00/lvol8             8704    6566    2120   76% /var
/dev/vg00/lvol6             12.7g   11.4g   1306   90% /opt
atl1:/var/tmp/Packages     488.3g  336.4g  142.5g  70% /mnt2

 

Be sure to transfer the file in ASCII mode when using ftp.

 



Bill Hassell, sysadmin
3 REPLIES 3
likid0
Honored Contributor

Re: bdfmegs - Feb2014 version

Great stuff, a classic tool, very usefull, thanks for the update!

Windows?, no thanks
rkannan172
Senior Member

Re: bdfmegs - Feb2014 version

Dear Bill Hassell,

 

  Can you please share me the detailed procedure how to use this script?

 

Regards

R.Kannan 

Dennis Handly
Acclaimed Contributor

Re: bdfmegs - Feb2014 version

>Can you please share me the detailed procedure how to use this script?

 

Bill's post contains a list of all the options.  Which do you want?  What have you tried?

What are you trying to see/do?