From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [PATCH] LVM2: (2/2) Use dm_report filter
Date: Wed, 18 Apr 2007 15:32:58 -0400 [thread overview]
Message-ID: <4626726A.3070002@ce.jp.nec.com> (raw)
In-Reply-To: <46264BAC.3000504@ce.jp.nec.com>
Hi,
This patch adds '--filter' option to reporting commands: lvs, vgs and pvs.
The patch depends on the following patches:
[PATCH] libdevmapper: (4/6) Add filtering feature to dm_report
https://www.redhat.com/archives/dm-devel/2007-April/msg00029.html
[PATCH] libdevmapper: (7/6) Add dm_report_get_report_types()
https://www.redhat.com/archives/dm-devel/2007-April/msg00035.html
Examples:
Find PVs used for VG vg0
# pvs --filter 'vg_name == "vg0"'
Find PVs not used by any LVs
# pvs --filter 'used == 0'
Find PVs satisfying both of the aboves
# pvs --filter 'vg_name == "vg0" && used == 0'
Find PVs not satisfying the above
# pvs --filter '! (vg_name == "vg0" && used == 0)'
Find VGs with more than 2 PVs and with more than 400 extents
# vgs --filter 'pv_count > 2 && free_count > 400'
Find active snapshot LVs
# lvs --filter 'attr =~ /^s...a/'
Find LVs using /dev/sdc
# lvs --filter 'devices =~ |/dev/sdc|'
..
Possible future enhancements:
- Cope with units.
I.e. lvs --filter 'size > 4G' to find LVs larger than 4GB
Currently, the filter can handle only the raw value of the field.
Thanks,
--
Jun'ichi Nomura, NEC Corporation of America
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-add-filter.patch
Type: text/x-patch
Size: 7144 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070418/97908cf7/attachment.bin>
next prev parent reply other threads:[~2007-04-18 19:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 16:41 [PATCH] libdevmapper: (0/6) Filtering feature in dm_report Jun'ichi Nomura
2007-04-18 16:47 ` [PATCH] libdevmapper: (1/6) Tidy up _field_match() and _key_match() Jun'ichi Nomura
2007-04-18 16:47 ` [PATCH] libdevmapper: (2/6) Fix trailing separator Jun'ichi Nomura
2007-04-18 16:47 ` [PATCH] libdevmapper: (3/6) Move lib/regex from LVM2 Jun'ichi Nomura
2007-04-18 19:23 ` [PATCH] LVM2: (1/2) Use dm_regex Jun'ichi Nomura
2007-04-18 16:47 ` [PATCH] libdevmapper: (4/6) Add filtering feature to dm_report Jun'ichi Nomura
2007-04-18 19:32 ` Jun'ichi Nomura [this message]
2007-04-18 16:47 ` [PATCH] libdevmapper: (5/6) Add '--filter' option to dmsetup Jun'ichi Nomura
2007-04-18 16:47 ` [PATCH] libdevmapper: (6/6) Add deps and treenode fields for dmsetup info -c Jun'ichi Nomura
2007-04-18 19:23 ` [PATCH] libdevmapper: (7/6) Add dm_report_get_report_types() Jun'ichi Nomura
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4626726A.3070002@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.