linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Concise LVM Summary
@ 2006-04-08 21:11 linux_user98765
  2006-04-10  8:08 ` Thomas Meller
  2006-04-11 15:00 ` Jonathan E Brassow
  0 siblings, 2 replies; 5+ messages in thread
From: linux_user98765 @ 2006-04-08 21:11 UTC (permalink / raw)
  To: linux-lvm

I'm trying to write a perl script to give concise output of 
pvs, vgs, lvs, pvdisplay, vgdisplay, lvdisplay and df -- something
like:


VG home [PE (4MB): 0 (0 b) / 52205 (203.93 GB)]
LV /dev/home/lvol0 /home [LE: 52205 (203.93 GB); DF: 64G/201G (129G)
34%]
PV /dev/sdb [PE (4096KB): 0 (0 b) / 38156 (149.05 GB); DF: ??/149G (??)
??%]
PV /dev/hdb4 [PE (4096KB): 0 (0 b) / 14049 (54.88 GB); DF: ??/55G (??)
??%]


however, there are a few things I have yet to figure out:

- determine the actual disk usage of a particular PV in a given LV
- the lvs column option which produces the heading "Log"
- the nature of the pvs,vgs,lvs separator inconsistencies:

lvs - Headers and LV lines are separator terminated
vgs - Headers not separator terminated, VG lines are
pvs - Headers not separator terminated, PV lines are

- The unabreviated names of the column headings
  (a website detailing each would be nice)
- whether pvdisplay,vgdisplay,lvdisplay offer anything more than
  pvs, vgs, lvs with all columns displayed
- Why the majority of pvs,vgs,lvs columns lack data

I'm still working on the code, but the above are the major stumbling
blocks I've come across so far...

TIA!

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

* Re: [linux-lvm] Concise LVM Summary
  2006-04-08 21:11 [linux-lvm] Concise LVM Summary linux_user98765
@ 2006-04-10  8:08 ` Thomas Meller
  2006-04-11 15:00 ` Jonathan E Brassow
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Meller @ 2006-04-10  8:08 UTC (permalink / raw)
  To: LVM general discussion and development

vgdisplay -v <VG>| grep -B2 Total
-?-

> VG home [PE (4MB): 0 (0 b) / 52205 (203.93 GB)]
> LV /dev/home/lvol0 /home [LE: 52205 (203.93 GB); DF: 64G/201G (129G)
> 34%]
> PV /dev/sdb [PE (4096KB): 0 (0 b) / 38156 (149.05 GB); DF: ??/149G (??)
> ??%]
> PV /dev/hdb4 [PE (4096KB): 0 (0 b) / 14049 (54.88 GB); DF: ??/55G (??)
> ??%]
> 
> 
> however, there are a few things I have yet to figure out:
> 
> - determine the actual disk usage of a particular PV in a given LV

> - whether pvdisplay,vgdisplay,lvdisplay offer anything more than
>   pvs, vgs, lvs with all columns displayed

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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

* Re: [linux-lvm] Concise LVM Summary
  2006-04-08 21:11 [linux-lvm] Concise LVM Summary linux_user98765
  2006-04-10  8:08 ` Thomas Meller
@ 2006-04-11 15:00 ` Jonathan E Brassow
  2006-04-12  4:17   ` linux_user98765
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan E Brassow @ 2006-04-11 15:00 UTC (permalink / raw)
  To: LVM general discussion and development

You can pretty much print things how you want by specifying the right 
things on the command line.  'lvs' and friends will default to printing 
out certain columns, but you can change that.

prompt> lvs --noheadings # print things out without the headings
prompt> lvs --noheadings -o lv_name  #print just the lv names
prompt> lvs --noheadings -o lv_name, uuid  #print the lv names and 
their uuid
etc

for a more complete list, see the various man pages

  brassow



On Apr 8, 2006, at 4:11 PM, <linux_user98765@yahoo.com> wrote:

> I'm trying to write a perl script to give concise output of
> pvs, vgs, lvs, pvdisplay, vgdisplay, lvdisplay and df -- something
> like:
>
>
> VG home [PE (4MB): 0 (0 b) / 52205 (203.93 GB)]
> LV /dev/home/lvol0 /home [LE: 52205 (203.93 GB); DF: 64G/201G (129G)
> 34%]
> PV /dev/sdb [PE (4096KB): 0 (0 b) / 38156 (149.05 GB); DF: ??/149G (??)
> ??%]
> PV /dev/hdb4 [PE (4096KB): 0 (0 b) / 14049 (54.88 GB); DF: ??/55G (??)
> ??%]
>
>
> however, there are a few things I have yet to figure out:
>
> - determine the actual disk usage of a particular PV in a given LV
> - the lvs column option which produces the heading "Log"
> - the nature of the pvs,vgs,lvs separator inconsistencies:
>
> lvs - Headers and LV lines are separator terminated
> vgs - Headers not separator terminated, VG lines are
> pvs - Headers not separator terminated, PV lines are
>
> - The unabreviated names of the column headings
>   (a website detailing each would be nice)
> - whether pvdisplay,vgdisplay,lvdisplay offer anything more than
>   pvs, vgs, lvs with all columns displayed
> - Why the majority of pvs,vgs,lvs columns lack data
>
> I'm still working on the code, but the above are the major stumbling
> blocks I've come across so far...
>
> TIA!
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

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

* Re: [linux-lvm] Concise LVM Summary
  2006-04-11 15:00 ` Jonathan E Brassow
@ 2006-04-12  4:17   ` linux_user98765
  2006-04-12 15:59     ` Jonathan Brassow
  0 siblings, 1 reply; 5+ messages in thread
From: linux_user98765 @ 2006-04-12  4:17 UTC (permalink / raw)
  To: LVM general discussion and development

lvs,pvs,vgs each provide for output of specified columns (with optional
headers and field separators); HOWEVER this is still limited as (at
least on my debian pkg) PV and LV commands cannot be combined, thus
negating the possibility of anything even as simple as:

# vgs -o vg_name,lv_name,pv_name
  Can't report LV and PV fields at the same time

Also, the man pages (at least those provided with the debian pkg)
aren't particularly detailed.  They list some (but not all) of the
possible column headers and even exclude one of the default column
headers (I have no idea what optional column generates the "Log"
header).

While this can be segmented into separate commands, the whole idea was
concise presentation.  I'm basically using perl to parse the output of
vgs,lvs,pvs with full columns and output the pertitent (at least to me
anyway) information.

I still haven't figured out how to figure out the disk usage of a
particular PV in a given LV.  To illustrate:


# vgdisplay -v | grep -B3 Free
    Finding all volume groups
    Finding volume group "home"
  PE Size               4.00 MB
  Total PE              52205
  Alloc PE / Size       52205 / 203.93 GB
  Free  PE / Size       0 / 0
--
  PV Name               /dev/sdb
  PV UUID               zTUa5N-NtiP-6aMh-6WJi-d3Xk-MSwN-enKL2P
  PV Status             allocatable
  Total PE / Free PE    38156 / 0
--
  PV Name               /dev/hdb4
  PV UUID               9QYlyj-1dS2-NkVQ-fmZ5-v5bp-N9J6-qirHn6
  PV Status             allocatable
  Total PE / Free PE    14049 / 0


This returns the number of allocated PEs of a given PV to a particular
VG, but does not offer any indication of actual disk usage of those PE
on the PV in the LV.  Similarly:


# vgs -o vg_name,devices
  VG   Devices
  home /dev/sdb(0)
  home /dev/hdb4(0)


Reveals which PVs are allocated to which VG -- but none of the options
appear to offer anything akin to `df` specific to a particular PV in
the LV.  I'm looking for something like:


~# df -h /home
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/home-lvol0
                      201G   72G  122G  38% /home


But with a per PV breakdown -- someting like (numbers made up):


VG home               Size  Used Avail Use% Mounted on
LV /dev/home/lvol0    201G   72G  122G  38% /home
PV /dev/sdb(0)        160G   50G  110G  31%
PV /dev/hdb4(0)        41G   22G   19G  54%


--- Jonathan E Brassow <jbrassow@redhat.com> wrote:
> You can pretty much print things how you want by specifying the right
> things on the command line.  'lvs' and friends will default to
> printing out certain columns, but you can change that.
> 
> prompt> lvs --noheadings # print things out without the headings
> prompt> lvs --noheadings -o lv_name  #print just the lv names
> prompt> lvs --noheadings -o lv_name, uuid  #print the lv names and 
> their uuid
> etc
> 
> for a more complete list, see the various man pages
> 
>   brassow

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

* Re: [linux-lvm] Concise LVM Summary
  2006-04-12  4:17   ` linux_user98765
@ 2006-04-12 15:59     ` Jonathan Brassow
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Brassow @ 2006-04-12 15:59 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, 2006-04-11 at 21:17 -0700, linux_user98765@yahoo.com wrote:
> lvs,pvs,vgs each provide for output of specified columns (with optional
> headers and field separators); HOWEVER this is still limited as (at
> least on my debian pkg) PV and LV commands cannot be combined, thus
> negating the possibility of anything even as simple as:

Of course, but you said you were using a perl script to put the info
together.  Using the commands as suggested makes them easier to parse.

You should be able to figure out how full a PV is that is part of an LV,
but I'm not sure you can determine what parts of a pv an lv uses - or
how much space an lv uses of a pv.

For example:
prompt> lvs --noheadings -o devices vg/lv
  /dev/sda(0)
  /dev/sdb(0)
prompt> pvs --noheadings -o pv_used,pv_size /dev/sda
  17.15G 17.15G

So, you can use vgs to get the vg names, lvs to get the lv names in
those vgs and the devices they live on, and pvs to get basic usage.

If you want to do more, you might consider looking
at /etc/lvm/backup/<vg name>

 brassow

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

end of thread, other threads:[~2006-04-12 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-08 21:11 [linux-lvm] Concise LVM Summary linux_user98765
2006-04-10  8:08 ` Thomas Meller
2006-04-11 15:00 ` Jonathan E Brassow
2006-04-12  4:17   ` linux_user98765
2006-04-12 15:59     ` Jonathan Brassow

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).