linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] thin volume usage report
@ 2017-04-16  9:47 Xen
  2017-04-16 10:27 ` Xen
  2017-04-17 21:07 ` Xen
  0 siblings, 2 replies; 3+ messages in thread
From: Xen @ 2017-04-16  9:47 UTC (permalink / raw)
  To: Linux lvm

So I concocted another thing:

     name             pct      size
     ------------------------------
     data          38.66%    15.43g
     home           8.22%     3.28g
     sites         33.55%    13.39g
     ------------------------------ +
     total         80.43%    32.11g

     reported      80.50%    32.13g
     available     19.50%     7.78g
     ------------------------------ +
     full size    100.00%    39.91g

This script will take a thin pool as a parameter (or search for all 
existing)
and obtain all non-snapshot volumes.

It then counts the PE usage of all segments of those volumes together.
Then based on the usage % it will calculate the number of extents in 
use.

It will turn that into a percentage of the total amount of extents in 
the pool.

Then it will calculate the size in use and turn it into a human readable 
form based on the LVM xxx.xxs format meaning that megabytes are also 
displayed 123.00m with a max of 999.00m but typically you would see 
0.99g or 2.23g figures.

Goes upto exa :p.

It obtains the VG PE_size (normally 4MB) for size calculations.

The discrepancy between "total" and "reported" is not yet used but 
typically this difference would sit in snapshots...

It would become:

     name             pct      size
     ------------------------------
     data          38.66%    15.43g
     home           8.22%     3.28g
     sites         33.55%    13.39g
     ------------------------------ +
     total         80.43%    32.11g
     unaccounted    0.07%    20.00m
     ------------------------------ +
     reported      80.50%    32.13g
     available     19.50%     7.78g
     ------------------------------ +
     full size    100.00%    39.91g

Or something of the kind.

The idea for this thing is of course to be used in reports but you could 
also run it manually.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-17 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-16  9:47 [linux-lvm] thin volume usage report Xen
2017-04-16 10:27 ` Xen
2017-04-17 21:07 ` Xen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).