Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=af330ff842aef4d4…
Commit: af330ff842aef4d473f7dd9e17eb7a066f373528
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-10-30 15:35 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-10-30 15:35 +0000
annotated tag: v2_02_133 has been created
at af330ff842aef4d473f7dd9e17eb7a066f373528 (tag)
tagging 15a97cc610712efe818f96b9630b72de89a0cf57 (commit)
replaces v2_02_132
Release 2.02.133.
This is a development release that provides us with a checkpoint.
(Any interface changes in this release might be modified further.)
329 files changed, 6524 insertions(+), 4152 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlYzj1YACgkQIoGRwVZ+LBc0rwCeI1s7/WqxlO4EDpeVuAfZvk4x
LyEAniwQZ5fUTo+VBx48GfmqvJHUukOb
=M010
-----END PGP SIGNATURE-----
Alasdair G Kergon (15):
post-release
segtypes: Use SEG_TYPE_NAME_ string constants.
segtypes: Make constants ULL.
style: lv_manip.c changes
segtypes: Add and use new segtype macros.
stripes: Introduce _round_to_stripe_boundary.
alloc: Move _calc_area_multiple.
test: Cope with stripe rounding message change.
libdm: Move status fns from deptree to targets.
raid: Fail if kernel status denominator is zero.
raid: Add metadata dev information to reports.
Revert "log: no file for external logging"
thin: Fix typo in policy threshold message.
device: Tidy DASD CDL format detection code.
pre-release
David Teigland (26):
man lvmthin: use --poolmetadatasize option
lockd: fix changing lock type on VG with pool
lockd: fix rescanning VG metadata
lockd: add debug logging for metadata error
lockd: add VG name to debug logging
config: improve cache_settings description
man lvmcache: updates for mode and policy
lockd: add error message for EEXIST
vgcreate: allow both --shared and --lock-type options
vgcreate: improve error message for multiple lock managers
man lvmsystemd: fix typo
man lvmsystemid: fix typos
Fix segfault when lvmlockd is running but not lvmetad
lvmlockd: use flag to avoid blocking in sanlock_acquire
pvscan: use process_each_pv
libdaemon: allow all debug levels for stderr
libdaemon: fix typo in last log enable commit
man: document possible lvmetad -l values
vg_read: sometimes ignore read errors
vgextend: fix use of the wrong flag
vg_read: remove unused inconsistent check
pvs: fix missing PVs when VG is removed
toollib: fix wrong paren placement
vgs, lvs: ignore error if VG is removed
pvs: don't treat duplicate PVs as missed
New entries for pvs related fixes.
Heinz Mauelshagen (11):
segtypes: Extend flags to 64 bits.
style: Miscellaneous tidying up of metadata/lv*
libdm: Improve raid segment parameter handling.
raid: Fix raid target write_behind parameter.
libdm: fix bogus macro causing false parameter count
raid: Detect whether or not kernel supports raid0.
raid: Add a segtype flag for each raid type.
segtypes: Use flags in raid segtype macros.
raid: Use loop for text uint32_t parameter import.
raid: Introduce DEFAULT_RAID_MAX_IMAGES
raid_manip: fix wrong image size allocation on raid10 "lvconvert --replace ..."
Lidong Zhong (1):
pvcreate: don't support unpartitioned DASD devices with CDL formatted
Marian Csontos (2):
test: Fix timeout handling
cleanup: snapshots of snapshots message
Ondrej Kozina (6):
polldaemon: fix missing mirror in-sync info with lvmpolld
tests: add test for missing mirror in-sync info
lvmetad: add optional timeout option
lvmetad.8.in: update man page with timeout info
tests: add lvmetad shutdown on idle test
tests: replace invalid use of 'fail' with 'die'
Peter Rajnoha (37):
systemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target
blkdeactivate: recognize and deactivate MD devices too
report: identify LV hodling sanlock locks as 'private,lockd,sanlock' within lv_role report field
metadata: format_text: provide more detailed error message when metadata too large for PV mda
report: add vg_missing_pv_count field
vgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr
vgimportclone: fix vgimportclone with -n to not add number unnecessarily to base VG name
vgimportclone: make sure there's no prefix in VG name list
tests: test vgimportclone and -n option
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
libdm: add dm_report_compact_given_fields
config: add report/compact_output_cols to control which columns to compact in report output
cleanup: typo in comment: compact_output_fields should be compact-output_cols
conf: regenerate
conf: clarify compact output settings
pvremove: make sure even invalid info is removed from lvmcache on pvremove
lvmcache: update cached info properly when moving from VG to orphan while lvmetad is used
revert: 3d03e504cda6307f692c5879f6850b2e27af7d71: message about VG metadata size vs. PV mda size
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
metadata: format_text: check VG metadata do not overlap themselves
WHATS_NEW: recent commits
metadata: format_text: better check for metadata overlap
tests: add test for minimum mda size
metadata: format_text: also count with calculated mda size of 0
str_list: also allow memory allocation without memory pool
str_list: add str_list_to_str and str_to_str_list functions
str_list: add str_list_destroy function
refactor: move code detecting report options to a separate function
report: make report options defined by "-o" groupable
report: support "-o -field_name1,field_name2,...."
report: add report_get_field_prefix function
report: recognize known prefix when processing "-o -field_name1,field_name2,..."
report: support "-o #field_name1,field_name2,..."
tests: add report-fields.sh test
man: pvs/vgs/lvs and -o+, -o-, -o#
commands: update command help for -o|--options for reporting commands
WHATS_NEW: reporting commands and -o-/-o+ extension
Zdenek Kabelac (118):
alloc: fix update or area_len
man: update dmsetup and dmstats pages
man: update lvm pages
tests: use proper target name for check
tests: ensure test will not block
cleanup: fix compiler warning
man: fsadm
man: lvcreate continue
tests: check devices with prefix aren't in use
libdm: enforce writethrough mode for cleaner
thin: check for overflown pool earlier
dmeventd: correct ret code for fail
thin: enhance logging
toolcontext: do not change already set dm_log
log: no file for external logging
dmeventd: fix loging report
dmeventd: log all commands with CMD: prefix
libdmevent: add dm_event_log
dmeventd: syslog -> log_xxxxx
dmeventd: use log_ macros in plugins
dmeventd: enable new logging
dmeventd: enable new logging
dmeventd: drop changing logging
dmeventd: add more debug messages
man: dmeventd update
dmeventd: handle snapshot overflow
cleanup: static with _
dmeventd: support logging on stdout
cleanup: more readable code
cleanup: always set nsec
cleanup: remove multilog
cleanup: avoid using private
cleanup: move system defines before structs
cleanup: typo in comment
dmeventd: new initialization of plugin threads
dmeventd: introduce macro for init
dmeventd: use new macros to init mempool
dmeventd: add local mempool for raid and mirror
dmeventd: less locking for snapshot and thin
dmeventd: less locking mirror
dmeventd: rework raid plugin
makefiles: generate Local
makefiles: drop explicit linking
makefiles: src dirs have depth 5
tests: show status in in_sync
tests: better regex check
tests: start logging dmeventd output
tests: wait for initial sync
tests: more extend testing
dmeventd: compilable without DEBUG CFLAG
makefiles: older gcc needs hint with rpath
dmeventd: fix missing '!'
makefiles: switch to rpath-link
thin: enforce local activation when creation new thin
dmeventd: use matching function
lib: better reporting of threshold
memlock: report memlock daemon counter
tools: preselect some setting for memlocked daemons
tools: do not change signals for memlocked daemons
libdm: add dm_hold_control_dev
dmeventd: check for malloc return
dmeventd: lvm2 plugin correctly debug
dmeventd: raid plugin reporting
dmeventd: mirror plugin update
dmeventd: snapshot plugin updates
dmeventd: snapshot plugin device removal
dmeventd: thin plugin update
dmeventd: no registering of 0 event mask
dmeventd: using warning level
dmeventd: move dso handling into single code section
dmeventd: use dm_hold_control_dev
dmeventd: wake up timer when setting new timeout
dmeventd: drop unneded test
dmeventd: minimize locking time for get_imeout
dmeventd: code mode _get_device_status
cleanup: use enums
dmeventd: rework locking code
dmeventd: handle signal from plugin
dmeventd: snapshot plugin unmonitor
dmeventd: debug signals
dmeventd: exit on idle
cleanup: declare vars before code
cleanup: easier to read code
cleanup: drop uneeded header file
cleanup: indents
tests: enable raid test on 4.3
dmeventd: debug error paths
dmeventd: ensure filter is empty
tools: update for lvm2_disable_dmeventd_monitoring
cleanup: gcc warning for old-style
cleanup: fix gcc compile with older pthread
cleanup: drop debug
thin: fix percentage compare
lv_manip: ensure it will fit bellow threshold
libdm: dm_tree_node_size_changed recognizes reduction
dev_manager: enabled no_flush for suspend
dev_manager: no flush for extension
libdm: enable no_flush for driver version > 11
tests: snapshot now respects threshold
dmevent: fix referencing
thin: limit no-flush using only for thin-pool
tests: extend timer for 4 hours
tests: support skip flags
tests: use skip flags
dmeventd: event string parser handles empty field
tests: avoid reading utils when skipping
tests: use more SKIP
tests: using matching type
thin: dmeventd plugin check number of failures
thin: enable usage of kernel low_water_mark
cleanup: easier error messages
cleanup: use same type
cleanup: remove thin low_water_mark from metadata
cleanup: error is not a WARNING
tests: no point in using should
tests: fix wrong line has been commented
tests: let pass bigger readahead
tests: update test for resize
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f1c63c812ba5f79…
Commit: 3f1c63c812ba5f79768f23b8d6d2e2965a458e0e
Parent: dd52721b68a7c393a54149649f518f4e2d9440b5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:50:35 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:50:35 2015 +0100
WHATS_NEW: reporting commands and -o-/-o+ extension
---
WHATS_NEW | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 415efc7..3808cb6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.133 -
======================================
+ Support repeated -o|--options for reporting commands.
+ Support -o- and -o# for reporting commands to remove and compact fields.
Fix missing PVs from pvs output if vgremove is run concurrently.
Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b04eda93f903d25…
Commit: 5b04eda93f903d25e25385d148d28b8cfa1157ea
Parent: 77c31d0c39c3ba9caf7a5a70282f1c5a6b0f48e2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 15:06:49 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 15:47:56 2015 +0100
tests: add report-fields.sh test
---
test/shell/report-fields.sh | 91 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/test/shell/report-fields.sh b/test/shell/report-fields.sh
new file mode 100644
index 0000000..e0c7308
--- /dev/null
+++ b/test/shell/report-fields.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+SKIP_WITH_LVMETAD=1
+SKIP_WITH_LVMPOLLD=1
+SKIP_WITH_CLVMD=1
+
+. lib/inittest
+
+# Test only that there's correct set of fields displayed on output.
+
+aux prepare_pvs 1
+
+OPTS="--nameprefixes --noheadings --rows"
+
+aux lvmconf 'report/pvs_cols="pv_name,pv_size"'
+aux lvmconf 'report/compact_output=0'
+aux lvmconf 'report/compact_output_cols=""'
+
+pvs $OPTS > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_name > out
+not grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+
+pvs $OPTS -o+pv_attr -o-pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+not grep LVM2_PV_ATTR out
+
+pvs $OPTS -o-pv_attr -o+pv_attr > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_SIZE out
+grep LVM2_PV_ATTR out
+
+pvs $OPTS -o+pv_attr -o-pv_attr -o pv_attr > out
+grep LVM2_PV_ATTR out
+not grep -v LVM2_PV_ATTR out
+
+# -o-size is the same as -o-pv_size - the prefix is recognized
+pvs $OPTS -o-size > out
+not grep LVM2_PV_SIZE out
+
+# PV does not have tags nor is it exported if we haven't done that explicitly.
+# Check compaction per field is done correctly.
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output_cols="pv_tags"'
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+grep LVM2_PV_TAGS out
+
+aux lvmconf 'report/compact_output=1'
+pvs $OPTS -o pv_name,pv_exported,pv_tags > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
+
+pvs $OPTS -o pv_name,pv_exported,pv_tags -o#pv_exported > out
+grep LVM2_PV_NAME out
+not grep LVM2_PV_EXPORTED out
+not grep LVM2_PV_TAGS out
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=17196103e018a34e…
Commit: 17196103e018a34eda016f6bdcd74395210cb114
Parent: ccfc09f79b8d7ba15798a2b6f76545bb7fa3681e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 30 09:05:21 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 30 09:05:21 2015 -0500
New entries for pvs related fixes.
---
WHATS_NEW | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 00e807e..415efc7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.133 -
======================================
+ Fix missing PVs from pvs output if vgremove is run concurrently.
+ Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ccfc09f79b8d7ba1…
Commit: ccfc09f79b8d7ba15798a2b6f76545bb7fa3681e
Parent: 9a3b64e81ad1988f4143b5a4b4ac06eaf3035e58
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 12:02:29 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 12:02:34 2015 +0100
metadata: format_text: also count with calculated mda size of 0
When checking minimum mda size, make sure the mda_size after alignment
and calculation is more than 0 - if there's no place for an MDA at the
end of the disk, the _text_pv_add_metadata_area does not try to add it
there and it returns (because we already have the MDA at the start of
the disk at least).
---
lib/format_text/format-text.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 29e9bd2..d4f2c89 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2241,13 +2241,13 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
- if (mda_size < MDA_SIZE_MIN) {
- log_error("Metadata area size too small. "
- "It must be at least %u bytes.", MDA_SIZE_MIN);
- goto bad;
- }
-
if (mda_size) {
+ if (mda_size < MDA_SIZE_MIN) {
+ log_error("Metadata area size too small: %" PRIu64" bytes. "
+ "It must be at least %u bytes.", mda_size, MDA_SIZE_MIN);
+ goto bad;
+ }
+
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
(size_t) ((mda_size > wipe_size) ?
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c2e88d1107c496d2…
Commit: c2e88d1107c496d2c1b39bbbfb9795e88b3a6b60
Parent: 406d8ff3323dde6860d88b603701aa4dace47af0
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 30 08:57:34 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 30 08:57:34 2015 +0100
metadata: format_text: better check for metadata overlap
Actually, we don't need extra condition as introduced in commit
00348c0a630a7e5578edf48052ec695b15de752f. We should fix the last
condition:
(mdac->rlocn.size >= mdah->size)
...which should be:
(MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size))
Where the "mdac" is new metadata, the "rlocn" is old metadata.
So the main problem with the previous condition was that it
didn't count in MDA_HEADER_SIZE properly (and possible existing
metadata - the "rlocn"). This could have caused the error state
where metadata in ring buffer overlap to not be hit.
Replace the new condition introduced in 00348c0a630a7e5578edf48052ec695b15de752f
with the improved one for the condition that existed there
already but it was just incomplete.
---
lib/format_text/format-text.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 84d0947..29e9bd2 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -654,8 +654,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
- (!rlocn && new_wrap && (new_end > mdac->rlocn.offset)) ||
- (mdac->rlocn.size >= mdah->size)) {
+ (MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=406d8ff3323dde68…
Commit: 406d8ff3323dde6860d88b603701aa4dace47af0
Parent: 00348c0a630a7e5578edf48052ec695b15de752f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:50:09 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:50:09 2015 +0100
WHATS_NEW: recent commits
---
WHATS_NEW | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 03c70d6..00e807e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
Version 2.02.133 -
======================================
- Check metadata area size is at least minimum size of 8 * memory page size.
+ Check newly created VG's metadata do not overlap in metadata ring buffer.
+ Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00348c0a630a7e55…
Commit: 00348c0a630a7e5578edf48052ec695b15de752f
Parent: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:33:06 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:46:41 2015 +0100
metadata: format_text: check VG metadata do not overlap themselves
We're already checking whether old and new meta do not overlap in
ring buffer (as we need to keep both old and new meta during vg_write
up until vg_commit).
We also need to check whether the new metadata do not overlap
themselves in case we don't have old metadata yet (...because
we're in vgcreate). This could happen if we're creating a VG so
that the very first metadata written are long enough that it wraps
themselves in metadata ring buffer.
Although we limited the minimum metadata area size better with the
previous commit ccb8da404d00288b7d49c7a28006ec5d4687bb55 which
makes the initial VG metadata overlap in ring buffer to be less
probable, the risk of hitting this overlap condition is still there
if we still manage to generate big enough metadata somehow.
For example, users can provide many and/or long VG tags during vgcreate
so that the VG metadata is long enough to start to wrap in the ring
buffer again...
---
lib/format_text/format-text.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 6c653ca..84d0947 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -654,6 +654,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
+ (!rlocn && new_wrap && (new_end > mdac->rlocn.offset)) ||
(mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ccb8da404d00288b…
Commit: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Parent: 28e54032c092ed4a5592575ac716fe698ce75d22
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 15:59:29 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:00:32 2015 +0100
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
---
WHATS_NEW | 1 +
lib/format_text/format-text.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f453604..03c70d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Check metadata area size is at least minimum size of 8 * memory page size.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index e0ec8ed..6c653ca 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2146,7 +2146,6 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
goto bad;
}
/* Otherwise, give up and take any usable space. */
- /* FIXME: We should probably check for some minimum MDA size here. */
else
mda_size = limit - mda_start;
@@ -2242,6 +2241,12 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
+ if (mda_size < MDA_SIZE_MIN) {
+ log_error("Metadata area size too small. "
+ "It must be at least %u bytes.", MDA_SIZE_MIN);
+ goto bad;
+ }
+
if (mda_size) {
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f58c63410327c2bc…
Commit: f58c63410327c2bc49b671df4538dee9e90e577d
Parent: 175119fdcd1a8eb23011e4c25d0df5899dfc42ea
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:18:40 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:38:59 2015 +0100
cleanup: error is not a WARNING
Drop 'WARNING' from error message.
It's plain error message leading to command failure.
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index c7f6ecb..683c87c 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1331,7 +1331,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
log_warn("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
baton.fid->fmt->name, dev_name(dev));
else
- log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
+ log_error("Ignoring obsolete format of metadata (%s) on device %s when using lvmetad.",
baton.fid->fmt->name, dev_name(dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5886ff64ebcac8c1…
Commit: 5886ff64ebcac8c1b53c665c598728e481590964
Parent: a4418b34c150299aa88c6540bb4e3680f8bb4dae
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 27 12:03:57 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 27 12:03:57 2015 -0500
pvs: don't treat duplicate PVs as missed
The recent addition to check for PVs that were
missed during the first iteration of processing
was unintentionally catching duplicate PVs because
duplicates were not removed from the all_devices
list when the primary dev was processed.
Also change a message from warn back to verbose.
---
tools/toollib.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 3804d66..42ac71a 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2885,12 +2885,17 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
}
/*
+ * We have processed the PV on device pv->dev. Now
+ * deal with any duplicates of this PV on other
+ * devices.
+ */
+
+ /*
* This is a very rare and obscure case where multiple
* duplicate devices are specified on the command line
* referring to this PV. In this case we want to
* process this PV once for each specified device.
*/
-
if (!skip && !dm_list_empty(arg_devices)) {
while ((dil = _device_list_find_pvid(arg_devices, pv))) {
_device_list_remove(arg_devices, dil->dev);
@@ -2925,7 +2930,6 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
* we want each of them to be displayed in the context
* of this VG, so that this VG name appears next to it.
*/
-
if (process_all_devices && lvmcache_found_duplicate_pvs()) {
while ((dil = _device_list_find_pvid(all_devices, pv))) {
_device_list_remove(all_devices, dil->dev);
@@ -2942,6 +2946,20 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
lvmcache_replace_dev(cmd, pv, dev_orig);
}
}
+
+ /*
+ * Remove any duplicates of the processed device from
+ * the list of all devices. If they were left in the
+ * list of all devices, they would be considered
+ * "missed" at the end.
+ */
+ if (process_all_pvs && lvmcache_found_duplicate_pvs()) {
+ while ((dil = _device_list_find_pvid(all_devices, pv))) {
+ log_very_verbose("Skip duplicate device %s of processed device %s",
+ dev_name(dil->dev), dev_name(pv->dev));
+ _device_list_remove(all_devices, dil->dev);
+ }
+ }
}
/*
@@ -3160,7 +3178,7 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_missed_orig);
_device_list_copy(cmd, &arg_missed, &arg_missed_orig);
- log_warn("Some PVs were not found in first search, retrying.");
+ log_verbose("Some PVs were not found in first search, retrying.");
lvmcache_destroy(cmd, 0, 0);
lvmcache_init();
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a4418b34c150299a…
Commit: a4418b34c150299aa88c6540bb4e3680f8bb4dae
Parent: 65ec00ce202411f6e6f91955ab9422d44bb86a9b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 27 10:52:01 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 27 10:52:01 2015 -0500
vgs, lvs: ignore error if VG is removed
If a VG is removed between the time that 'vgs'
or 'lvs' (with no args) creates the list of VGs
and the time that it reads the VG to process it,
then ignore the removed VG; don't report an error
that it could not be found, since it wasn't named
by the command.
---
tools/toollib.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 59ba29f..3804d66 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1909,7 +1909,7 @@ int select_match_pv(struct cmd_context *cmd, struct processing_handle *handle,
return 1;
}
-static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
+static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t read_flags,
struct dm_list *vgnameids_to_process,
struct dm_list *arg_vgnames,
struct dm_list *arg_tags,
@@ -1952,8 +1952,8 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
continue;
}
- vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
+ vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
+ if (_ignore_vg(vg, vg_name, arg_vgnames, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
@@ -2020,7 +2020,7 @@ static int _copy_str_to_vgnameid_list(struct cmd_context *cmd, struct dm_list *s
* Call process_single_vg() for each VG selected by the command line arguments.
*/
int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
- uint32_t flags, struct processing_handle *handle,
+ uint32_t read_flags, struct processing_handle *handle,
process_single_vg_fn_t process_single_vg)
{
int handle_supplied = handle != NULL;
@@ -2070,6 +2070,9 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
goto out;
}
+ if (dm_list_empty(&arg_vgnames))
+ read_flags |= READ_OK_NOTFOUND;
+
/*
* If we obtained a full list of VGs on the system, we need to work through them all;
* otherwise we can merely work through the VG names provided.
@@ -2086,7 +2089,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
!init_selection_handle(cmd, handle, VGS))
goto_out;
- ret = _process_vgnameid_list(cmd, flags, &vgnameids_to_process,
+ ret = _process_vgnameid_list(cmd, read_flags, &vgnameids_to_process,
&arg_vgnames, &arg_tags, handle, process_single_vg);
out:
if (!handle_supplied)
@@ -2375,7 +2378,7 @@ static int _get_arg_lvnames(struct cmd_context *cmd,
return ret_max;
}
-static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
+static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t read_flags,
struct dm_list *vgnameids_to_process,
struct dm_list *arg_vgnames,
struct dm_list *arg_lvnames,
@@ -2442,8 +2445,8 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
continue;
}
- vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
+ vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
+ if (_ignore_vg(vg, vg_name, arg_vgnames, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
@@ -2471,7 +2474,7 @@ endvg:
/*
* Call process_single_lv() for each LV selected by the command line arguments.
*/
-int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t flags,
+int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t read_flags,
struct processing_handle *handle, process_single_lv_fn_t process_single_lv)
{
int handle_supplied = handle != NULL;
@@ -2538,6 +2541,9 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla
goto out;
}
+ if (dm_list_empty(&arg_vgnames))
+ read_flags |= READ_OK_NOTFOUND;
+
/*
* If we obtained a full list of VGs on the system, we need to work through them all;
* otherwise we can merely work through the VG names provided.
@@ -2547,7 +2553,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla
else if ((ret = _copy_str_to_vgnameid_list(cmd, &arg_vgnames, &vgnameids_to_process)) != ECMD_PROCESSED)
goto_out;
- ret = _process_lv_vgnameid_list(cmd, flags, &vgnameids_to_process, &arg_vgnames, &arg_lvnames,
+ ret = _process_lv_vgnameid_list(cmd, read_flags, &vgnameids_to_process, &arg_vgnames, &arg_lvnames,
&arg_tags, handle, process_single_lv);
out:
if (!handle_supplied)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=65ec00ce202411f6…
Commit: 65ec00ce202411f6e6f91955ab9422d44bb86a9b
Parent: 6e1e0e881368be6337599dcf7f627f785ebf415c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 27 15:27:52 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 27 15:27:52 2015 +0000
device: Tidy DASD CDL format detection code.
---
lib/device/dev-dasd.c | 85 +++++++++++++++++++++++++++++++++++--------------
1 files changed, 61 insertions(+), 24 deletions(-)
diff --git a/lib/device/dev-dasd.c b/lib/device/dev-dasd.c
index 28156ca..220293e 100644
--- a/lib/device/dev-dasd.c
+++ b/lib/device/dev-dasd.c
@@ -17,7 +17,28 @@
#include "dev-type.h"
#include <sys/ioctl.h>
-typedef struct dasd_information_t {
+#ifdef __linux__
+
+/*
+ * Interface taken from kernel header arch/s390/include/uapi/asm/dasd.h
+ */
+
+/*
+ * Author(s)......: Holger Smolinski <Holger.Smolinski(a)de.ibm.com>
+ * Copyright IBM Corp. 1999, 2000
+ * EMC Symmetrix ioctl Copyright EMC Corporation, 2008
+ * Author.........: Nigel Hislop <hislop_nigel(a)emc.com>
+ */
+
+#define DASD_IOCTL_LETTER 'D'
+#define DASD_API_VERSION 6
+
+/*
+ * struct dasd_information2_t
+ * represents any data about the device, which is visible to userspace.
+ * including foramt and featueres.
+ */
+typedef struct dasd_information2_t {
unsigned int devno; /* S/390 devno */
unsigned int real_devno; /* for aliases */
unsigned int schid; /* S/390 subchannel identifier */
@@ -34,41 +55,57 @@ typedef struct dasd_information_t {
unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
unsigned int characteristics_size;
unsigned int confdata_size;
- unsigned char characteristics[64];/*from read_device_characteristics */
- unsigned char configuration_data[256];/*from read_configuration_data */
+ char characteristics[64]; /* from read_device_characteristics */
+ char configuration_data[256]; /* from read_configuration_data */
unsigned int format; /* format info like formatted/cdl/ldl/... */
- unsigned int features; /* dasd features like 'ro',... */
- unsigned int reserved0; /* reserved for further use ,... */
- unsigned int reserved1; /* reserved for further use ,... */
- unsigned int reserved2; /* reserved for further use ,... */
- unsigned int reserved3; /* reserved for further use ,... */
- unsigned int reserved4; /* reserved for further use ,... */
- unsigned int reserved5; /* reserved for further use ,... */
- unsigned int reserved6; /* reserved for further use ,... */
- unsigned int reserved7; /* reserved for further use ,... */
-} dasd_information_t;
-
-#define DASD_FORMAT_CDL 2
-#define BIODASDINFO2 _IOR('D', 3, dasd_information_t)
+ unsigned int features; /* dasd features like 'ro',... */
+ unsigned int reserved0; /* reserved for further use ,... */
+ unsigned int reserved1; /* reserved for further use ,... */
+ unsigned int reserved2; /* reserved for further use ,... */
+ unsigned int reserved3; /* reserved for further use ,... */
+ unsigned int reserved4; /* reserved for further use ,... */
+ unsigned int reserved5; /* reserved for further use ,... */
+ unsigned int reserved6; /* reserved for further use ,... */
+ unsigned int reserved7; /* reserved for further use ,... */
+} dasd_information2_t;
+
+#define DASD_FORMAT_CDL 2
+
+/* Get information on a dasd device (enhanced) */
+#define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
+
+/*
+ * End of included interface.
+ */
int dasd_is_cdl_formatted(struct device *dev)
{
int ret = 0;
- dasd_information_t dasd_info;
+ dasd_information2_t dasd_info2;
- if (!dev_open_readonly(dev)) {
- stack;
- return ret;
- }
+ if (!dev_open_readonly(dev))
+ return_0;
- if (ioctl(dev->fd, BIODASDINFO2, &dasd_info) != 0)
- goto_out;
+ if (ioctl(dev->fd, BIODASDINFO2, &dasd_info2)) {
+ log_sys_error("ioctl BIODASDINFO2", dev_name(dev));
+ goto out;
+ }
- if (dasd_info.format == DASD_FORMAT_CDL)
+ if (dasd_info2.format == DASD_FORMAT_CDL)
ret = 1;
+
out:
if (!dev_close(dev))
stack;
return ret;
}
+
+#else
+
+int dasd_is_cdl_formatted(struct device *dev)
+{
+ return 0;
+}
+
+#endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76cff10a734a7c1e…
Commit: 76cff10a734a7c1e26b3835ff967dac0b7e46bcb
Parent: 1af2ab10d02c2f02891d5047af563651fbe294bb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 27 15:08:43 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 16:00:09 2015 +0100
tests: avoid reading utils when skipping
Save even more CPU/time and avoid reading utils, when skipping test.
---
test/lib/inittest.sh | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index beb0210..6fde23a 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (C) 2011-2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2011-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -9,6 +9,11 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+initskip() {
+ test "$#" -eq 0 || echo "TEST SKIPPED: $@"
+ exit 200
+}
+
# sanitize the environment
LANG=C
LC_ALL=C
@@ -20,19 +25,22 @@ TESTNAME=${0##*/}
PS4='#${BASH_SOURCE[0]##*/}:${LINENO}+ '
export TESTNAME PS4
-unset CDPATH
-
-# grab some common utilities
-. lib/utils
-
if test -n "$LVM_TEST_FLAVOUR"; then
. lib/flavour-$LVM_TEST_FLAVOUR
fi
-test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && skip
-test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && skip
-test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && skip
+test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && initskip
+test -n "$SKIP_WITH_CLVMD" && test "$LVM_TEST_LOCKING" -eq 3 && initskip
+test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && initskip
+test -n "$SKIP_WITH_LVMETAD" && test -n "$LVM_TEST_LVMETAD" && initskip
+
+test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && initskip
+
+unset CDPATH
+
+# grab some common utilities
+. lib/utils
TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1af2ab10d02c2f02…
Commit: 1af2ab10d02c2f02891d5047af563651fbe294bb
Parent: 729f489009b4dfc8488265bc64414edcfeae0755
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Oct 22 13:32:52 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:48 2015 +0100
cleanup: snapshots of snapshots message
No plans to support thick snapshost of snapshots.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 264b3f7..869e506 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8029dab..8e20dfa 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7248,8 +7248,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
return NULL;
}
if (lv_is_cow(origin_lv)) {
- log_error("Snapshots of snapshots are not "
- "supported yet.");
+ log_error("Snapshots of snapshots are not supported.");
return NULL;
}
if (lv_is_locked(origin_lv)) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=729f489009b4dfc8…
Commit: 729f489009b4dfc8488265bc64414edcfeae0755
Parent: 5d76bdcdbdf6bef81872e8eef2cce156cfce228f
Author: Lidong Zhong <lzhong(a)suse.com>
AuthorDate: Mon Oct 12 15:09:11 2015 +0800
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:47 2015 +0100
pvcreate: don't support unpartitioned DASD devices with CDL formatted
The former patch(dab3ebce4c7) is a little bit strict. For example, it is
OK to create PV on unpartitioned DASD devices with LDL formatted. So
after lvm version containing the patch, LVs created on those devices
could not be found.
Signed-off-by: Lidong Zhong <lzhong(a)suse.com>
---
WHATS_NEW | 1 +
lib/Makefile.in | 1 +
lib/device/dev-dasd.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/device/dev-type.c | 2 +-
lib/device/dev-type.h | 1 +
5 files changed, 78 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bced219..264b3f7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 3e0e6f8..00014c2 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -62,6 +62,7 @@ SOURCES =\
device/dev-swap.c \
device/dev-type.c \
device/dev-luks.c \
+ device/dev-dasd.c \
display/display.c \
error/errseg.c \
unknown/unknown.c \
diff --git a/lib/device/dev-dasd.c b/lib/device/dev-dasd.c
new file mode 100644
index 0000000..28156ca
--- /dev/null
+++ b/lib/device/dev-dasd.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lib.h"
+#include "metadata.h"
+#include "dev-type.h"
+#include <sys/ioctl.h>
+
+typedef struct dasd_information_t {
+ unsigned int devno; /* S/390 devno */
+ unsigned int real_devno; /* for aliases */
+ unsigned int schid; /* S/390 subchannel identifier */
+ unsigned int cu_type : 16; /* from SenseID */
+ unsigned int cu_model : 8; /* from SenseID */
+ unsigned int dev_type : 16; /* from SenseID */
+ unsigned int dev_model : 8; /* from SenseID */
+ unsigned int open_count;
+ unsigned int req_queue_len;
+ unsigned int chanq_len; /* length of chanq */
+ char type[4]; /* from discipline.name, 'none' for unknown */
+ unsigned int status; /* current device level */
+ unsigned int label_block; /* where to find the VOLSER */
+ unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
+ unsigned int characteristics_size;
+ unsigned int confdata_size;
+ unsigned char characteristics[64];/*from read_device_characteristics */
+ unsigned char configuration_data[256];/*from read_configuration_data */
+ unsigned int format; /* format info like formatted/cdl/ldl/... */
+ unsigned int features; /* dasd features like 'ro',... */
+ unsigned int reserved0; /* reserved for further use ,... */
+ unsigned int reserved1; /* reserved for further use ,... */
+ unsigned int reserved2; /* reserved for further use ,... */
+ unsigned int reserved3; /* reserved for further use ,... */
+ unsigned int reserved4; /* reserved for further use ,... */
+ unsigned int reserved5; /* reserved for further use ,... */
+ unsigned int reserved6; /* reserved for further use ,... */
+ unsigned int reserved7; /* reserved for further use ,... */
+} dasd_information_t;
+
+#define DASD_FORMAT_CDL 2
+#define BIODASDINFO2 _IOR('D', 3, dasd_information_t)
+
+int dasd_is_cdl_formatted(struct device *dev)
+{
+ int ret = 0;
+ dasd_information_t dasd_info;
+
+ if (!dev_open_readonly(dev)) {
+ stack;
+ return ret;
+ }
+
+ if (ioctl(dev->fd, BIODASDINFO2, &dasd_info) != 0)
+ goto_out;
+
+ if (dasd_info.format == DASD_FORMAT_CDL)
+ ret = 1;
+out:
+ if (!dev_close(dev))
+ stack;
+
+ return ret;
+}
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 1d03024..a66ef95 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -363,7 +363,7 @@ static int _native_dev_is_partitioned(struct dev_types *dt, struct device *dev)
return 0;
/* Unpartitioned DASD devices are not supported. */
- if (MAJOR(dev->dev) == dt->dasd_major)
+ if ((MAJOR(dev->dev) == dt->dasd_major) && dasd_is_cdl_formatted(dev))
return 1;
if (!dev_open_readonly_quiet(dev)) {
diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h
index 2a49b4b..f1d52ca 100644
--- a/lib/device/dev-type.h
+++ b/lib/device/dev-type.h
@@ -59,6 +59,7 @@ int major_is_scsi_device(struct dev_types *dt, int major);
int dev_is_md(struct device *dev, uint64_t *sb);
int dev_is_swap(struct device *dev, uint64_t *signature);
int dev_is_luks(struct device *dev, uint64_t *signature);
+int dasd_is_cdl_formatted(struct device *dev);
/* Signature wiping. */
#define TYPE_LVM1_MEMBER 0x001
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d76bdcdbdf6bef8…
Commit: 5d76bdcdbdf6bef81872e8eef2cce156cfce228f
Parent: 3b5939bbbb974913db3ff7ac363cc7f1154b894e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 27 11:12:59 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 27 11:42:40 2015 +0100
dmeventd: event string parser handles empty field
Improve event string parser to avoid unneeded alloc+free.
Daemon talk function uses '-' to mark NULL/missing field.
So restore the NULL pointer back on parser.
This should have made old tools like 'dmevent_tool' work again.
As now 'uuid' or 'dso' could become NULL and then be
properly used in _want_registered_device() function.
Since lvm2 always fill these parameters, this change should
have no effect on lvm2.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 50 +++++++++++++++++++++++++++---------------
2 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index e09ab63..961aec5 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Fix/restore parsing of empty field '-' when processing dmeventd event.
Enhance dm_tree_node_size_changed() to recognize size reduction.
Support exit on idle for dmenventd (1 hour).
Add support to allow unmonitor device from plugin itself.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index d6accbf..42c724b 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -473,34 +473,48 @@ static int _pthread_create_smallstack(pthread_t *t, void *(*fun)(void *), void *
/*
* Fetch a string off src and duplicate it into *ptr.
- * Pay attention to zero-length strings.
+ * Pay attention to zero-length and 'empty' strings ('-').
*/
/* FIXME? move to libdevmapper to share with the client lib (need to
make delimiter a parameter then) */
static int _fetch_string(char **ptr, char **src, const int delimiter)
{
- int ret = 0;
+ int ret = 1;
char *p;
size_t len;
+ *ptr = NULL; /* Empty field returns NULL pointer */
- if ((p = strchr(*src, delimiter)))
- *p = 0;
-
- if ((*ptr = dm_strdup(*src))) {
- if ((len = strlen(*ptr)))
- *src += len;
- else {
- dm_free(*ptr);
- *ptr = NULL;
+ if ((*src)[0] == '-') {
+ /* Could be empty field '-', handle without allocation */
+ if ((*src)[1] == '\0') {
+ (*src)++;
+ goto out;
+ } else if ((*src)[1] == delimiter) {
+ (*src) += 2;
+ goto out;
}
-
- (*src)++;
- ret = 1;
}
- if (p)
- *p = delimiter;
-
+ if ((p = strchr(*src, delimiter))) {
+ if (*src < p) {
+ *p = 0; /* Temporary exit with \0 */
+ if (!(*ptr = dm_strdup(*src))) {
+ log_error("Failed to fetch item %s.", *src);
+ ret = 0; /* Allocation fail */
+ }
+ *p = delimiter;
+ *src = p;
+ }
+ (*src)++; /* Skip delmiter, next field */
+ } else if ((len = strlen(*src))) {
+ /* No delimiter, item ends with '\0' */
+ if (!(*ptr = dm_strdup(*src))) {
+ log_error("Failed to fetch last item %s.", *src);
+ ret = 0; /* Fail */
+ }
+ *src += len + 1;
+ }
+out:
return ret;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ba41ee1dc94264f7…
Commit: ba41ee1dc94264f7ac8e61f8b1d56b10225b0d2f
Parent: b702d677477ff6b37678fe2b6c38969792c09359
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 26 21:46:54 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 26 23:57:31 2015 +0100
thin: limit no-flush using only for thin-pool
For this release keep usage of 'noflush' only for thin-volume/pool.
For rest of keep - keep usage of 'noflush' flag purely for
non-resized mirrors.
---
WHATS_NEW | 2 +-
lib/activate/dev_manager.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 80a198a..bced219 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,6 @@
Version 2.02.133 -
======================================
- Enforce flush for suspend only when volume size is reduced.
+ For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index dc6d2fd..964eef5 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3299,6 +3299,13 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
+ /* Currently keep the code require flush for any
+ * non 'thin pool/volume, mirror' or with any size change */
+ if (!lv_is_thin_volume(lv) &&
+ !lv_is_thin_pool(lv) &&
+ (!lv_is_mirror(lv) || dm_tree_node_size_changed(root)))
+ dm->flush_required = 1;
+
if (action == ACTIVATE) {
if (!dm_tree_activate_children(root, dlid, DLID_SIZE))
goto_out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6624833839645cbe…
Commit: 6624833839645cbe75af073fd1dd9ab8c78e0d03
Parent: b29593378f41f6dd401fb9582fba1a100f33dbbb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 23 15:09:20 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 26 16:07:12 2015 -0500
pvs: fix missing PVs when VG is removed
PVs could be missing from the 'pvs' output if
their VG was removed at the same time that the
'pvs' command was run. To fix this:
1. If a VG is not found when processed, don't
silently skip the PVs in it, as is done when
the "skip" variable is set.
2. Repeat the VG search if some PVs are not
found on the first search through all VGs.
The second search uses a specific list of
PVs that were missed the first time.
testing:
/dev/sdb is a PV
/dev/sdd is a PV
/dev/sdg is not a PV
each test begins with:
vgcreate test /dev/sdb /dev/sdd
variations to test:
vgremove -f test & pvs
vgremove -f test & pvs -a
vgremove -f test & pvs /dev/sdb /dev/sdd
vgremove -f test & pvs /dev/sdg
vgremove -f test & pvs /dev/sdb /dev/sdg
The pvs command should always display /dev/sdb
and /dev/sdd, either as a part of VG test or not.
The pvs command should always print an error
indicating that /dev/sdg could not be found.
---
tools/toollib.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 116 insertions(+), 9 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index fba075a..843a47b 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -184,14 +184,16 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
* If *skip is 1, it's OK for the caller to read the list of PVs in the VG.
*/
static int _ignore_vg(struct volume_group *vg, const char *vg_name,
- struct dm_list *arg_vgnames, uint32_t read_flags, int *skip)
+ struct dm_list *arg_vgnames, uint32_t read_flags,
+ int *skip, int *notfound)
{
uint32_t read_error = vg_read_error(vg);
+
*skip = 0;
+ *notfound = 0;
if ((read_error & FAILED_NOTFOUND) && (read_flags & READ_OK_NOTFOUND)) {
- read_error &= ~FAILED_NOTFOUND;
- *skip = 1;
+ *notfound = 1;
return 0;
}
@@ -1924,6 +1926,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
int process_all = 0;
/*
@@ -1942,6 +1945,7 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -1949,12 +1953,12 @@ static int _process_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
}
- if (skip)
+ if (skip || notfound)
goto endvg;
/* Process this VG? */
@@ -2392,6 +2396,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, vgnameids_to_process) {
if (sigint_caught())
@@ -2400,6 +2405,7 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
/*
* arg_lvnames contains some elements that are just "vgname"
@@ -2437,13 +2443,12 @@ static int _process_lv_vgnameid_list(struct cmd_context *cmd, uint32_t flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, flags, lockd_state);
- if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, arg_vgnames, flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
goto endvg;
-
}
- if (skip)
+ if (skip || notfound)
goto endvg;
ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg, 0,
@@ -2688,6 +2693,59 @@ static struct device_id_list *_device_list_find_pvid(struct dm_list *devices, st
return NULL;
}
+static int _device_list_copy(struct cmd_context *cmd, struct dm_list *src, struct dm_list *dst)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_new;
+
+ dm_list_iterate_items(dil, src) {
+ if (!(dil_new = dm_pool_alloc(cmd->mem, sizeof(*dil_new)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_new->dev = dil->dev;
+ strncpy(dil_new->pvid, dil->pvid, ID_LEN);
+ dm_list_add(dst, &dil_new->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
+/*
+ * For each device in arg_devices or all_devices that has a pvid, add a copy of
+ * that device to arg_missed. All PVs (devices with a pvid) should have been
+ * found while processing all VGs (including orphan VGs). But, some may have
+ * been missed if VGs were changing at the same time. This function creates a
+ * list of PVs that still remain in the given list, i.e. were missed the first
+ * time. A second iteration through VGs can look for these explicitly.
+ * (arg_devices is used if specific PVs are being processed; all_devices is
+ * used if all devs are being processed)
+ */
+static int _get_missed_pvs(struct cmd_context *cmd,
+ struct dm_list *devices,
+ struct dm_list *arg_missed)
+{
+ struct device_id_list *dil;
+ struct device_id_list *dil_missed;
+
+ dm_list_iterate_items(dil, devices) {
+ if (!dil->pvid[0])
+ continue;
+
+ if (!(dil_missed = dm_pool_alloc(cmd->mem, sizeof(*dil_missed)))) {
+ log_error("device_id_list alloc failed.");
+ return ECMD_FAILED;
+ }
+
+ dil_missed->dev = dil->dev;
+ strncpy(dil_missed->pvid, dil->pvid, ID_LEN);
+ dm_list_add(arg_missed, &dil_missed->list);
+ }
+
+ return ECMD_PROCESSED;
+}
+
static int _process_device_list(struct cmd_context *cmd, struct dm_list *all_devices,
struct processing_handle *handle,
process_single_pv_fn_t process_single_pv)
@@ -2921,6 +2979,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
int ret_max = ECMD_PROCESSED;
int ret;
int skip;
+ int notfound;
dm_list_iterate_items(vgnl, all_vgnameids) {
if (sigint_caught())
@@ -2929,6 +2988,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
vg_name = vgnl->vg_name;
vg_uuid = vgnl->vgid;
skip = 0;
+ notfound = 0;
if (!lockd_vg(cmd, vg_name, NULL, 0, &lockd_state)) {
ret_max = ECMD_FAILED;
@@ -2936,13 +2996,15 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags,
}
vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state);
- if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip)) {
+ if (_ignore_vg(vg, vg_name, NULL, read_flags, &skip, ¬found)) {
stack;
ret_max = ECMD_FAILED;
if (!skip)
goto endvg;
/* Drop through to eliminate a clustered VG's PVs from the devices list */
}
+ if (notfound)
+ goto endvg;
/*
* Don't continue when skip is set, because we need to remove
@@ -2982,6 +3044,7 @@ int process_each_pv(struct cmd_context *cmd,
struct dm_list arg_tags; /* str_list */
struct dm_list arg_pvnames; /* str_list */
struct dm_list arg_devices; /* device_id_list */
+ struct dm_list arg_missed; /* device_id_list */
struct dm_list all_vgnameids; /* vgnameid_list */
struct dm_list all_devices; /* device_id_list */
struct device_id_list *dil;
@@ -3009,6 +3072,7 @@ int process_each_pv(struct cmd_context *cmd,
dm_list_init(&arg_tags);
dm_list_init(&arg_pvnames);
dm_list_init(&arg_devices);
+ dm_list_init(&arg_missed);
dm_list_init(&all_vgnameids);
dm_list_init(&all_devices);
@@ -3068,6 +3132,49 @@ int process_each_pv(struct cmd_context *cmd,
if (ret > ret_max)
ret_max = ret;
+ /*
+ * Some PVs may have been missed by the first search if another command
+ * moved them at the same time. Repeat the search for only the
+ * specific PVs missed. lvmcache needs clearing for a fresh search.
+ *
+ * If missed PVs are found in this repeated search, they are removed
+ * from the arg_missed list, but they also need to be removed from the
+ * arg_devices list, otherwise the check at the end will produce an
+ * error, thinking they weren't found. This is the reason for saving
+ * and comparing the original arg_missed list.
+ */
+ if (!process_all_pvs)
+ _get_missed_pvs(cmd, &arg_devices, &arg_missed);
+ else
+ _get_missed_pvs(cmd, &all_devices, &arg_missed);
+
+ if (!dm_list_empty(&arg_missed)) {
+ struct dm_list arg_missed_orig;
+
+ dm_list_init(&arg_missed_orig);
+ _device_list_copy(cmd, &arg_missed, &arg_missed_orig);
+
+ log_warn("Some PVs were not found in first search, retrying.");
+
+ lvmcache_destroy(cmd, 0, 0);
+ lvmcache_init();
+ lvmcache_seed_infos_from_lvmetad(cmd);
+
+ ret = _process_pvs_in_vgs(cmd, read_flags, &all_vgnameids, &all_devices,
+ &arg_missed, &arg_tags, 0, 0,
+ handle, process_single_pv);
+ if (ret != ECMD_PROCESSED)
+ stack;
+ if (ret > ret_max)
+ ret_max = ret;
+
+ /* Devices removed from arg_missed are removed from arg_devices. */
+ dm_list_iterate_items(dil, &arg_missed_orig) {
+ if (!_device_list_find_dev(&arg_missed, dil->dev))
+ _device_list_remove(&arg_devices, dil->dev);
+ }
+ }
+
dm_list_iterate_items(dil, &arg_devices) {
log_error("Failed to find physical volume \"%s\".", dev_name(dil->dev));
ret_max = ECMD_FAILED;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f898cf7539149a54…
Commit: f898cf7539149a54a121b0aae59076c2d647bb37
Parent: 844b00958492224c448b30f89ae5532bb6591fd2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:41:19 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:09:31 2015 +0100
dev_manager: no flush for extension
Recognize the target only 'extends' and do not enforce
'flush' in this case. Only the size reduction
still requires flush (so disables usage of no_flush flag).
If some other targets do require flush before suspend,
they have to explicitly ask for it.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 33d11a4..80a198a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enforce flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 1caa2d7..dc6d2fd 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3296,7 +3296,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if (!dm_tree_preload_children(root, dlid, DLID_SIZE))
goto_out;
- if (dm_tree_node_size_changed(root))
+ if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
if (action == ACTIVATE) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=844b00958492224c…
Commit: 844b00958492224c448b30f89ae5532bb6591fd2
Parent: 9ef820a2a5e174cd08097981d7879e1f4cbded01
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 20:37:39 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:07:37 2015 +0100
dev_manager: enabled no_flush for suspend
While the activation code tries to evaluate which target
really needs flush with suspend and which may go without flush,
it has stayed effectively disabled by original commit:
33f732c5e9493cda4b161a18b3d53885d207e3b8 since here
it only allows to pass non-pvmoving 'mirrors'.
So remove check for mirror LV type and only disable
no_flush for 'pvmove'..
TODO: Looking into history - it also seemed like raid target
would have always required flushing but it's been later
removed without clean explanation.
If some more targets really do need 'no_flush' it should
been handle at their 'level' - since we now stack multiple
targets over itself.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8ca0aa7..33d11a4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.
Correct percentage evaluation when checking thin-pool over threshold.
Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index a5ee824..1caa2d7 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3277,7 +3277,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
break;
case SUSPEND:
dm_tree_skip_lockfs(root);
- if (!dm->flush_required && lv_is_mirror(lv) && !lv_is_pvmove(lv))
+ if (!dm->flush_required && !lv_is_pvmove(lv))
dm_tree_use_no_flush_suspend(root);
/* Fall through */
case SUSPEND_WITH_LOCKFS:
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9ef820a2a5e174cd…
Commit: 9ef820a2a5e174cd08097981d7879e1f4cbded01
Parent: 40eea582aea512db7fceafd8559bf66df0733b55
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 19:27:09 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:05:15 2015 +0100
libdm: dm_tree_node_size_changed recognizes reduction
Add more functionality to size_changed function.
While 'existing' API only detected 0 for
unchanged, and !0 for changed,
new improved API will also detected if the
size has only went bigger - or there was
size reduction.
Function work for the whole dm-tree - so
no change is size is always 0.
only size extension 1.
and if some size reduction is there - returns -1.
This result can be used for better evaluation
whether we need to flush before suspend.
---
WHATS_NEW_DM | 1 +
libdm/.exported_symbols.Base | 1 -
libdm/.exported_symbols.DM_1_02_110 | 1 +
libdm/libdevmapper.h | 5 +++++
libdm/libdm-deptree.c | 25 ++++++++++++++++++++++---
5 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 910f6d6..e09ab63 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Enhance dm_tree_node_size_changed() to recognize size reduction.
Support exit on idle for dmenventd (1 hour).
Add support to allow unmonitor device from plugin itself.
New design for thread co-operation in dmeventd.
diff --git a/libdm/.exported_symbols.Base b/libdm/.exported_symbols.Base
index f9c3cb1..27fef53 100644
--- a/libdm/.exported_symbols.Base
+++ b/libdm/.exported_symbols.Base
@@ -262,7 +262,6 @@ dm_tree_node_set_thin_external_origin
dm_tree_node_set_thin_pool_discard
dm_tree_node_set_thin_pool_error_if_no_space
dm_tree_node_set_udev_flags
-dm_tree_node_size_changed
dm_tree_preload_children
dm_tree_retry_remove
dm_tree_set_cookie
diff --git a/libdm/.exported_symbols.DM_1_02_110 b/libdm/.exported_symbols.DM_1_02_110
index da742ee..eba5625 100644
--- a/libdm/.exported_symbols.DM_1_02_110
+++ b/libdm/.exported_symbols.DM_1_02_110
@@ -1,2 +1,3 @@
dm_report_compact_given_fields
dm_hold_control_dev
+dm_tree_node_size_changed
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 08b24fe..f7ab257 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1256,6 +1256,11 @@ const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);
+/*
+ * Returns 0 when node size and its children is unchanged.
+ * Returns 1 when node or any of its children has increased size.
+ * Rerurns -1 when node or any of its children has reduced size.
+ */
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
/*
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index afdce8d..d7e2143 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -220,7 +220,7 @@ struct load_properties {
uint32_t read_ahead_flags;
unsigned segment_count;
- unsigned size_changed;
+ int size_changed;
struct dm_list segs;
const char *new_name;
@@ -2729,7 +2729,8 @@ static int _load_node(struct dm_tree_node *dnode)
existing_table_size = dm_task_get_existing_table_size(dmt);
if ((dnode->props.size_changed =
- (existing_table_size == seg_start) ? 0 : 1)) {
+ (existing_table_size == seg_start) ? 0 :
+ (existing_table_size > seg_start) ? -1 : 1)) {
/*
* Kernel usually skips size validation on zero-length devices
* now so no need to preload them.
@@ -2825,8 +2826,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
}
/* Propagate device size change change */
- if (child->props.size_changed)
+ if (child->props.size_changed > 0 && !dnode->props.size_changed)
dnode->props.size_changed = 1;
+ else if (child->props.size_changed < 0)
+ dnode->props.size_changed = -1;
/* Resume device immediately if it has parents and its size changed */
if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed)
@@ -3853,3 +3856,19 @@ void dm_tree_node_set_callback(struct dm_tree_node *dnode,
dnode->callback = cb;
dnode->callback_data = data;
}
+
+/*
+ * Backward compatible dm_tree_node_size_changed() implementations.
+ *
+ * Keep these at the end of the file to avoid adding clutter around the
+ * current dm_tree_node_size_changed() version.
+ */
+#if defined(__GNUC__)
+int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode);
+DM_EXPORT_SYMBOL_BASE(dm_tree_node_size_changed);
+int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode)
+{
+ /* Base does not make difference between smaller and bigger */
+ return dm_tree_node_size_changed(dnode) ? 1 : 0;
+}
+#endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b780d329aa9ce249…
Commit: b780d329aa9ce249bf5164154c81cefd9b276970
Parent: 8f269697d21035035ffb4954f31bd702a6dd7ca8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 25 19:13:53 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Oct 25 21:01:54 2015 +0100
thin: fix percentage compare
Since plugin's percentage compare has been fixed,
it's now revealed wrong compare here.
The logic for threshold is - to allow to go as high
as given value e.g. 80% - so if pool is exactlu 80%
full it's still allowed to use it (dmeventd will not
resize it).
---
WHATS_NEW | 1 +
lib/metadata/thin_manip.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5911c64..0495e46 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Correct percentage evaluation when checking thin-pool over threshold.
Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 37bf4cb..6b22ce5 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -224,7 +224,7 @@ int pool_below_threshold(const struct lv_segment *pool_seg)
if (!lv_thin_pool_percent(pool_seg->lv, 0, &percent))
return_0;
- if (percent >= threshold) {
+ if (percent > threshold) {
log_debug("Threshold configured for free data space in "
"thin pool %s has been reached (%.2f%% >= %.2f%%).",
display_lvname(pool_seg->lv),
@@ -237,7 +237,7 @@ int pool_below_threshold(const struct lv_segment *pool_seg)
if (!lv_thin_pool_percent(pool_seg->lv, 1, &percent))
return_0;
- if (percent >= threshold) {
+ if (percent > threshold) {
log_debug("Threshold configured for free metadata space in "
"thin pool %s has been reached (%.2f%% > %.2f%%).",
display_lvname(pool_seg->lv),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8f269697d2103503…
Commit: 8f269697d21035035ffb4954f31bd702a6dd7ca8
Parent: 98d81a43ea31ec963a36b8610f3b5a9be28b4cc1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 23 12:19:11 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 23 12:19:11 2015 -0500
vg_read: remove unused inconsistent check
Commit 1a74171ca5682a684d0e05c6090c3d33cab8795b added
a check to ignore a VG that was FAILED_INCONSISTENT
if the command doesn't care if the VG is not found.
Remove that check because that case is never reached
by the current code.
---
tools/toollib.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 39bf0ac..fba075a 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -195,12 +195,6 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
return 0;
}
- if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_OK_NOTFOUND)) {
- read_error &= ~FAILED_INCONSISTENT;
- *skip = 1;
- return 0;
- }
-
if ((read_error & FAILED_INCONSISTENT) && (read_flags & READ_ALLOW_INCONSISTENT))
read_error &= ~FAILED_INCONSISTENT; /* Check for other errors */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3a42c13ccf151c3a…
Commit: 3a42c13ccf151c3afdeab362c8541b5d249fb01e
Parent: 8b965bd3d5df808aef2012494602cc0cf73d7398
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 23 15:05:48 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 23 15:58:31 2015 +0200
lvmcache: update cached info properly when moving from VG to orphan while lvmetad is used
When lvmetad is used and lvmcache update function (lvmcache_update_vgname_and_id)
was called to update existing lvmcache records, a condition was met
which made to retun from the update function immediately, effectively
making it NOOP.
It seems there's no reason for such condition and lvmcache should be
update appropriately even when lvmetad used as lvmcache may be reused,
most notably in lvm shell.
It's possible this is a remnant of the lvmetad development code which
didn't get removed for some reason and the bug didn't get spotted
because lvm shell is not used often (the condition dates back to 2012
or so).
Example, lvmetad and lvm shell used:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda vg lvm2 a-- 124.00m 124.00m
Before this patch:
==================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
With this patch applied:
========================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
---
WHATS_NEW | 1 +
lib/cache/lvmcache.c | 4 ----
2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6462e18..5911c64 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix lvmcache to move PV from VG to orphans if VG is removed and lvmetad used.
Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
Allow all log levels to be used with the lvmetad -l option.
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 1bc4241..31f2aa9 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1542,10 +1542,6 @@ int lvmcache_update_vgname_and_id(struct lvmcache_info *info, struct lvmcache_vg
vgid = vgname;
}
- /* When using lvmetad, the PV could not have become orphaned. */
- if (lvmetad_active() && is_orphan_vg(vgname) && info->vginfo)
- return 1;
-
/* If PV without mdas is already in a real VG, don't make it orphan */
if (is_orphan_vg(vgname) && info->vginfo &&
mdas_empty_or_ignored(&info->mdas) &&
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b965bd3d5df808a…
Commit: 8b965bd3d5df808aef2012494602cc0cf73d7398
Parent: 1a7bea0f0f187a3d3332dda2cca2ecd0300b8031
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 23 14:11:16 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 23 15:48:06 2015 +0200
pvremove: make sure even invalid info is removed from lvmcache on pvremove
The lvmcache info might be resued, most notably in lvm shell.
We need to be sure that even lvmcache_info marked as invalid
is removed from the lvmcache so it does not confuse any subsequent
code/commands executed later on.
Problematic example with the lvm shell:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
Before this patch (/dev/sda still displayed in a way):
======================================================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
No physical volume label read from /dev/sda
(with lvmetad)
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
With this patch applied:
========================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
(with lvmetad)
lvm> pvs
---
WHATS_NEW | 1 +
lib/metadata/pv_manip.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8ffbeca..6462e18 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix lvmcache to not cache even invalid info about PV which got removed.
Support checking of memlock daemon counter.
Allow all log levels to be used with the lvmetad -l option.
Add optional shutdown when idle support for lvmetad.
diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c
index ce7f661..e48fe42 100644
--- a/lib/metadata/pv_manip.c
+++ b/lib/metadata/pv_manip.c
@@ -781,7 +781,7 @@ int pvremove_single(struct cmd_context *cmd, const char *pv_name,
goto out;
}
- info = lvmcache_info_from_pvid(dev->pvid, 1);
+ info = lvmcache_info_from_pvid(dev->pvid, 0);
if (!dev_test_excl(dev)) {
/* FIXME Detect whether device-mapper is still using the device */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87a39d8bac572b67…
Commit: 87a39d8bac572b67f927dad41548155606a50f4f
Parent: cff1c728d8c80b3393c461f6229066f633b67fc2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 23 09:43:21 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 23 10:54:13 2015 +0200
dmeventd: ensure filter is empty
On some error path we could have left filter set to some value.
Not a big issue - but lets make reporting correct as soon
as we can.
---
daemons/dmeventd/dmeventd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index af03091..949fcf4 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -936,6 +936,7 @@ static void _monitor_unregister(void *arg)
break;
}
+ thread->events = 0; /* Filter is now empty */
thread->pending = 0; /* Event pending resolved */
thread->processing = 1; /* Process unregistering */
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2786cd27da3e7c61…
Commit: 2786cd27da3e7c6176940495ba57653ead7cfe08
Parent: 1a2d0a0c729e80e4cd122532829f3a11e6566823
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 22 16:51:18 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:46:10 2015 +0200
tests: enable raid test on 4.3
With kernel -rc6 it's passing our raid tests again - so enable
it in tests.
Note: related only to Fedora rawhide kernels...
---
test/lib/aux.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8a25d87..3f99357 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1112,9 +1112,8 @@ have_raid() {
# some kernels have broken mdraid bitmaps, don't use them!
# may oops kernel, we know for sure all FC24 are currently broken
# in general any 4.1, 4.2 is likely useless unless patched
- # hopefully 4.3 will be patched
case "$(uname -r)" in
- 4.[123].*fc24*) return 1 ;;
+ 4.[12].*fc24*) return 1 ;;
esac
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=12aa56d29867b962…
Commit: 12aa56d29867b962257d7d2789a661a22c649347
Parent: 9156c5d0888bf95b79d931682b51fc63c96ba236
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 22 15:48:14 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:40:07 2015 +0200
dmeventd: handle signal from plugin
Add support to unmonitor device when monitor recognizes there is
nothing to monitor anymore.
TODO: possibly API change with return value could be also used.
---
WHATS_NEW_DM | 3 ++-
daemons/dmeventd/dmeventd.c | 11 +++++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 8c27139..8524a6d 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,7 @@
Version 1.02.110 -
======================================
- New design for thread cooperation in dmeventd.
+ Add support to allow unmonitor device from plugin itself.
+ New design for thread co-operation in dmeventd.
Dmeventd read device status with 'noflush'.
Dmeventd closes control device when no device is monitored.
Thin plugin for dmeventd improved percentage usage.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index d8c317e..2706ad6 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -973,6 +973,17 @@ static void *_monitor_thread(void *arg)
_lock_mutex();
thread->processing = 0;
+
+ /*
+ * Thread can terminate itself from plugin via SIGALRM
+ * Timer thread will not send signal while processing
+ * TODO: maybe worth API change and return value for
+ * _do_process_event() instead of this signal solution
+ */
+ if (sigpending(&pendmask) < 0)
+ log_sys_error("sigpending", "");
+ else if (sigismember(&pendmask, SIGALRM))
+ break;
} else {
_unlock_mutex();
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=02eb000f5145aa60…
Commit: 02eb000f5145aa60578b4591053bff9a797e64cc
Parent: efc76ca33dec99e3b0499ef28fb9236815ad2258
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 21 20:52:29 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 22 22:34:27 2015 +0200
dmeventd: use dm_hold_control_dev
Need here to keep control device opened while there is 'any' dso
plugin loaded - otherwise there would a race closing controlfd
inside lvm2 plugin while some other monitoring thread would
tried to execute another WAITEVENT task.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 2b87e4b..000bddd 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Dmeventd closes control device when no device is monitored.
Thin plugin for dmeventd improved percentage usage.
Snapshot plugin for dmeventd improved percentage usage.
Add dm_hold_control_dev to allow holding of control device open.
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 69fe393..885aa9d 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -282,6 +282,13 @@ static void _lib_put(struct dso_data *data)
dlclose(data->dso_handle);
UNLINK_DSO(data);
_free_dso_data(data);
+
+ /* Close control device if there is no plugin in-use */
+ if (dm_list_empty(&_dso_registry)) {
+ DEBUGLOG("Unholding control device.");
+ dm_hold_control_dev(0);
+ dm_lib_release();
+ }
}
}
@@ -344,6 +351,12 @@ static struct dso_data *_load_dso(struct message_data *data)
goto_bad;
}
+ /* Keep control device open until last user closes */
+ if (dm_list_empty(&_dso_registry)) {
+ DEBUGLOG("Holding control device open.");
+ dm_hold_control_dev(1);
+ }
+
/*
* Keep handle to close the library once
* we've got no references to it any more.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=73e679f33f411c65…
Commit: 73e679f33f411c65c9b7c7e4e501d97245f0bf5d
Parent: a0d819172fde16913347e5c0984dc4d67ae6befe
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 21 13:36:57 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 21 13:36:57 2015 -0500
man: document possible lvmetad -l values
In the man page and the lvmetad help output.
---
WHATS_NEW | 1 +
daemons/lvmetad/lvmetad-core.c | 4 ++--
man/lvmetad.8.in | 14 +++++---------
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 983b2b4..ece92e0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Allow all log levels to be used with the lvmetad -l option.
Add optional shutdown when idle support for lvmetad.
Fix missing in-sync progress info while lvconvert used with lvmpolld.
Add report/compact_output_cols to lvm.conf to define report cols to compact.
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 7ec3a3a..64d998e 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1637,11 +1637,11 @@ static int process_timeout_arg(const char *str, unsigned *max_timeouts)
static void usage(const char *prog, FILE *file)
{
fprintf(file, "Usage:\n"
- "%s [-V] [-h] [-f] [-l {all|wire|debug}] [-s path] [-t secs]\n\n"
+ "%s [-V] [-h] [-f] [-l level[,level ...]] [-s path] [-t secs]\n\n"
" -V Show version of lvmetad\n"
" -h Show this help information\n"
" -f Don't fork, run in the foreground\n"
- " -l Logging message level (-l {all|wire|debug})\n"
+ " -l Logging message levels (all,fatal,error,warn,info,wire,debug)\n"
" -p Set path to the pidfile\n"
" -s Set path to the socket to listen on\n"
" -t Time to wait in seconds before shutdown on idle (missing or 0 = inifinite)\n\n", prog);
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 2acfd8b..3e895ce 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -5,7 +5,7 @@ lvmetad \(em LVM metadata cache daemon
.SH SYNOPSIS
.B lvmetad
.RB [ \-l
-.RI { all | wire | debug }]
+.IR level [,level...]]
.RB [ \-p
.IR pidfile_path ]
.RB [ \-s
@@ -77,15 +77,11 @@ Don't fork, but run in the foreground.
.BR \-h ", " \-?
Show help information.
.TP
-.IR \fB\-l " {" all | wire | debug }
-Select the type of log messages to generate.
-Messages are logged by syslog.
+.B \-l \fIlevels
+Specify the levels of log messages to generate as a comma separated list.
+Messages are logged by syslog.
Additionally, when \-f is given they are also sent to standard error.
-Since release 2.02.98, there are two classes of messages: wire and debug.
-Selecting 'all' supplies both and is equivalent to a comma-separated list
-\-l wire,debug.
-Prior to release 2.02.98, repeating \-d from 1 to 3 times, viz. \-d, \-dd, \-ddd,
-increased the detail of messages.
+Possible levels are: all, fatal, error, warn, info, wire, debug.
.TP
.B \-p \fIpidfile_path
Path to the pidfile. This overrides both the built-in default
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ef4d69f456b22b4e…
Commit: ef4d69f456b22b4e58afb9fe5ff0b09603944f35
Parent: c15649b3af94e4af573ada0f30e35f7d1fee5321
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 15:41:42 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 15:45:28 2015 +0200
tests: add lvmetad shutdown on idle test
---
test/shell/lvmetad-autoshutdown.sh | 56 ++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvmetad-autoshutdown.sh b/test/shell/lvmetad-autoshutdown.sh
new file mode 100644
index 0000000..fdee4a6
--- /dev/null
+++ b/test/shell/lvmetad-autoshutdown.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Copyright (C) 2015 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/inittest
+
+test -e LOCAL_LVMETAD || skip
+test -e LOCAL_LVMPOLLD && skip
+
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad is already dead"
+
+lvmetad_timeout=3
+
+aux prepare_pvs 1
+
+vgcreate $vg1 "$dev1"
+
+kill $(< LOCAL_LVMETAD)
+aux prepare_lvmetad -t $lvmetad_timeout
+
+sleep $lvmetad_timeout
+
+# lvmetad should die after timeout, but give it some time to do so
+i=0
+while kill -0 $(< LOCAL_LVMETAD) 2>/dev/null; do
+ test $i -ge $((lvmetad_timeout*10)) && die "lvmetad didn't shutdown with optional timeout: $lvmetad_timeout seconds"
+ sleep .1
+ i=$((i+1))
+done
+
+aux prepare_lvmetad -t 0
+sleep 1
+# lvmetad must not die with -t 0 option
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad died"
+
+kill $(< LOCAL_LVMETAD)
+aux prepare_lvmetad -t $lvmetad_timeout
+
+sleep 1
+vgs
+sleep 1
+vgs
+sleep 1
+vgs
+
+# check that connection to lvmetad resets the timeout
+kill -0 $(< LOCAL_LVMETAD) || die "lvmetad died too soon"
+
+vgremove -ff $vg1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c15649b3af94e4af…
Commit: c15649b3af94e4af573ada0f30e35f7d1fee5321
Parent: f67a52677bdc95209c7adfa4575c833bed1659f1
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 13:33:29 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 15:45:21 2015 +0200
lvmetad.8.in: update man page with timeout info
---
man/lvmetad.8.in | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index cdaf198..2acfd8b 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -10,6 +10,8 @@ lvmetad \(em LVM metadata cache daemon
.IR pidfile_path ]
.RB [ \-s
.IR socket_path ]
+.RB [ \-t
+.IR timeout_value ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-V ]
@@ -97,6 +99,10 @@ Path to the socket file. This overrides both the built-in default
\fBLVM_LVMETAD_SOCKET\fP. To communicate successfully with lvmetad,
all LVM2 processes should use the same socket path.
.TP
+.B \-t \fItimeout_value
+The daemon may shutdown after being idle for the given time (in seconds). When the
+option is omitted or the value given is zero the daemon never shutdowns on idle.
+.TP
.B \-V
Display the version of lvmetad daemon.
.SH ENVIRONMENT VARIABLES
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=392248186e56fb21…
Commit: 392248186e56fb216e49a2fee0caad5a506e3dd1
Parent: 33465066c5eddaa6169814d645d543e5673bc2a6
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Tue Oct 20 11:55:51 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 12:19:02 2015 +0200
tests: add test for missing mirror in-sync info
---
test/shell/lvconvert-mirror.sh | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 844f8e9..029112c 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010-2013 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -313,4 +313,11 @@ lvconvert --mirrorlog disk $vg/$lv1 "$dev3:0-1"
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
+# bz1272175: check lvconvert reports progress while waiting for mirror
+# to get synced
+lvcreate -l2 -n $lv1 $vg
+lvconvert --type mirror -i1 -m1 $vg/$lv1 | tee out
+grep -e "$vg/$lv1: Converted:" out || fail "Missing sync info in foreground mode"
+lvremove -ff $vg
+
vgremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=33465066c5eddaa6…
Commit: 33465066c5eddaa6169814d645d543e5673bc2a6
Parent: a5c4c4efbd18809320f49d7ed60c58883140259c
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Oct 19 16:56:45 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Tue Oct 20 12:18:55 2015 +0200
polldaemon: fix missing mirror in-sync info with lvmpolld
CONVERTING status flag is a tricky one. It's not set when converting
a non-mirror LV type to the mirror type, i.e.: linear -> two leg mirror.
Also the conversion itself is instant and doesn't require to be polled.
When mirror reaches sync state there's no final update on VG metadata
for lvmpolld to be made thereby report_progress in fact doesn't report
percentage of mirror being converted but percentage of mirror
being in sync. Perhaps we should reword the lvconvert output here.
On the other hand CONVERTING is set while we upconvert the mirror
from i.e. two leg mirror to four leg mirror. In such case the operation
is required to be polled so that lvmpolld can cleanup temporary
conversion log when the conversion is over.
Ignore CONVERTING lv_type for the moment and match LVs only by uuids
during 'mirror conversion'/'waiting for a sync to finish'.
---
WHATS_NEW | 1 +
tools/polldaemon.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f973f11..763896e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix missing in-sync progress info while lvconvert used with lvmpolld.
Add report/compact_output_cols to lvm.conf to define report cols to compact.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index cee1983..ccfaa7d 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -412,7 +412,12 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id
if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid))
lv = NULL;
- if (lv && parms->lv_type && !(lv->status & parms->lv_type))
+
+ /*
+ * CONVERTING is set only during mirror upconversion but we may need to
+ * read LV's progress info even when it's not converting (linear->mirror)
+ */
+ if (lv && (parms->lv_type ^ CONVERTING) && !(lv->status & parms->lv_type))
lv = NULL;
if (!lv) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a5c4c4efbd188093…
Commit: a5c4c4efbd18809320f49d7ed60c58883140259c
Parent: 83d475626a4d9ecaa2084f349cb2cee4f0f3a719
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Oct 20 11:01:09 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Oct 20 11:01:09 2015 +0200
conf: clarify compact output settings
---
conf/example.conf.in | 21 ++++++++++++---------
lib/config/config_settings.h | 21 ++++++++++++---------
2 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e96f03f..b8c0407 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1494,19 +1494,22 @@ activation {
# report {
# Configuration option report/compact_output.
- # Do not print empty report fields.
- # Fields that don't have a value set for any of the rows reported are
- # skipped and not printed. Compact output is applicable only if
- # report/buffered is enabled.
+ # Do not print empty values for all report fields.
+ # If enabled, all fields that don't have a value set for any of the
+ # rows reported are skipped and not printed. Compact output is
+ # applicable only if report/buffered is enabled. If you need to
+ # compact only specified fields, use compact_output=0 and define
+ # report/compact_output_cols configuration setting instead.
# This configuration option has an automatic default value.
# compact_output = 0
# Configuration option report/compact_output_cols.
- # Do not print empty values for given report fields.
- # The same as compact_output setting, but the compaction is not done
- # globally for all fields in report but only for given fields. If both
- # compact_output and compact_output_cols is used at the same time,
- # the compact_output setting prevails.
+ # Do not print empty values for specified report fields.
+ # If defined, specified fields that don't have a value set for any
+ # of the rows reported are skipped and not printed. Compact output
+ # is applicable only if report/buffered is enabled. If you need to
+ # compact all fields, use compact_output=1 instead in which case
+ # the compact_output_cols setting is then ignored.
# This configuration option has an automatic default value.
# compact_output_cols = ""
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 1a261a2..dd2b407 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1416,17 +1416,20 @@ cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_
cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL, NULL)
cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL, 0, NULL,
- "Do not print empty report fields.\n"
- "Fields that don't have a value set for any of the rows reported are\n"
- "skipped and not printed. Compact output is applicable only if\n"
- "report/buffered is enabled.\n")
+ "Do not print empty values for all report fields.\n"
+ "If enabled, all fields that don't have a value set for any of the\n"
+ "rows reported are skipped and not printed. Compact output is\n"
+ "applicable only if report/buffered is enabled. If you need to\n"
+ "compact only specified fields, use compact_output=0 and define\n"
+ "report/compact_output_cols configuration setting instead.\n")
cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMPACT_OUTPUT_COLS, vsn(2, 2, 133), NULL, 0, NULL,
- "Do not print empty values for given report fields.\n"
- "The same as compact_output setting, but the compaction is not done\n"
- "globally for all fields in report but only for given fields. If both\n"
- "compact_output and compact_output_cols is used at the same time,\n"
- "the compact_output setting prevails.\n")
+ "Do not print empty values for specified report fields.\n"
+ "If defined, specified fields that don't have a value set for any\n"
+ "of the rows reported are skipped and not printed. Compact output\n"
+ "is applicable only if report/buffered is enabled. If you need to\n"
+ "compact all fields, use compact_output=1 instead in which case\n"
+ "the compact_output_cols setting is then ignored.\n")
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
"Align columns in report output.\n")
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1ea7e2634d67a762…
Commit: 1ea7e2634d67a7628508a677668a00f748aee0b0
Parent: 23d9b17a7b06d8e6f89b2c3e9ef9f59462436458
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 19 10:01:14 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 19 10:01:14 2015 +0200
conf: regenerate
---
conf/example.conf.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index dddede0..e96f03f 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -389,8 +389,8 @@ allocation {
# This configuration option does not have a default value defined.
# Configuration section allocation/cache_settings.
- # Individual settings for policies.
- # See the help for individual policies for more info.
+ # Settings for the cache policy.
+ # See documentation for individual cache policies for more info.
# This configuration section has an automatic default value.
# cache_settings {
# }
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=23d9b17a7b06d8e6…
Commit: 23d9b17a7b06d8e6f89b2c3e9ef9f59462436458
Parent: c3bfe07f2ad393963af5b7138bccc622e6561c8f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 19 09:59:05 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 19 09:59:05 2015 +0200
cleanup: typo in comment: compact_output_fields should be compact-output_cols
---
conf/example.conf.in | 2 +-
lib/config/config_settings.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e1afed6..dddede0 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1505,7 +1505,7 @@ activation {
# Do not print empty values for given report fields.
# The same as compact_output setting, but the compaction is not done
# globally for all fields in report but only for given fields. If both
- # compact_output and compact_output_fields is used at the same time,
+ # compact_output and compact_output_cols is used at the same time,
# the compact_output setting prevails.
# This configuration option has an automatic default value.
# compact_output_cols = ""
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index cefc579..1a261a2 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1425,7 +1425,7 @@ cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, C
"Do not print empty values for given report fields.\n"
"The same as compact_output setting, but the compaction is not done\n"
"globally for all fields in report but only for given fields. If both\n"
- "compact_output and compact_output_fields is used at the same time,\n"
+ "compact_output and compact_output_cols is used at the same time,\n"
"the compact_output setting prevails.\n")
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c3bfe07f2ad39396…
Commit: c3bfe07f2ad393963af5b7138bccc622e6561c8f
Parent: 508f0f5a21af8decf32944e01ecf17c0059a9c9f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 16 16:25:51 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 16 17:05:54 2015 +0200
config: add report/compact_output_cols to control which columns to compact in report output
The new report/compact_output_cols setting has exactly the same effect
as report/compact_output setting. The difference is that with the new
setting it's possible to define which cols should be compacted exactly
in contrast to all cols in case of report/compact_output.
In case both compact_output and compact_output_cols is enabled/set,
the compact_output prevails.
For example:
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols=""
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
---
$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=1
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"
$ lvs vg
LV VG Attr LSize
lvol0 vg -wi-a----- 4.00m
---
WHATS_NEW | 1 +
conf/example.conf.in | 9 +++++++++
lib/config/config_settings.h | 7 +++++++
lib/config/defaults.h | 2 ++
libdm/libdevmapper.h | 2 +-
tools/reporter.c | 11 ++++++++---
6 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c089228..f973f11 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Add report/compact_output_cols to lvm.conf to define report cols to compact.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/conf/example.conf.in b/conf/example.conf.in
index c0afcb7..e1afed6 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1501,6 +1501,15 @@ activation {
# This configuration option has an automatic default value.
# compact_output = 0
+ # Configuration option report/compact_output_cols.
+ # Do not print empty values for given report fields.
+ # The same as compact_output setting, but the compaction is not done
+ # globally for all fields in report but only for given fields. If both
+ # compact_output and compact_output_fields is used at the same time,
+ # the compact_output setting prevails.
+ # This configuration option has an automatic default value.
+ # compact_output_cols = ""
+
# Configuration option report/aligned.
# Align columns in report output.
# This configuration option has an automatic default value.
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 9cc444f..cefc579 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -1421,6 +1421,13 @@ cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILA
"skipped and not printed. Compact output is applicable only if\n"
"report/buffered is enabled.\n")
+cfg(report_compact_output_cols_CFG, "compact_output_cols", report_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_COMPACT_OUTPUT_COLS, vsn(2, 2, 133), NULL, 0, NULL,
+ "Do not print empty values for given report fields.\n"
+ "The same as compact_output setting, but the compaction is not done\n"
+ "globally for all fields in report but only for given fields. If both\n"
+ "compact_output and compact_output_fields is used at the same time,\n"
+ "the compact_output setting prevails.\n")
+
cfg(report_aligned_CFG, "aligned", report_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_REP_ALIGNED, vsn(1, 0, 0), NULL, 0, NULL,
"Align columns in report output.\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index cd5d121..8ab1fde 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -201,6 +201,8 @@
#define DEFAULT_REP_LIST_ITEM_SEPARATOR ","
#define DEFAULT_TIME_FORMAT "%Y-%m-%d %T %z"
+#define DEFAULT_COMPACT_OUTPUT_COLS ""
+
#define DEFAULT_LVS_COLS "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,metadata_percent,move_pv,mirror_log,copy_percent,convert_lv"
#define DEFAULT_VGS_COLS "vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"
#define DEFAULT_PVS_COLS "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 1a2036b..fcbf7cf 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -2552,7 +2552,7 @@ int dm_report_compact_fields(struct dm_report *rh);
* The same as dm_report_compact_fields, but for selected fields only.
* The "fields" arg is comma separated list of field names (the same format
* as used for "output_fields" arg in dm_report_init fn).
-*/
+ */
int dm_report_compact_given_fields(struct dm_report *rh, const char *fields);
/*
diff --git a/tools/reporter.c b/tools/reporter.c
index 8f7a272..6c93739 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -618,6 +618,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
unsigned args_are_pvs;
int lv_info_needed, lv_segment_status_needed;
int lock_global = 0;
+ const char *fields_to_compact;
aligned = find_config_tree_bool(cmd, report_aligned_CFG, NULL);
buffered = find_config_tree_bool(cmd, report_buffered_CFG, NULL);
@@ -817,9 +818,13 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
break;
}
- if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL) &&
- !dm_report_compact_fields(report_handle))
- log_error("Failed to compact report output.");
+ if (find_config_tree_bool(cmd, report_compact_output_CFG, NULL)) {
+ if (!dm_report_compact_fields(report_handle))
+ log_error("Failed to compact report output.");
+ } else if ((fields_to_compact = find_config_tree_str_allow_empty(cmd, report_compact_output_cols_CFG, NULL))) {
+ if (!dm_report_compact_given_fields(report_handle, fields_to_compact))
+ log_error("Failed to compact given columns in report output.");
+ }
dm_report_output(report_handle);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df34fcdafd20ac19…
Commit: df34fcdafd20ac195e588a06c8fc5a904fa71669
Parent: a6d1c8ac651ecdc6fbdfa20f892ba318c2dddeda
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 14 14:36:46 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 14 14:39:29 2015 -0500
lvmlockd: use flag to avoid blocking in sanlock_acquire
If a host failed while holding a sanlock lease,
sanlock_acquire will by default block and wait
for the lease to expire before returning. We
want it to return with an error so we can retry
instead of blocking, which allows us to process
other lock operations.
(Enclose this in an ifdef until the new flag
appears in a sanlock release.)
---
daemons/lvmlockd/lvmlockd-sanlock.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-sanlock.c b/daemons/lvmlockd/lvmlockd-sanlock.c
index 1e691eb..e1a85b4 100644
--- a/daemons/lvmlockd/lvmlockd-sanlock.c
+++ b/daemons/lvmlockd/lvmlockd-sanlock.c
@@ -1392,6 +1392,15 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
if (adopt)
flags |= SANLK_ACQUIRE_ORPHAN_ONLY;
+#ifdef SANLOCK_HAS_ACQUIRE_OWNER_NOWAIT
+ /*
+ * Don't block waiting for a failed lease to expire since it causes
+ * sanlock_acquire to block for a long time, which would prevent this
+ * thread from processing other lock requests.
+ */
+ flags |= SANLK_ACQUIRE_OWNER_NOWAIT;
+#endif
+
rv = sanlock_acquire(lms->sock, -1, flags, 1, &rs, NULL);
if (rv == -EAGAIN) {
@@ -1462,6 +1471,26 @@ int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
return -EAGAIN;
}
+#ifdef SANLOCK_HAS_ACQUIRE_OWNER_NOWAIT
+ if (rv == SANLK_ACQUIRE_OWNED_RETRY) {
+ /*
+ * The lock is held by a failed host, and will eventually
+ * expire. If we retry we'll eventually acquire the lock
+ * (or find someone else has acquired it). The EAGAIN retry
+ * attempts for SH locks above would not be sufficient for
+ * the length of expiration time. We could add a longer
+ * retry time here to cover the full expiration time and block
+ * the activation command for that long. For now just return
+ * the standard error indicating that another host still owns
+ * the lease. FIXME: return a different error number so the
+ * command can print an different error indicating that the
+ * owner of the lease is in the process of expiring?
+ */
+ log_debug("S %s R %s lock_san acquire mode %d rv %d", ls->name, r->name, ld_mode, rv);
+ *retry = 0;
+ return -EAGAIN;
+ }
+#endif
if (rv < 0) {
log_error("S %s R %s lock_san acquire error %d",
ls->name, r->name, rv);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bbef4edd06097a71…
Commit: bbef4edd06097a71601b1470a713ded17deb7cba
Parent: 3f1a3b7090d421d46f245454bc5c8ed299a9cc1d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 14 00:51:55 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Oct 14 00:51:55 2015 +0200
makefiles: switch to rpath-link
Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.
---
scripts/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index bfa0fad..af2b299 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2006-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2006-2015 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -26,7 +26,7 @@ ifeq ("@APPLIB@", "yes")
DEPLIBS += $(top_builddir)/liblvm/liblvm2app.so $(top_builddir)/libdm/libdevmapper.so
LDFLAGS += -L$(top_builddir)/liblvm
ifeq ("@DMEVENTD@", "yes")
- LDFLAGS += -Wl,-rpath,$(top_builddir)/daemons/dmeventd
+ LDFLAGS += -Wl,-rpath-link,$(top_builddir)/daemons/dmeventd
endif
LVMLIBS = @LVM2APP_LIB@ -ldevmapper
endif
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0cf787a377548394…
Commit: 0cf787a377548394f4588b671c2890ee1a45098b
Parent: acc70de43968961e9a71612cda04642e4fbfd71f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 13 15:31:57 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 13 15:31:57 2015 +0100
Revert "log: no file for external logging"
This reverts commit 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2.
This caused messages to get dropped instead of logged into the log file.
(The log file and log function are independent at the moment.)
---
WHATS_NEW | 1 -
lib/log/log.c | 4 ----
2 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 7507b9c..c089228 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,5 @@
Version 2.02.133 -
======================================
- Avoid creation of log file when logging function is set.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/lib/log/log.c b/lib/log/log.c
index 2f1be72..c44c3d4 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -71,10 +71,6 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
-
- if (_lvm2_log_fn)
- return; /* No log file, when log function is set */
-
if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2cb1f6eafeb72dcd…
Commit: 2cb1f6eafeb72dcd49a7ed941d9c5400540284fa
Parent: 93229184066a9b7726e3b572bca3f612ed2815fb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 7 15:07:15 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 16:02:20 2015 +0200
tests: show status in in_sync
Make visible actual status line when returing 'raid' is in sync.
Useful to prove when kernel is wrong.
---
test/lib/check.sh | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index b47bc8b..74a6eb6 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -189,16 +189,17 @@ in_sync() {
local lvm_name="$1/$2"
local dm_name=$(echo $lvm_name | sed s:-:--: | sed s:/:-:)
- if ! a=(`dmsetup status $dm_name`); then
+ a=( $(dmsetup status $dm_name) ) || \
die "Unable to get sync status of $1"
- elif [ ${a[2]} = "snapshot-origin" ]; then
- if ! a=(`dmsetup status ${dm_name}-real`); then
+
+ if [ ${a[2]} = "snapshot-origin" ]; then
+ a=( $(dmsetup status ${dm_name}-real) ) || \
die "Unable to get sync status of $1"
- fi
snap=": under snapshot"
fi
- if [ ${a[2]} = "raid" ]; then
+ case ${a[2]} in
+ "raid")
# 6th argument is the sync ratio for RAID
idx=6
type=${a[3]}
@@ -206,13 +207,16 @@ in_sync() {
echo "$lvm_name ($type$snap) is not in-sync"
return 1
fi
- elif [ ${a[2]} = "mirror" ]; then
+ ;;
+ "mirror")
# 4th Arg tells us how far to the sync ratio
idx=$((${a[3]} + 4))
type=${a[2]}
- else
+ ;;
+ *)
die "Unable to get sync ratio for target type '${a[2]}'"
- fi
+ ;;
+ esac
b=( $(echo ${a[$idx]} | sed s:/:' ':) )
@@ -221,11 +225,10 @@ in_sync() {
return 1
fi
- if [[ ${a[$(($idx - 1))]} =~ a ]]; then
+ [[ ${a[$(($idx - 1))]} =~ a ]] && \
die "$lvm_name ($type$snap) in-sync, but 'a' characters in health status"
- fi
- echo "$lvm_name ($type$snap) is in-sync"
+ echo "$lvm_name ($type$snap) is in-sync \"${a[@]}\""
}
active() {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76ea01dd207ce185…
Commit: 76ea01dd207ce185891418c3f8ffdcff14bf2672
Parent: 362558cd66bc08f8a46ababef66f2df21e8bd6fc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 13 09:43:09 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:55:05 2015 +0200
dmeventd: new initialization of plugin threads
Rework thread creation code to better use resources.
New code will not leak 'timeout' registered thread on error path.
Also if the thread already exist - avoid creation of thread
object and it's later destruction.
If the race is noticed during adding new monitoring thread,
such thread is put on cleanup list and -EEXIST is reported.
---
WHATS_NEW_DM | 1 +
daemons/dmeventd/dmeventd.c | 170 +++++++++++++++++++++---------------------
2 files changed, 86 insertions(+), 85 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index efe8b37..f041ed1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Reworked thread initialization for dmeventd plugins.
Dmeventd handles snapshot overflow for now equally as invalid.
Convert dmeventd to use common logging macro system from libdm.
Return -ENOMEM when device registration fails instead of 0 (=success).
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 3e54f79..ba7d01c 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -990,91 +990,6 @@ static int _active(struct message_data *message_data)
}
/*
- * Register for an event.
- *
- * Only one caller at a time here, because we use
- * a FIFO and lock it against multiple accesses.
- */
-static int _register_for_event(struct message_data *message_data)
-{
- int ret = 0;
- struct thread_status *thread, *thread_new = NULL;
- struct dso_data *dso_data;
-
- if (!(dso_data = _lookup_dso(message_data)) &&
- !(dso_data = _load_dso(message_data))) {
- stack;
-#ifdef ELIBACC
- ret = -ELIBACC;
-#else
- ret = -ENODEV;
-#endif
- goto out;
- }
-
- /* Preallocate thread status struct to avoid deadlock. */
- if (!(thread_new = _alloc_thread_status(message_data, dso_data))) {
- stack;
- ret = -ENOMEM;
- goto out;
- }
-
- if (!_fill_device_data(thread_new)) {
- stack;
- ret = -ENODEV;
- goto out;
- }
-
- /* If creation of timeout thread fails (as it may), we fail
- here completely. The client is responsible for either
- retrying later or trying to register without timeout
- events. However, if timeout thread cannot be started, it
- usually means we are so starved on resources that we are
- almost as good as dead already... */
- if ((thread_new->events & DM_EVENT_TIMEOUT) &&
- (ret = -_register_for_timeout(thread_new)))
- goto out;
-
- _lock_mutex();
- if (!(thread = _lookup_thread_status(message_data))) {
- _unlock_mutex();
-
- if (!_do_register_device(thread_new)) {
- ret = -ENOMEM;
- goto_out;
- }
-
- thread = thread_new;
- thread_new = NULL;
-
- /* Try to create the monitoring thread for this device. */
- _lock_mutex();
- if ((ret = -_create_thread(thread))) {
- _unlock_mutex();
- _do_unregister_device(thread);
- _free_thread_status(thread);
- goto out;
- }
-
- LINK_THREAD(thread);
- }
-
- /* Or event # into events bitfield. */
- thread->events |= message_data->events_field;
- _unlock_mutex();
-
- out:
- /*
- * Deallocate thread status after releasing
- * the lock in case we haven't used it.
- */
- if (thread_new)
- _free_thread_status(thread_new);
-
- return ret;
-}
-
-/*
* Unregister for an event.
*
* Only one caller at a time here as with register_for_event().
@@ -1128,6 +1043,91 @@ static int _unregister_for_event(struct message_data *message_data)
}
/*
+ * Register for an event.
+ *
+ * Only one caller at a time here, because we use
+ * a FIFO and lock it against multiple accesses.
+ */
+static int _register_for_event(struct message_data *message_data)
+{
+ int ret = 0;
+ struct thread_status *thread;
+ struct dso_data *dso_data;
+
+ if (!(dso_data = _lookup_dso(message_data)) &&
+ !(dso_data = _load_dso(message_data))) {
+ stack;
+#ifdef ELIBACC
+ ret = -ELIBACC;
+#else
+ ret = -ENODEV;
+#endif
+ return ret;
+ }
+
+ _lock_mutex();
+
+ if ((thread = _lookup_thread_status(message_data)))
+ /* Or event # into events bitfield. */
+ thread->events |= message_data->events_field;
+
+ _unlock_mutex();
+
+ if (!thread) {
+ if (!(thread = _alloc_thread_status(message_data, dso_data))) {
+ stack;
+ return -ENOMEM;
+ }
+
+ if (!_fill_device_data(thread)) {
+ ret = -ENODEV;
+ goto_out;
+ }
+
+ if (!_do_register_device(thread)) {
+ ret = -ENOMEM;
+ goto_out;
+ }
+
+ if ((ret = -_create_thread(thread))) {
+ _do_unregister_device(thread);
+ goto_out;
+ }
+
+ _lock_mutex();
+ if (_lookup_thread_status(message_data)) {
+ DEBUGLOG("Race, uuid already registered, marking Thr %x unused.",
+ (int)thread->thread);
+ thread->status = DM_THREAD_SHUTDOWN;
+ thread->events = 0;
+ LINK(thread, &_thread_registry_unused);
+ _unlock_mutex();
+ ret = -EEXIST; /* race ? */
+ goto_out;
+ }
+
+ LINK_THREAD(thread);
+ _unlock_mutex();
+ }
+
+ /* If creation of timeout thread fails (as it may), we fail
+ here completely. The client is responsible for either
+ retrying later or trying to register without timeout
+ events. However, if timeout thread cannot be started, it
+ usually means we are so starved on resources that we are
+ almost as good as dead already... */
+ if ((thread->events & DM_EVENT_TIMEOUT) &&
+ (ret = -_register_for_timeout(thread)))
+ _unregister_for_event(message_data);
+
+ return ret;
+out:
+ _free_thread_status(thread);
+
+ return ret;
+}
+
+/*
* Get registered device.
*
* Only one caller at a time here as with register_for_event().
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e261af52eb26c22a…
Commit: e261af52eb26c22aebd62cdbd8bb79c195274ee9
Parent: 3f03d46fc13be2274b3c29d4fc97a3306bc33eda
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 21:41:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:44 2015 +0200
dmeventd: handle snapshot overflow
When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.
---
WHATS_NEW_DM | 1 +
.../dmeventd/plugins/snapshot/dmeventd_snapshot.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ff4ac22..efe8b37 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.110 -
======================================
+ Dmeventd handles snapshot overflow for now equally as invalid.
Convert dmeventd to use common logging macro system from libdm.
Return -ENOMEM when device registration fails instead of 0 (=success).
Enforce writethrough mode for cleaner policy.
diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
index ffe6666..ae8e308 100644
--- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
+++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c
@@ -150,7 +150,7 @@ void process_event(struct dm_task *dmt,
if (!dm_get_status_snapshot(state->mem, params, &status))
goto out;
- if (status->invalid) {
+ if (status->invalid || status->overflow) {
struct dm_info info;
log_error("Snapshot %s is lost.", device);
if (dm_task_get_info(dmt, &info)) {
@@ -170,7 +170,7 @@ void process_event(struct dm_task *dmt,
* If the snapshot has been invalidated or we failed to parse
* the status string. Report the full status string to syslog.
*/
- if (status->invalid || !status->total_sectors) {
+ if (status->invalid || status->overflow || !status->total_sectors) {
log_error("Snapshot %s changed state to: %s.", device, params);
state->percent_check = 0;
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3f03d46fc13be227…
Commit: 3f03d46fc13be2274b3c29d4fc97a3306bc33eda
Parent: 0e2721030857088803bc71ccc27644b7b95241ca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 12 11:35:53 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:43 2015 +0200
man: dmeventd update
---
man/dmeventd.8.in | 92 +++++++++++++++++++++++++++++++++++++---------------
1 files changed, 65 insertions(+), 27 deletions(-)
diff --git a/man/dmeventd.8.in b/man/dmeventd.8.in
index 77bbafb..15e003b 100644
--- a/man/dmeventd.8.in
+++ b/man/dmeventd.8.in
@@ -1,7 +1,11 @@
.TH DMEVENTD 8 "DM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
+.
.SH NAME
+.
dmeventd \(em Device-mapper event daemon
+.
.SH SYNOPSIS
+.
.B dmeventd
.RB [ \-d
.RB [ \-d
@@ -11,33 +15,53 @@ dmeventd \(em Device-mapper event daemon
.RB [ \-R ]
.RB [ \-V ]
.RB [ \-? ]
+.
.SH DESCRIPTION
+.
dmeventd is the event monitoring daemon for device-mapper devices.
Library plugins can register and carry out actions triggered when
particular events occur.
-.SH
-LVM PLUGINS
-.TP
-.I Mirror
-Attempts to handle device failure automatically. See \fBlvm.conf\fP(5).
-.TP
-.I Raid
-Attempts to handle device failure automatically. See \fBlvm.conf\fP(5).
-.TP
-.I Snapshot
+.
+.SH LVM PLUGINS
+.
+.HP
+.IR Mirror
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.IR Raid
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.IR Snapshot
+.br
Monitors how full a snapshot is becoming and emits a warning to
syslog when it exceeds 80% full.
The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
-See \fBlvm.conf\fP(5).
-.TP
-.I Thin
-Monitors how full a thin pool is becoming and emits a warning to
-syslog when it exceeds 80% full.
+See
+.BR lvm.conf (5).
+Snapshot which runs out of space gets invalid and when it is mounted,
+it gets umounted if possible.
+.
+.HP
+.IR Thin
+.br
+Monitors how full a thin pool data and metadata is becoming and emits
+a warning to syslog when it exceeds 80% full.
The warning is repeated when 85%, 90% and 95% of the thin pool is filled.
-See \fBlvm.conf\fP(5).
+See
+.BR lvm.conf (5).
+If the thin-pool runs out of space, thin volumes are umounted if possible.
+.
.SH OPTIONS
-.TP
-.B \-d
+.
+.HP
+.BR \-d
+.br
Repeat from 1 to 3 times (
.BR \-d ,
.BR \-dd ,
@@ -45,21 +69,35 @@ Repeat from 1 to 3 times (
) to increase the detail of
debug messages sent to syslog.
Each extra d adds more debugging information.
-.TP
-.B \-f
+.
+.HP
+.BR \-f
+.br
Don't fork, run in the foreground.
-.TP
-.BR \-h ", " \-?
+.
+.HP
+.BR \-h
+.br
Show help information.
-.TP
-.B \-R
+.
+.HP
+.BR \-?
+.br
+Show help information on stderr.
+.
+.HP
+.BR \-R
+.br
Replace a running dmeventd instance. The running dmeventd must be version
2.02.77 or newer. The new dmeventd instance will obtain a list of devices and
events to monitor from the currently running daemon.
-.TP
-.B \-V
+.
+.HP
+.BR \-V
+.br
Show version of dmeventd.
-
+.
.SH SEE ALSO
+.
.BR lvm (8),
.BR lvm.conf (5)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13086c2523a00bc8…
Commit: 13086c2523a00bc8501113f56094312bda4881e1
Parent: 42a9c8b4a659a44bef1b3150eb6359d562938ca3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 22:08:01 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 15:15:43 2015 +0200
dmeventd: drop changing logging
As we now use 'unified' logging macro system - we no longer need
to protect from change of logging function pointer - it's set
once at the start of dmeventd and not change anymore
(as lvm2 library no longer interferers here).
---
daemons/dmeventd/dmeventd.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 6f25379..0acb919 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -648,7 +648,6 @@ static sigset_t _unblock_sigalrm(void)
/* Wait on a device until an event occurs. */
static int _event_wait(struct thread_status *thread, struct dm_task **task)
{
- static unsigned _in_event_counter = 0;
sigset_t set;
int ret = DM_WAIT_RETRY;
struct dm_task *dmt;
@@ -667,16 +666,11 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
!dm_task_set_event_nr(dmt, thread->event_nr))
goto out;
- _lock_mutex();
/*
* Check if there are already some waiting events,
* in this case the logging is unmodified.
* TODO: audit libdm thread usage
*/
- if (!_in_event_counter++)
- dm_log_init(_dmeventd_log);
- _unlock_mutex();
-
DEBUGLOG("Starting waitevent task for %s", thread->device.uuid);
/*
* This is so that you can break out of waiting on an event,
@@ -708,10 +702,6 @@ static int _event_wait(struct thread_status *thread, struct dm_task **task)
DEBUGLOG("Completed waitevent task for %s", thread->device.uuid);
pthread_sigmask(SIG_SETMASK, &set, NULL);
- _lock_mutex();
- if (--_in_event_counter == 0)
- dm_log_init(NULL);
- _unlock_mutex();
out:
if (ret == DM_WAIT_FATAL || ret == DM_WAIT_RETRY) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1b1c01a27b359f8e…
Commit: 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2
Parent: 72d700b064fb64f6bb7e20c23dbb2ce8b6d8feb7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 13 09:44:33 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:40:44 2015 +0200
log: no file for external logging
When external logging is set do not bother creating log file,
as it's not going to be used.
---
WHATS_NEW | 1 +
lib/log/log.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c089228..7507b9c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Avoid creation of log file when logging function is set.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/lib/log/log.c b/lib/log/log.c
index bd11363..7f31361 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -74,6 +74,10 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
+
+ if (_lvm2_log_fn)
+ return; /* No log file, when log function is set */
+
if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=72d700b064fb64f6…
Commit: 72d700b064fb64f6bb7e20c23dbb2ce8b6d8feb7
Parent: 86b04ebd193c9db09ee5f03a2de4997aa2ab52c3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 21:38:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:39:37 2015 +0200
toolcontext: do not change already set dm_log
If the dm_log is already set to non-default logger,
avoid to change it.
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 348c099..c089228 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index c8d96ca..c150991 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -362,7 +362,8 @@ static void _init_logging(struct cmd_context *cmd)
/* Tell device-mapper about our logging */
#ifdef DEVMAPPER_SUPPORT
- dm_log_with_errno_init(print_log);
+ if (!dm_log_is_non_default())
+ dm_log_with_errno_init(print_log);
#endif
reset_log_duplicated();
reset_lvm_errno(1);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c7b4359ff4163409…
Commit: c7b4359ff41634096770d464d362d43d2e82bbda
Parent: 5695c6aca63b2312e76f8b3fbbea95601269f8c8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 7 15:10:03 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:37:07 2015 +0200
thin: check for overflown pool earlier
Check for pool early before we actually start to modify metadata.
This requires locally active thin-pool.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 18 ++++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f683456..348c099 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 3e870d5..8a0bbcd 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7087,12 +7087,18 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
}
- if (seg_is_thin_volume(lp) &&
- lv_is_new_thin_pool(pool_lv)) {
- thin_pool_was_active = lv_is_active(pool_lv);
- if (!check_new_thin_pool(pool_lv))
- return_NULL;
- /* New pool is now inactive */
+ if (seg_is_thin_volume(lp)) {
+ if (lv_is_new_thin_pool(pool_lv)) {
+ thin_pool_was_active = lv_is_active(pool_lv);
+ if (!check_new_thin_pool(pool_lv))
+ return_NULL;
+ /* New pool is now inactive */
+ } else if (!pool_below_threshold(first_seg(pool_lv))) {
+ log_error("Cannot create new thin volume, free space in "
+ "thin pool %s reached threshold.",
+ display_lvname(pool_lv));
+ return NULL;
+ }
}
if (seg_is_cache(lp) &&
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5ac81657e5d312b7…
Commit: 5ac81657e5d312b72d746bc7cf22a4e6bb5b1609
Parent: 5bd63df237bc3426d1ebd41b103430063846b3ab
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Oct 13 12:18:04 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Oct 13 12:22:09 2015 +0200
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
Some signatures are spread around the disk in several copies, mainly for
backup. Make libblkid to detect these extra copies - there was missing
"blkid_probe_step_back" fn call after successful wipe of previous signature
copy.
An example with FAT table which has copies:
$ mkfs.vfat /dev/sda1
Before this patch:
$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
Physical volume "/dev/sda1" successfully created
With this patch applied:
$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 0. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 510. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
Physical volume "/dev/sda1" successfully created
---
WHATS_NEW | 1 +
lib/device/dev-type.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5fa6e7f..f683456 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
Add vg_missing_pv_count report field to report number of missing PVs in a VG.
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 25f11d1..1d03024 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -651,8 +651,13 @@ static int _wipe_known_signatures_with_blkid(struct device *dev, const char *nam
BLKID_SUBLKS_BADCSUM);
while (!blkid_do_probe(probe)) {
- if ((r_wipe = _blkid_wipe(probe, dev, name, types_to_exclude, types_no_prompt, yes, force)) == 1)
+ if ((r_wipe = _blkid_wipe(probe, dev, name, types_to_exclude, types_no_prompt, yes, force)) == 1) {
(*wiped)++;
+ if (blkid_probe_step_back(probe)) {
+ log_error("Failed to step back blkid probe to check just wiped signature.");
+ goto out;
+ }
+ }
/* do not count excluded types */
if (r_wipe != 2)
found++;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bd63df237bc3426…
Commit: 5bd63df237bc3426d1ebd41b103430063846b3ab
Parent: 75420282e17e44d5c7b56126a5c7fd170f0ef417
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 12 12:54:35 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 12 12:55:39 2015 +0200
tests: test vgimportclone and -n option
---
test/shell/vgimportclone.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh
index 0b1af38..53c8b00 100644
--- a/test/shell/vgimportclone.sh
+++ b/test/shell/vgimportclone.sh
@@ -71,3 +71,28 @@ lvchange -ay $vg1/$lv1 $vg2/$lv1
vgchange -an $vg1 $vg2
vgremove -ff $vg1 $vg2
+
+# Verify that if we provide the -n|--basevgname,
+# the number suffix is not added unnecessarily.
+vgcreate --metadatasize 128k A${vg1}B "$dev1"
+
+# vg1B is not the same as Avg1B - we don't need number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n ${vg1}B "$dev2"
+check pv_field "$dev2" vg_name ${vg1}B
+
+# Avg1 is not the same as Avg1B - we don't need number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n A${vg1} "$dev2"
+check pv_field "$dev2" vg_name A${vg1}
+
+# Avg1B is the same as Avg1B - we need to add the number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n A${vg1}B "$dev2"
+aux vgs
+check pv_field "$dev2" vg_name A${vg1}B1
+
+vgremove -ff A${vg1}B A${vg1}B1
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=75420282e17e44d5…
Commit: 75420282e17e44d5c7b56126a5c7fd170f0ef417
Parent: 38df48d108e3b040501edfd9e0517bfcb31373de
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 12 12:51:13 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 12 12:54:59 2015 +0200
vgimportclone: make sure there's no prefix in VG name list
Make sure log/prefix is set to "" when getting the list of VG names.
We need this for the format to be correct so it's properly searched
through later on.
---
scripts/vgimportclone.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index 52f3884..0ac987a 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -220,7 +220,7 @@ fi
### :vgname1:vgname2:...:vgnameN:
#####################################################################
-OLDVGS=":`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings --rows --separator :`:"
+OLDVGS=":`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings --rows --separator : --config 'log{prefix=""}'`:"
checkvalue $? "Current VG names could not be collected without errors"
#####################################################################
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=38df48d108e3b040…
Commit: 38df48d108e3b040501edfd9e0517bfcb31373de
Parent: 21a8ac0cd3a392feaa049ab509c4727eee548d6b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 12 11:11:34 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 12 11:11:34 2015 +0200
vgimportclone: fix vgimportclone with -n to not add number unnecessarily to base VG name
$ vgcreate vgA /dev/sda
Volume group "vgA" successfully created
$ dd if=/dev/sda of=/dev/sdb bs=1M
$ dd if=/dev/sda of=/dev/sdc bs=1M
(the new VG name is prefix of existing VG name)
$ vgimportclone -n vg /dev/sdb
(the new VG name is suffix of existing VG name)
$ vgimportclone -n gA /dev/sdc
Before this patch:
------------------
(we end up with "vg1" and "gA1" names with the "1" suffix which is not needed)
$ vgs -o vg_name
VG
gA1
vg1
vgA
With this patch applied:
------------------------
(we end up with "vg" and "gA" names as they're unique already and no extra suffix is added)
$ # vgs -o vg_name
VG
gA
vg
vgA
Of course, if the name supplied is not unique, the number is added correctly:
$ dd if=/dev/sda of=/dev/sdb bs=1M
$ vgimportclone -n vgA /dev/sdb
$ vgs -o vg_name
VG
vgA
vgA1
---
WHATS_NEW | 1 +
scripts/vgimportclone.sh | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9af759e..5fa6e7f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
Add vg_missing_pv_count report field to report number of missing PVs in a VG.
Properly identify internal LV holding sanlock locks within lv_role field.
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index d14a170..52f3884 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -48,7 +48,7 @@ function getvgname {
NAME="${BNAME}"
I=0
- while [[ "${VGLIST}" =~ "${NAME}" ]]
+ while [[ "${VGLIST}" =~ ":${NAME}:" ]]
do
I=$(($I+1))
NAME="${BNAME}$I"
@@ -215,10 +215,12 @@ then
fi
#####################################################################
-### Get the existing state so we can use it later
+### Get the existing state so we can use it later.
+### The list of VG names is saved in this format:
+### :vgname1:vgname2:...:vgnameN:
#####################################################################
-OLDVGS=`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings`
+OLDVGS=":`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings --rows --separator :`:"
checkvalue $? "Current VG names could not be collected without errors"
#####################################################################
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=21a8ac0cd3a392fe…
Commit: 21a8ac0cd3a392feaa049ab509c4727eee548d6b
Parent: 1f30ba6178df6c3faac06328f17158f549b9d4f7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 9 12:20:22 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 9 12:20:22 2015 -0500
Fix segfault when lvmlockd is running but not lvmetad
If lvmlockd is running, lvmetad is configured (use_lvmetad=1),
but lvmetad is not running, then commands will seg fault
when trying to send a message to lvmetad.
The difference is lvmetad being "active", not just "used".
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 20d2001..c7f6ecb 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1683,7 +1683,7 @@ void lvmetad_validate_global_cache(struct cmd_context *cmd, int force)
return;
}
- if (!lvmetad_used())
+ if (!lvmetad_active())
return;
log_debug_lvmetad("Validating global lvmetad cache");
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1f30ba6178df6c3f…
Commit: 1f30ba6178df6c3faac06328f17158f549b9d4f7
Parent: 8733a8d89040820f66a99d4d4e8f524ab2497983
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 9 16:26:27 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 9 16:31:02 2015 +0200
vgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr
We can replace the expressions with awk/grep/cut/tr with --select now and
more suitable reporting options and modes. Also, we don't need to check
the temporary lvm.conf generated within vgimportclone script since we're
generating it ourselves now using lvmconfig, not using sed anymore like
it was before (so we can be pretty sure it's correct - we use lvmconfig
now even for generating the lvm.conf itself).
---
WHATS_NEW | 1 +
scripts/vgimportclone.sh | 87 +++++++++++++--------------------------------
2 files changed, 26 insertions(+), 62 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index ac9f6b8..9af759e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
Add vg_missing_pv_count report field to report number of missing PVs in a VG.
Properly identify internal LV holding sanlock locks within lv_role field.
Add metadata_devices and seg_metadata_le_ranges report fields for raid vols.
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index af8cf5c..d14a170 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -21,11 +21,7 @@
RM=rm
BASENAME=basename
MKTEMP=mktemp
-AWK=awk
-CUT=cut
-TR=tr
READLINK=readlink
-GREP=grep
GETOPT=getopt
# user may override lvm location by setting LVM_BINARY
@@ -253,59 +249,37 @@ checkvalue $? "Failed to generate ${LVMCONF}"
# Only keep TMP_LVM_SYSTEM_DIR if it contains something worth keeping
[ -n "${DEBUG}" ] && KEEP_TMP_LVM_SYSTEM_DIR=1
-# verify the config contains the filter, scan and cache_dir (or cache) config keywords
-"$GREP" -q '^[[:space:]]*filter[[:space:]]*=' ${LVMCONF} || \
- die 5 "Temporary lvm.conf must contain 'filter' config."
-"$GREP" -q '^[[:space:]]*scan[[:space:]]*=' ${LVMCONF} || \
- die 6 "Temporary lvm.conf must contain 'scan' config."
-
-# check for either 'cache' or 'cache_dir' config values
-"$GREP" -q '[[:space:]]*cache[[:space:]]*=' ${LVMCONF}
-CACHE_RET=$?
-"$GREP" -q '^[[:space:]]*cache_dir' ${LVMCONF}
-CACHE_DIR_RET=$?
-[ $CACHE_RET -eq 0 -o $CACHE_DIR_RET -eq 0 ] || \
- die 7 "Temporary lvm.conf must contain 'cache' or 'cache_dir' config."
-
### set to use new lvm.conf
export LVM_SYSTEM_DIR=${TMP_LVM_SYSTEM_DIR}
+# Check if there are any PVs that don't belong to any VG
+# or even if there are disks which are not PVs at all.
+NOVGDEVLIST=`${LVM} pvs -a -o pv_name --select vg_name="" --noheadings`
+checkvalue $? "Failed to collect information for PV check"
+if [ -n "${NOVGDEVLIST}" ]; then
+ FOLLOWLIST=""
+ while read PVNAME; do
+ FOLLOW=`$READLINK $PVNAME`
+ FOLLOWLIST="$FOLLOWLIST $FOLLOW"
+ done <<< "`echo "${NOVGDEVLIST}"`"
+ die 8 "Specified devices don't belong to a VG:$FOLLOWLIST"
+fi
#####################################################################
### Rename the VG(s) and change the VG and PV UUIDs.
#####################################################################
+VGLIST=`${LVM} vgs -o vg_name,vg_exported,vg_missing_pv_count --noheadings --binary`
+checkvalue $? "Failed to collect VG information"
-PVINFO=`"${LVM}" pvs ${LVM_OPTS} -o pv_name,vg_name,vg_attr --noheadings --separator :`
-checkvalue $? "PV info could not be collected without errors"
-
-# output VG info so each line looks like: name:exported?:disk1,disk2,...
-VGINFO=`echo "${PVINFO}" | \
- "$AWK" -F : '{{sub(/^[ \t]*/,"")} \
- {sub(/unknown device/,"unknown_device")} \
- {vg[$2]=$1","vg[$2]} if($3 ~ /^..x/){x[$2]="x"}} \
- END{for(k in vg){printf("%s:%s:%s\n", k, x[k], vg[k])}}'`
-checkvalue $? "PV info could not be parsed without errors"
-
-for VG in ${VGINFO}
-do
- VGNAME=`echo "${VG}" | "$CUT" -d: -f1`
- EXPORTED=`echo "${VG}" | "$CUT" -d: -f2`
- PVLIST=`echo "${VG}" | "$CUT" -d: -f3- | "$TR" , ' '`
-
- if [ -z "${VGNAME}" ]
- then
- FOLLOWLIST=""
- for DEV in $PVLIST; do
- FOLLOW=`"$READLINK" $DEV`
- FOLLOWLIST="$FOLLOW $FOLLOWLIST"
- done
- die 8 "Specified PV(s) ($FOLLOWLIST) don't belong to a VG."
+while read VGNAME VGEXPORTED VGMISSINGPVCOUNT; do
+ if [ $VGMISSINGPVCOUNT -gt 0 ]; then
+ echo "Volume Group ${VGNAME} has unknown PV(s), skipping."
+ echo "- Were all associated PV(s) supplied as arguments?"
+ continue
fi
- if [ -n "${EXPORTED}" ]
- then
- if [ ${IMPORT} -eq 1 ]
- then
+ if [ "$VGEXPORTED" = "1" ]; then
+ if [ ${IMPORT} -eq 1 ]; then
"$LVM" vgimport ${LVM_OPTS} ${TEST_OPT} "${VGNAME}"
checkvalue $? "Volume Group ${VGNAME} could not be imported"
else
@@ -314,23 +288,12 @@ do
fi
fi
- ### change the pv uuids
- if [[ "${PVLIST}" =~ "unknown" ]]
- then
- echo "Volume Group ${VGNAME} has unknown PV(s), skipping."
- echo "- Were all associated PV(s) supplied as arguments?"
- continue
- fi
-
- for BLOCKDEV in ${PVLIST}
- do
- "$LVM" pvchange ${LVM_OPTS} ${TEST_OPT} --uuid ${BLOCKDEV} --config 'global{activation=0}'
- checkvalue $? "Unable to change PV uuid for ${BLOCKDEV}"
- done
+ "$LVM" pvchange ${LVM_OPTS} ${TEST_OPT} --uuid --config 'global{activation=0}' --select "vg_name=${VGNAME}"
+ checkvalue $? "Unable to change all PV uuids in VG ${VG_NAME}"
NEWVGNAME=`getvgname "${OLDVGS}" "${VGNAME}" "${NEWVG}"`
- "$LVM" vgchange ${LVM_OPTS} ${TEST_OPT} --uuid "${VGNAME}" --config 'global{activation=0}'
+ "$LVM" vgchange ${LVM_OPTS} ${TEST_OPT} --uuid --config 'global{activation=0}' ${VGNAME}
checkvalue $? "Unable to change VG uuid for ${VGNAME}"
## if the name isn't going to get changed dont even try.
@@ -341,7 +304,7 @@ do
fi
CHANGES_MADE=1
-done
+done <<< "`echo "${VGLIST}"`"
#####################################################################
### Restore the old environment
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8733a8d89040820f…
Commit: 8733a8d89040820f66a99d4d4e8f524ab2497983
Parent: 5446d177569ca10476c935013ae03e6a0763ab34
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Oct 9 16:20:29 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Oct 9 16:28:58 2015 +0200
report: add vg_missing_pv_count field
We already have pv_count to report number of PVs that a VG has based
on metadata.
This patch exposes the information about how many of these PVs are
missing which is also useful information for a VG. Wwe could count
the sum of pv_missing reporting fields for each PV in the VG before,
but the new field is practical when reporting VG as a whole and there's
no need to process each PV from VG alone.
---
WHATS_NEW | 1 +
lib/report/columns.h | 3 ++-
lib/report/properties.c | 2 ++
lib/report/report.c | 11 +++++++++++
4 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 227530d..ac9f6b8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Add vg_missing_pv_count report field to report number of missing PVs in a VG.
Properly identify internal LV holding sanlock locks within lv_role field.
Add metadata_devices and seg_metadata_le_ranges report fields for raid vols.
Fix lvm2-{activation,clvmd,cmirrord,monitor} service to exec before mounting.
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 6041eeb..41a03f4 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -158,7 +158,8 @@ FIELD(VGS, vg, NUM, "#Ext", extent_count, 4, uint32, vg_extent_count, "Total num
FIELD(VGS, vg, NUM, "Free", free_count, 4, uint32, vg_free_count, "Total number of unallocated Physical Extents.", 0)
FIELD(VGS, vg, NUM, "MaxLV", max_lv, 5, uint32, max_lv, "Maximum number of LVs allowed in VG or 0 if unlimited.", 0)
FIELD(VGS, vg, NUM, "MaxPV", max_pv, 5, uint32, max_pv, "Maximum number of PVs allowed in VG or 0 if unlimited.", 0)
-FIELD(VGS, vg, NUM, "#PV", pv_count, 3, uint32, pv_count, "Number of PVs.", 0)
+FIELD(VGS, vg, NUM, "#PV", pv_count, 3, uint32, pv_count, "Number of PVs in VG.", 0)
+FIELD(VGS, vg, NUM, "#PV Missing", cmd, 11, vgmissingpvcount, vg_missing_pv_count, "Number of PVs in VG which are missing.", 0)
FIELD(VGS, vg, NUM, "#LV", cmd, 3, lvcount, lv_count, "Number of LVs.", 0)
FIELD(VGS, vg, NUM, "#SN", cmd, 3, snapcount, snap_count, "Number of snapshots.", 0)
FIELD(VGS, vg, NUM, "Seq", seqno, 3, uint32, vg_seqno, "Revision number of internal metadata. Incremented whenever it changes.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 262cc26..7dafbe5 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -420,6 +420,8 @@ GET_VG_NUM_PROPERTY_FN(vg_mda_copies, (vg_mda_copies(vg)))
SET_VG_NUM_PROPERTY_FN(vg_mda_copies, vg_set_mda_copies)
GET_VG_STR_PROPERTY_FN(vg_profile, vg_profile_dup(vg))
#define _vg_profile_set prop_not_implemented_set
+GET_VG_NUM_PROPERTY_FN(vg_missing_pv_count, vg_missing_pv_count(vg))
+#define _vg_missing_pv_count_set prop_not_implemented_set
/* LVSEG */
GET_LVSEG_STR_PROPERTY_FN(segtype, lvseg_segtype_dup(lvseg->lv->vg->vgmem, lvseg))
diff --git a/lib/report/report.c b/lib/report/report.c
index 7ac1ac5..dea66ee 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -2438,6 +2438,17 @@ static int _vgprofile_disp(struct dm_report *rh, struct dm_pool *mem,
return _field_set_value(field, "", NULL);
}
+static int _vgmissingpvcount_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct volume_group *vg = (const struct volume_group *) data;
+ uint32_t count = vg_missing_pv_count(vg);
+
+ return _uint32_disp(rh, mem, field, &count, private);
+}
+
+
static int _pvmdafree_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5446d177569ca104…
Commit: 5446d177569ca10476c935013ae03e6a0763ab34
Parent: c9ff5c8223c6c2d23829aef076d58c32382891c8
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 8 13:21:42 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 8 13:26:09 2015 -0500
man lvmsystemid: fix typos
---
man/lvmsystemid.7.in | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/man/lvmsystemid.7.in b/man/lvmsystemid.7.in
index eb10ac5..0048873 100644
--- a/man/lvmsystemid.7.in
+++ b/man/lvmsystemid.7.in
@@ -274,7 +274,7 @@ cache with pvscan --cache will allow a host to recognize the newly
exported VG.
vgimport sets the VG system_id to the local system_id as determined by
-lvm.conf system_id_sources. vgimport automatically scans storage for
+lvm.conf system_id_source. vgimport automatically scans storage for
newly exported VGs.
After vgimport, the exporting host will continue to see the VG as
@@ -300,9 +300,9 @@ To move a VG from one host to another, vgexport and vgimport should be
used.
To forcibly gain ownership of a foreign VG, a host can add the foreign
-system_id to its allow_system_id list, change the system_id of the foreign
-VG to its own, and remove the foreign system_id from its allow_system_id
-list.
+system_id to its extra_system_ids list, change the system_id of the
+foreign VG to its own, and remove the foreign system_id from its
+extra_system_ids list.
.SS shared VGs
@@ -328,7 +328,7 @@ creation_host will be the same.
Orphan PVs are unused devices; they are not currently used in any VG.
Because of this, they are not protected by a system_id, and any host can
-use them. Coodination of changes to orphan PVs is beyond the scope of
+use them. Coordination of changes to orphan PVs is beyond the scope of
system_id. The same is true of any block device that is not a PV.
The effects of this are especially evident when lvm uses lvmetad caching.
@@ -337,7 +337,7 @@ using the orphan, the other hosts will continue to report the PV as an
orphan. Nothing would automatically prevent the other hosts from using
the newly allocated PV and corrupting it. If the other hosts run a
command to rescan devices, and update lvmetad, they would then recognize
-the PV has been used by another host. A command that rescans devices
+that the PV has been used by another host. A command that rescans devices
could be pvscan --cache, or vgs --foreign.
.SH SEE ALSO
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c9ff5c8223c6c2d2…
Commit: c9ff5c8223c6c2d23829aef076d58c32382891c8
Parent: d99dd4086da5ab2ed7bf02a8711d4a4998fe2b31
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 8 13:14:28 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 8 13:14:28 2015 -0500
man lvmsystemd: fix typo
---
man/lvmsystemid.7.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvmsystemid.7.in b/man/lvmsystemid.7.in
index 37a01af..eb10ac5 100644
--- a/man/lvmsystemid.7.in
+++ b/man/lvmsystemid.7.in
@@ -84,7 +84,7 @@ version without the system_id feature.
.SS Types of VG access
-A local VG is mean to be used by a single host.
+A local VG is meant to be used by a single host.
.br
A shared or clustered VG is meant to be used by multiple hosts.
.br
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3d03e504cda6307f…
Commit: 3d03e504cda6307f692c5879f6850b2e27af7d71
Parent: e04424e87e66df22578d1e4d2488615cd3692873
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 8 16:25:10 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 8 16:27:03 2015 +0200
metadata: format_text: provide more detailed error message when metadata too large for PV mda
Also, leave out the note about "circular buffer" which is
an internal imeplementation detail anyway and not quite
informational for users:
Before this patch:
$ vgcreate vg1 /dev/sda
VG vg1 metadata too large for circular buffer
Failed to write VG vg1.
With this patch applied:
$ vgcreate vg1 /dev/sda
VG vg1 metadata too large: size of metadata to write is 691 bytes while PV metadata area size on /dev/sda is 512 bytes.
Failed to write VG vg1.
---
lib/format_text/format-text.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index e0ec8ed..c1c4787 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -655,8 +655,11 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
(mdac->rlocn.size >= mdah->size)) {
- log_error("VG %s metadata too large for circular buffer",
- vg->name);
+ log_error("VG %s metadata too large: size of metadata to write "
+ "is %" PRIu64 " bytes while PV metadata area size "
+ "on %s is %" PRIu64 " bytes.",
+ vg->name, mdac->rlocn.size,
+ dev_name(mdac->area.dev), mdah->size);
goto out;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=277dd0aa7a901369…
Commit: 277dd0aa7a9013697ae99164900d8d8ec12a2850
Parent: ded9452174664b7e204f5ce266bbd5c770714474
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 6 14:55:24 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:23:55 2015 +0200
tests: check devices with prefix aren't in use
Avoid running tests, when prefix already exist in the system.
As prefix just uses PID number, we may hit a case for long
running tests, where devices from some previous runs were not
properly cleared away - detect this and fail early.
(Such machine should be inspected and fixed).
---
test/lib/inittest.sh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index a5eeb57..4ed8d20 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -29,6 +29,9 @@ TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
PREFIX="${COMMON_PREFIX}$$"
+# Check we are not conflickting with some exiting setup
+dmsetup table | not grep "$PREFIX" || die "DM table already has devices with prefix $PREFIX!"
+
if test -z "$LVM_TEST_DIR"; then LVM_TEST_DIR=$TMPDIR; fi
TESTDIR=$(mkdtemp "${LVM_TEST_DIR:-/tmp}" "$PREFIX.XXXXXXXXXX") || \
die "failed to create temporary directory in ${LVM_TEST_DIR:-$TESTOLDPWD}"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ded9452174664b7e…
Commit: ded9452174664b7e204f5ce266bbd5c770714474
Parent: 4b1cadbd87a0814a46b36b07cfe94eda7baacb28
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 6 14:55:09 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:23:55 2015 +0200
man: lvcreate continue
Finish remaing bits of updating pages for better rendering
with -Thtml, -Tps.
---
man/lvchange.8.in | 3 +
man/lvcreate.8.in | 277 ++++++++++++++++++++++++++++++----------------------
man/lvm.8.in | 1 +
3 files changed, 164 insertions(+), 117 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 62bdca1..8ae17a0 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -431,7 +431,10 @@ Suppress locking failure messages.
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
.sp
.B lvchange \-pr vg00/lvol1
+.
.SH SEE ALSO
+.
+.nh
.BR lvm (8),
.BR lvmetad (8),
.BR lvs (8),
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 8a364c4..2ce39dd 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -1,7 +1,22 @@
.TH LVCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
+.
+.\" Use 1st. parameter with \% to fix 'man2html' rendeing on same line!
+.de SIZE_G
+. IR \\$1 \c
+. RB [ b | B | s | S | k | K | m | M | g | G ]
+..
+.de SIZE_E
+. IR \\$1 \c
+. RB [ b | B | s | S | k | K | m | M | \c
+. BR g | G | t | T | p | P | e | E ]
+..
+.
.SH NAME
+.
lvcreate \- create a logical volume in an existing volume group
+.
.SH SYNOPSIS
+.
.ad l
.B lvcreate
.RB [ \-a | \-\-activate
@@ -17,7 +32,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB { passthrough | writeback | writethrough }]
.RB [ \-\-cachepolicy
.IR policy ]
-.RB [ \-\-cachepool
+.RB \%[ \-\-cachepool
.IR CachePoolLogicalVolume ]
.RB [ \-\-cachesettings
.IR key \fB= value ]
@@ -25,7 +40,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR ChunkSize ]
.RB [ \-\-commandprofile
.IR ProfileName ]
-.RB [ \-C | \-\-contiguous
+.RB \%[ \-C | \-\-contiguous
.RB { y | n }]
.RB [ \-d | \-\-debug ]
.RB [ \-\-discards
@@ -78,7 +93,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR Rate ]
.RB [ \-r | \-\-readahead
.RB { \fIReadAheadSectors | auto | none }]
-.RB [ \-k | \-\-setactivationskip
+.RB \%[ \-k | \-\-setactivationskip
.RB { y | n }]
.RB [ \-s | \-\-snapshot ]
.RB [ \-V | \-\-virtualsize
@@ -94,9 +109,10 @@ lvcreate \- create a logical volume in an existing volume group
.RB { y | n }]
.RB [ \-Z | \-\-zero
.RB { y | n }]
-.RI [ VolumeGroup [ \fB/ { ExternalOrigin |\: Origin |
-.IR Pool } LogicalVolumeName ]
-.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI [ VolumeGroup \c
+.RB [ / \c
+.RI { ExternalOrigin | Origin | Pool } LogicalVolumeName
+.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]]
.LP
.B lvcreate
.RB [ \-l | \-\-extents
@@ -107,7 +123,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR LogicalVolumeSize ]
.RB [ \-c | \-\-chunksize
.IR ChunkSize ]
-.RB [ \-\-commandprofile
+.RB \%[ \-\-commandprofile
.IR Profile\%Name ]
.RB [ \-\-noudevsync ]
.RB [ \-\-ignoremonitoring ]
@@ -118,11 +134,13 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-n | \-\-name
.IR SnapshotLogicalVolume ]
.BR \-s | \-\-snapshot | \-H | \-\-cache
-.RI \%{[ VolumeGroup \fB/ ] OriginalLogicalVolume
-.BR \-V | \-\-virtualsize
-.IR VirtualSize }
+.RI \%{[ VolumeGroup \fB/\fP] OriginalLogicalVolume
+.RB \%[ \-V | \-\-virtualsize
+.IR VirtualSize ]}
.ad b
+.
.SH DESCRIPTION
+.
lvcreate creates a new logical volume in a volume group (see
.BR vgcreate "(8), " vgchange (8))
by allocating logical extents from the free physical extent pool
@@ -151,40 +169,41 @@ for common options.
.br
Controls the availability of the Logical Volumes for immediate use after
the command finishes running.
-By default, new Logical Volumes are activated (\fB\-a\fIy\fR).
-If it is possible technically, \fB\-a\fIn\fR will leave the new Logical
+By default, new Logical Volumes are activated (\fB\-ay\fP).
+If it is possible technically, \fB\-an\fP will leave the new Logical
Volume inactive. But for example, snapshots of active origin can only be
-created in the active state so \fB\-a\fIn\fR cannot be used with
-\fB-\-type\fP \fIsnapshot\fP. This does not apply to thin volume snapshots,
+created in the active state so \fB\-an\fP cannot be used with
+\fB-\-type snapshot\fP. This does not apply to thin volume snapshots,
which are by default created with flag to skip their activation
-(\fB-k\fP\fIy\fP).
-Normally the \fB\-\-zero\fP \fIn\fP argument has to be supplied too because
+(\fB-ky\fP).
+Normally the \fB\-\-zero n\fP argument has to be supplied too because
zeroing (the default behaviour) also requires activation.
-If autoactivation option is used (\fB\-a\fIay\fR), the logical volume is
+If autoactivation option is used (\fB\-aay\fP), the logical volume is
activated only if it matches an item in the
-.IR activation / auto_activation_volume_list
+\fBactivation/auto_activation_volume_list\fP
set in \fBlvm.conf\fP(5).
-For autoactivated logical volumes, \fB\-\-zero\fP \fIn\fP and
-\fB\-\-wipesignatures\fP \fIn\fP is always assumed and it can't
+For autoactivated logical volumes, \fB\-\-zero n\fP and
+\fB\-\-wipesignatures n\fP is always assumed and it can't
be overridden. If the clustered locking is enabled,
-\fB\-a\fIey\fR will activate exclusively on one node and
-.IR \fB\-a { a | l } y
+\fB\-aey\fP will activate exclusively on one node and
+.BR \-a { a | l } y
will activate only on the local node.
.
.HP
.BR \-H | \-\-cache
.br
-Creates cache or cache pool logical volume or both.
-Specifying the optional argument \fB\-\-size\fP will cause the creation of
-the cache logical volume.
+Creates cache or cache pool logical volume.
+.\" or both.
+Specifying the optional argument \fB\-\-extents\fP or \fB\-\-size\fP
+will cause the creation of the cache logical volume.
.\" Specifying the optional argument \fB\-\-pooldatasize\fP will cause
.\" the creation of the cache pool logical volume.
-Specifying both arguments will cause the creation of cache with its
-cache pool volume.
+.\" Specifying both arguments will cause the creation of cache with its
+.\" cache pool volume.
When the Volume group name is specified together with existing logical volume
-name which is NOT a cache pool name, such volume is treaded
-as cache origin volume and cache pool is created. In this case
-the \fB\-\-size\fP is used to specify size of cache pool volume.
+name which is NOT a cache pool name, such volume is treated
+as cache origin volume and cache pool is created. In this case the
+\fB\-\-extents\fP or \fB\-\-size\fP is used to specify size of cache pool volume.
See \fBlvmcache\fP(7) for more info about caching support.
Note that the cache segment type requires a dm-cache kernel module version
1.3.0 or greater.
@@ -228,19 +247,18 @@ and removes it from the list of settings stored in lvm2 metadata.
.
.HP
.BR \-c | \-\-chunksize
-.IR ChunkSize \c
-.RB [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%ChunkSize
.br
Gives the size of chunk for snapshot, cache pool and thin pool logical volumes.
Default unit is in kilobytes.
.br
-For \fIsnapshots\fP the value must be power of 2 between 4KiB and 512KiB
+For snapshots the value must be power of 2 between 4KiB and 512KiB
and the default value is 4KiB.
.br
-For \fIcache pools\fP the value must a multiple of 32KiB
+For cache pools the value must a multiple of 32KiB
between 32KiB and 1GiB. The default is 64KiB.
.br
-For \fIthin pools\fP the value must be a multiple of 64KiB
+For thin pools the value must be a multiple of 64KiB
between 64KiB and 1GiB.
Default value starts with 64KiB and grows up to
fit the pool metadata size within 128MiB,
@@ -279,7 +297,7 @@ Default is \fBpassdown\fP.
Configures thin pool behaviour when data space is exhausted.
Default is \fBn\fPo.
Device will queue I/O operations until target timeout
-(see dm-thin-pool kernel module option \fIno_space_timeout\fP)
+(see dm-thin-pool kernel module option \fPno_space_timeout\fP)
expires. Thus configured system has a time to i.e. extend
the size of thin pool data device.
When set to \fBy\fPes, the I/O operation is immeditelly errored.
@@ -313,7 +331,7 @@ PhysicalVolume(s) with the suffix \fB%PVS\fP, or (for a snapshot) as a
percentage of the total space in the Origin Logical Volume with the
suffix \fB%ORIGIN\fP (i.e. \fB100%ORIGIN\fP provides space for the whole origin).
When expressed as a percentage, the number is treated
-as an approximate upper limit for the total number of physical extents
+as an approximate upper limit for the number of physical extents
to be allocated (including extents used by any mirrors, for example).
.
.HP
@@ -330,7 +348,7 @@ numbers are dynamically assigned.
.BR \-\-metadataprofile
.IR ProfileName
.br
-Uses and attaches the ProfileName configuration profile to the logical
+Uses and attaches the \fIProfileName\fP configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
profile attached, the logical volume profile is preferred.
@@ -448,7 +466,7 @@ Otherwise it is \fBn\fPo.
.
.HP
.BR \-\-poolmetadatasize
-.BR \fIMetadataVolumeSize [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%MetadataVolumeSize
.br
Sets the size of pool's metadata logical volume.
Supported values are in range between 2MiB and 16GiB for thin pool,
@@ -469,7 +487,7 @@ Default is \fBy\fPes.
.
.HP
.BR \-\- [ raid ] maxrecoveryrate
-.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%Rate
.br
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
@@ -478,7 +496,7 @@ recovery rate to 0 means it will be unbounded.
.
.HP
.BR \-\- [ raid ] minrecoveryrate
-.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%Rate
.br
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
@@ -498,7 +516,7 @@ a suitable value automatically.
.
.HP
.BR \-R | \-\-regionsize
-.BR \fIMirrorLogRegionSize [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%MirrorLogRegionSize
.br
A mirror is divided into regions of this size (in MiB), and the mirror log
uses this granularity to track which regions are in sync.
@@ -522,9 +540,7 @@ where the state of the flag is reported within \fBlv_attr\fP bits.
.
.HP
.BR \-L | \-\-size
-.BR \fILogicalVolumeSize [ b | B | s | S | k | K | m | M | \c
-.BR g | G | t | T | p | P | e | E ]
-.\" man2html cannot handle all those changes in 1 line
+.SIZE_E \%LogicalVolumeSize
.br
Gives the size to allocate for the new logical volume.
A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
@@ -533,8 +549,11 @@ A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
or \fBE\fP for exabytes is optional.
.br
Default unit is megabytes.
-.TP
-.IR \fB\-s ", " \fB\-\-snapshot " " OriginalLogicalVolume { Name | Path }
+.
+.HP
+.BR \-s | \fB\-\-snapshot
+.IR OriginalLogicalVolume { Name | Path }
+.br
Creates a snapshot logical volume (or snapshot) for an existing, so called
original logical volume (or origin).
Snapshots provide a 'frozen image' of the contents of the origin
@@ -567,29 +586,35 @@ External origin volume can be used/shared for many thin volumes
even from different thin pools. See
.BR lvconvert (8)
for online conversion to thin volumes with external origin.
-.TP
-.BR \-i ", " \-\-stripes " " \fIStripes
+.
+.HP
+.BR \-i | \-\-stripes
+.IR Stripes
+.br
Gives the number of stripes.
This is equal to the number of physical volumes to scatter
the logical volume. When creating a RAID 4/5/6 logical volume,
the extra devices which are necessary for parity are
-internally accounted for. Specifying
-.BI \-i 3
+internally accounted for. Specifying \fB\-i 3\fP
would use 3 devices for striped logical volumes,
4 devices for RAID 4/5, and 5 devices for RAID 6. Alternatively,
RAID 4/5/6 will stripe across all PVs in the volume group or
-all of the PVs specified if the
-.B \-i
+all of the PVs specified if the \fB\-i\fP
argument is omitted.
-.TP
-.BR \-I ", " \-\-stripesize " " \fIStripeSize
+.
+.HP
+.BR \-I | \-\-stripesize
+.IR StripeSize
+.br
Gives the number of kilobytes for the granularity of the stripes.
.br
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
For metadata in LVM2 format, the stripe size may be a larger
power of 2 but must not exceed the physical extent size.
-.TP
-.IR \fB\-T ", " \fB\-\-thin
+.
+.HP
+.BR \-T | \-\-thin
+.br
Creates thin pool or thin logical volume or both.
Specifying the optional argument \fB\-\-size\fP or \fB\-\-extents\fP
will cause the creation of the thin pool logical volume.
@@ -600,81 +625,93 @@ thin pool and thin volume using this pool.
See \fBlvmthin\fP(7) for more info about thin provisioning support.
Thin provisioning requires device mapper kernel driver
from kernel 3.2 or greater.
-.TP
-.IR \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
+.
+.HP
+.BR \-\-thinpool
+.IR ThinPoolLogicalVolume { Name | Path }
+.br
Specifies the name of thin pool volume name. The other way to specify pool name
is to append name to Volume group name argument.
-.TP
-.B \-\-type \fISegmentType
+.
+.HP
+.BR \-\-type
+.IR SegmentType
+.br
Creates a logical volume with the specified segment type.
Supported types are:
-.IR cache ,
-.IR cache-pool ,
-.IR error ,
-.IR linear ,
-.IR mirror,
-.IR raid1 ,
-.IR raid4 ,
-.IR raid5_la ,
-.IR raid5_ls " (= " raid5 ),
-.IR raid5_ra ,
-.IR raid5_rs ,
-.IR raid6_nc ,
-.IR raid6_nr ,
-.IR raid6_zr " (= " raid6 ) ,
-.IR raid10 ,
-.IR snapshot ,
-.IR striped,
-.IR thin ,
-.IR thin-pool
+.BR cache ,
+.BR cache-pool ,
+.BR error ,
+.BR linear ,
+.BR mirror,
+.BR raid1 ,
+.BR raid4 ,
+.BR raid5_la ,
+.BR raid5_ls
+.RB (=
+.BR raid5 ),
+.BR raid5_ra ,
+.BR raid5_rs ,
+.BR raid6_nc ,
+.BR raid6_nr ,
+.BR raid6_zr
+.RB (=
+.BR raid6 ),
+.BR raid10 ,
+.BR snapshot ,
+.BR striped,
+.BR thin ,
+.BR thin-pool
or
-.IR zero .
+.BR zero .
Segment type may have a commandline switch alias that will
enable its use.
When the type is not explicitly specified an implicit type
is selected from combination of options:
-.BR \-H | \-\-cache | \-\-cachepool " (" \fIcache
-or
-.IR cachepool ),
-.BR \-T | \-\-thin | \-\-thinpool " (" \fIthin
-or
-.IR thinpool ),
-.BR \-m | \-\-mirrors " (" \fIraid1
-or
-.IR mirror ),
-.BR \-s | \-\-snapshot | \-V | \-\-virtualsize " (" \fIsnapshot
-or
-.IR thin ),
-.BR \-i | \-\-stripes " (" \fIstriped ).
-Default type is \fIlinear\fP.
-.TP
-.BR \-V ", " \-\-virtualsize " " \fIVirtualSize [ \fIbBsSkKmMgGtTpPeE ]
+.BR \-H | \-\-cache | \-\-cachepool
+(cache or cachepool),
+.BR \-T | \-\-thin | \-\-thinpool
+(thin or thinpool),
+.BR \-m | \-\-mirrors
+(raid1 or mirror),
+.BR \-s | \-\-snapshot | \-V | \-\-virtualsize
+(snapshot or thin),
+.BR \-i | \-\-stripes
+(striped).
+Default segment type is \fBlinear\fP.
+.
+.HP
+.BR \-V | \-\-virtualsize
+.SIZE_E \%VirtualSize
+.br
Creates a thinly provisioned device or a sparse device of the given size (in MiB by default).
See
.BR lvm.conf (5)
-settings
-.IR global / sparse_segtype_default
+settings \fBglobal/sparse_segtype_default\fP
to configure default sparse segment type.
See \fBlvmthin\fP(7) for more info about thin provisioning support.
Anything written to a sparse snapshot will be returned when reading from it.
Reading from other areas of the device will return blocks of zeros.
-Virtual snapshot is implemented by creating a hidden virtual device of the
-requested size using the zero target. A suffix of _vorigin is used for
-this device. Note: using sparse snapshots is not efficient for larger
+Virtual snapshot (sparse snapshot) is implemented by creating
+a hidden virtual device of the requested size using the zero target.
+A suffix of _vorigin is used for this device.
+Note: using sparse snapshots is not efficient for larger
device sizes (GiB), thin provisioning should be used for this case.
-.TP
-.BR \-W ", " \-\-wipesignatures " {" \fIy | \fIn }
+.
+.HP
+.BR \-W | \-\-wipesignatures
+.RB { y | n }
+.br
Controls wiping of detected signatures on newly created Logical Volume.
If this option is not specified, then by default signature wiping is done
-each time the zeroing (\fB\-Z\fP/\fB\-\-zero\fP) is done. This default behaviour
-can be controlled by
-.IR allocation / wipe_signatures_when_zeroing_new_lvs
+each time the zeroing (
+.BR \-Z | \-\-zero
+) is done. This default behaviour
+can be controlled by \fB\%allocation/wipe_signatures_when_zeroing_new_lvs\fP
setting found in
.BR lvm.conf (5).
.br
-If blkid wiping is used
-.IR allocation / use_blkid_wiping
-setting in
+If blkid wiping is used \fBallocation/use_blkid_wiping\fP setting in
.BR lvm.conf (5))
and LVM2 is compiled with blkid wiping support, then \fBblkid\fP(8) library is used
to detect the signatures (use \fBblkid \-k\fP command to list the signatures that are recognized).
@@ -682,17 +719,21 @@ Otherwise, native LVM2 code is used to detect signatures (MD RAID, swap and LUKS
signatures are detected only in this case).
.br
Logical volume is not wiped if the read only flag is set.
-.TP
-.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
+.
+.HP
+.BR \-Z | \-\-zero
+.RB { y | n }
+.br
Controls zeroing of the first 4KiB of data in the new logical volume.
-Default is \fIy\fPes.
+Default is \fBy\fPes.
Snapshot COW volumes are always zeroed.
Logical volume is not zeroed if the read only flag is set.
-
.br
Warning: trying to mount an unzeroed logical volume can cause the system to
hang.
+.
.SH Examples
+.
Creates a striped logical volume with 3 stripes, a stripe size of 8KiB
and a size of 100MiB in the volume group named vg00.
The logical volume name will be chosen by lvcreate:
@@ -701,8 +742,8 @@ The logical volume name will be chosen by lvcreate:
Creates a mirror logical volume with 2 sides with a useable size of 500 MiB.
This operation would require 3 devices (or option
-.BI \-\-alloc \ anywhere
-) - two for the mirror devices and one for the disk log:
+\fB\-\-alloc \%anywhere\fP) - two for the mirror
+devices and one for the disk log:
.sp
.B lvcreate \-m1 \-L 500M vg00
@@ -794,8 +835,10 @@ volume (i.e. the origin LV), creating a cache LV.
.\" Create a 1G cached LV "lvol1" with 10M cache pool "vg00/pool".
.\" .sp
.\" .B lvcreate \-\-cache \-L 1G \-n lv \-\-pooldatasize 10M vg00/pool
-
+.
.SH SEE ALSO
+.
+.nh
.BR lvm (8),
.BR lvm.conf (5),
.BR lvmcache (7),
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 8ff31ae..31f7187 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -757,6 +757,7 @@ directly.
.
.SH SEE ALSO
.
+.nh
.BR lvm.conf (5),
.BR lvmcache (7),
.BR lvmthin (7),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4b1cadbd87a0814a…
Commit: 4b1cadbd87a0814a46b36b07cfe94eda7baacb28
Parent: 2506275c3b5ec7db8c76ef7fdb07d4f3083a3684
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 5 12:28:00 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:21:36 2015 +0200
man: fsadm
---
man/fsadm.8.in | 95 ++++++++++++++++++++++++++++++++++++-----------------
scripts/fsadm.sh | 4 +-
2 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/man/fsadm.8.in b/man/fsadm.8.in
index 2aecd65..02431c5 100644
--- a/man/fsadm.8.in
+++ b/man/fsadm.8.in
@@ -2,72 +2,105 @@
.SH "NAME"
fsadm \(em utility to resize or check filesystem on a device
.SH SYNOPSIS
+.
+.PD 0
+.ad l
+.HP 5
.B fsadm
.RI [ options ]
-.B check
-.I device
-.sp
+.BR check
+.IR device
+.
+.HP
.B fsadm
.RI [ options ]
-.B resize
-.I device
-.RI [ new_size [ BKMGTEP ]]
-.sp
+.BR resize
+.IR device
+.RI [ new_size ]
+.PD
+.ad b
+.
.SH DESCRIPTION
+.
fsadm utility checks or resizes the filesystem on a device.
-It tries to use the same API for
-.IR ext2 ", " ext3 ", " ext4 ", " ReiserFS " and " XFS
+It tries to use the same API for
+.BR ext2 ,
+.BR ext3 ,
+.BR ext4 ,
+.BR ReiserFS
+.RB and
+.BR XFS
filesystem.
+.
.SH OPTIONS
-.TP
-.BR \-e ", " \-\-ext\-offline
+.
+.HP
+.BR \-e | \-\-ext\-offline
+.br
Unmount ext2/ext3/ext4 filesystem before doing resize.
-.TP
-.BR \-f ", " \-\-force
+.
+.HP
+.BR \-f | \-\-force
+.br
Bypass some sanity checks.
-.TP
-.BR \-h ", " \-\-help
+.
+.HP
+.BR \-h | \-\-help
+.br
Display the help text.
-.TP
-.BR \-n ", " \-\-dry\-run
+.
+.HP
+.BR \-n | \-\-dry\-run
+.br
Print commands without running them.
-.TP
-.BR \-v ", " \-\-verbose
+.
+.HP
+.BR \-v | \-\-verbose
+.br
Be more verbose.
-.TP
-.BR \-y ", " \-\-yes
+.
+.HP
+.BR \-y | \-\-yes
+.br
Answer "yes" at any prompts.
-.TP
-.I new_size
+.
+.HP
+.BR \fInew_size [ B | K | M | G | T | P | E ]
+.br
Absolute number of filesystem blocks to be in the filesystem,
or an absolute size using a suffix (in powers of 1024).
If new_size is not supplied, the whole device is used.
-
+.
.SH DIAGNOSTICS
+.
On successful completion, the status code is 0.
A status code of 2 indicates the operation was interrupted by the user.
A status code of 3 indicates the requested check operation could not be performed
-because the filesystem is mounted and does not support an online
+because the filesystem is mounted and does not support an online
.BR fsck (8).
A status code of 1 is used for other failures.
-
+.
.SH EXAMPLES
-Resize the filesystem on logical volume /dev/vg/test to 1000 megabytes.
-If /dev/vg/test contains ext2/ext3/ext4
+.
+Resize the filesystem on logical volume \fI/dev/vg/test\fP to 1000 megabytes.
+If \fI/dev/vg/test\fP contains ext2/ext3/ext4
filesystem it will be unmounted prior the resize.
All [y/n] questions will be answered 'y'.
.sp
.B fsadm \-e \-y resize /dev/vg/test 1000M
+.
.SH ENVIRONMENT VARIABLES
+.
.TP
-.B TMPDIR
-The temporary directory name for mount points. Defaults to "/tmp".
+.B "TMPDIR "
+The temporary directory name for mount points. Defaults to "\fI/tmp\fP".
.TP
.B DM_DEV_DIR
The device directory name.
-Defaults to "/dev" and must be an absolute path.
+Defaults to "\fI/dev\fP" and must be an absolute path.
.SH SEE ALSO
+.nh
.BR lvm (8),
.BR lvresize (8),
.BR lvm.conf (5),
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index f4ea796..e1aacd8 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -86,10 +86,10 @@ NL='
tool_usage() {
echo "${TOOL}: Utility to resize or check the filesystem on a device"
echo
- echo " ${TOOL} [options] check device"
+ echo " ${TOOL} [options] check <device>"
echo " - Check the filesystem on device using fsck"
echo
- echo " ${TOOL} [options] resize device [new_size[BKMGTPE]]"
+ echo " ${TOOL} [options] resize <device> [<new_size>[BKMGTPE]]"
echo " - Change the size of the filesystem on device to new_size"
echo
echo " Options:"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df59db6048a6be79…
Commit: df59db6048a6be79acf231b98fd560b11cce7c7c
Parent: b33d7586e7f629818e881e26677f4431a47d50b5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 2 15:41:23 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 2 15:41:23 2015 -0500
lockd: add error message for EEXIST
The EEXIST error for LV locks is unusual, and
was missing an explanatory error message.
---
lib/locking/lvmlockd.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index afbafcb..f741940 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2010,6 +2010,15 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
return 0;
}
+ if (result == -EEXIST) {
+ /*
+ * This happens if lvchange tries to modify the LV with an ex
+ * LV lock when the LV is already active with a sh LV lock.
+ */
+ log_error("LV is already locked with incompatible mode: %s/%s", vg->name, lv_name);
+ return 0;
+ }
+
if (result == -EMSGSIZE) {
/* Another host probably extended lvmlock. */
if (!refreshed++) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5e5d48348b0c7afd…
Commit: 5e5d48348b0c7afdd7a3fb56ddd6875a8b81dc68
Parent: 26da6a3e10d2b8a84326288b53c8e9a6d82a3846
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 1 11:39:07 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 1 14:23:39 2015 -0500
man lvmcache: updates for mode and policy
Correct some things, e.g. set mode and policy on
the cache lv, not the pool, lvm.conf field for
mode changed.
Add smq which was missing.
Make the sections on cache mode and cache policy
consistent in structure and style.
---
man/lvmcache.7.in | 74 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 42 insertions(+), 32 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index 7257386..44709d1 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -195,6 +195,7 @@ Users who are concerned about the possibility of failures in their fast
devices that could lead to data loss might consider making their cache
pool sub-LVs redundant.
+.I Example
.nf
0. Create an origin LV we wish to cache
# lvcreate \-L 10G \-n lv1 vg /dev/slow_devs
@@ -228,14 +229,18 @@ from the cache pool back to the origin LV. This mode will increase
performance, but the loss of a device associated with the cache pool LV
can result in lost data.
-The cache mode can be specified with the --cachemode option when a cache
-pool LV is created.
+With the \-\-cachemode option, the cache mode can be set when creating a
+cache LV, or changed on an existing cache LV. The current cache mode of a
+cache LV can be displayed with the cache_mode reporting option:
+
+.B lvs \-o+cache_mode VG/CacheLV
.BR lvm.conf (5)
-.B cache_pool_cachemode
+.B allocation/cache_mode
.br
defines the default cache mode.
+.I Example
.nf
0. Create an origin LV we wish to cache (yours may already exist)
# lvcreate \-L 10G \-n lv1 vg /dev/slow
@@ -246,50 +251,55 @@ defines the default cache mode.
2. Create a cache metadata LV
# lvcreate \-L 8M \-n cache1meta vg /dev/fast
-3. Create a cache pool LV specifying cache mode "writethrough"
-# lvconvert \-\-type cache\-pool \-\-poolmetadata vg/cache1meta \\
- \-\-cachemode writethrough vg/cache1
+3. Create a cache pool LV
+# lvconvert \-\-type cache\-pool \-\-poolmetadata vg/cache1meta vg/cache1
-4. Create a cache LV by combining the cache pool LV and origin LV
-# lvconvert \-\-type cache \-\-cachepool vg/cache1 vg/lv1
+4. Create a cache LV by combining the cache pool LV and origin LV,
+ and use the writethrough cache mode.
+# lvconvert \-\-type cache \-\-cachepool vg/cache1 \\
+ \-\-cachemode writethrough vg/lv1
.fi
-The cache mode can be changed on an existing LV with the command:
-.B lvconvert --cachemode writethrough|writeback VG/CacheLV
+.SS Cache policy
+\&
-.SS Cache policy & policy settings
+The cache subsystem has additional per-LV parameters: the cache policy to
+use, and possibly tunable parameters for the cache policy. Three policies
+are currently available: "smq" is the default policy, "mq" is an older
+implementation, and "cleaner" is used to force the cache to write back
+(flush) all cached writes to the origin LV.
-\&
+The "mq" policy has a number of tunable parameters. The defaults are
+chosen to be suitable for the majority of systems, but in special
+circumstances, changing the settings can improve performance.
-The cache subsystem has an additional per-LV parameter, namely the cache policy
-to use, and possibly the tunable parameters of the said cache policy. In the
-current implementation, two policies are available, "mq" which is the default
-policy and "cleaner" which is used to force the cache to write back (flush) all
-cached writes to the origin LV. Moreover, the "mq" policy has a number of
-tunable parameters: the defaults are chosen to be suitable for the vast
-majority of systems. However, under special circumstances, changing the tunable
-settings of the cache policy can improve performance.
+With the \-\-cachepolicy and \-\-cachesettings options, the cache policy
+and settings can be set when creating a cache LV, or changed on an
+existing cache LV (both options can be used together). The current cache
+policy and settings of a cache LV can be displayed with the cache_policy
+and cache_settings reporting options:
-On an existing cache LV, the policy can be set (to "mq") and the cache settings
-can be changed using commands like these:
+.B lvs \-o+cache_policy,cache_settings VG/CacheLV
.I Example
-
.nf
-# lvchange \-\-cachepolicy mq vg/lv1
-# lvchange \-\-cachesettings \(aqmigration_threshold=2048 random_threshold=4\(aq \\
- vg/lv1
+Change the cache policy and settings of an existing cache LV.
+# lvchange \-\-cachepolicy mq \-\-cachesettings \\
+ \(aqmigration_threshold=2048 random_threshold=4\(aq vg/lv1
.fi
-Both commands can be combined, setting both cache policy and its settings
-together. Moreover, when creating a cache LV for the first time (using
-lvcreate), the \-\-cachepolicy and \-\-cachesettings parameters can be used as
-well. The current policy and the policy settings can be listed using the lvs
-command, using 'cache_policy' and 'cache_settings' fields:
+.BR lvm.conf (5)
+.B allocation/cache_policy
+.br
+defines the default cache policy.
+
+.BR lvm.conf (5)
+.B allocation/cache_settings
+.br
+defines the default cache settings.
-# lvs -o +cache_policy,cache_settings
.SS Spare metadata LV
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=796e3fb7e4dc9d99…
Commit: 796e3fb7e4dc9d996316b0fcc4ed09a2cc800ade
Parent: 867a36b4197e2abe6efd3b16e229590eedc566a3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 11:28:54 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 1 15:03:34 2015 +0200
man: update lvm pages
---
man/clvmd.8.in | 141 +++++++----
man/lvchange.8.in | 344 ++++++++++++++++----------
man/lvcreate.8.in | 418 ++++++++++++++++++------------
man/lvm.8.in | 734 +++++++++++++++++++++++++++++++++--------------------
4 files changed, 1017 insertions(+), 620 deletions(-)
diff --git a/man/clvmd.8.in b/man/clvmd.8.in
index 90de980..9b9310d 100644
--- a/man/clvmd.8.in
+++ b/man/clvmd.8.in
@@ -1,125 +1,159 @@
.TH CLVMD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
+.
.SH NAME
+.
clvmd \(em cluster LVM daemon
+.
.SH SYNOPSIS
+.
+.ad l
.B clvmd
.RB [ \-C ]
.RB [ \-d
.RI [ value ]]
.RB [ \-E
-.IR "lock uuid" ]
+.IR lock_uuid ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-I
-.IR "cluster manager" ]
+.IR cluster_manager ]
.RB [ \-R ]
.RB [ \-S ]
.RB [ \-t
.IR timeout ]
.RB [ \-T
-.IR "start timeout" ]
+.IR start_timeout ]
.RB [ \-V ]
+.ad b
+.
.SH DESCRIPTION
+.
clvmd is the daemon that distributes LVM metadata updates around a cluster.
It must be running on all nodes in the cluster and will give an error
if a node in the cluster does not have this daemon running.
+.
.SH OPTIONS
-.TP
-.BR \-d \ [ \fIvalue ]
+.
+.HP
+.BR \-C
+.br
+Only valid if \fB\-d\fP is also specified.
+Tells all clvmds in a cluster to enable/disable debug logging.
+Without this switch, only the local clvmd will change its debug level to that
+given with \fB\-d\fP.
+.br
+This does not work correctly if specified on the command-line that starts clvmd.
+If you want to start clvmd \fBand\fP
+enable cluster-wide logging then the command needs to be issued twice, eg:
+.br
+.BR clvmd
+.br
+.BR clvmd\ \-d2
+.
+.HP
+.BR \-d
+.RI [ value ]
+.br
Set debug logging level.
If \fB\-d\fP is specified without a \fIvalue\fP
then 1 is assumed. \fIValue\fP can be:
.PD 0
.IP
-.B 0
+.BR 0
\(em Disabled
.IP
-.B 1
+.BR 1
\(em Sends debug logs to stderr (implies \fB\-f\fP)
.IP
-.B 2
+.BR 2
\(em Sends debug logs to \fBsyslog\fP(3)
.PD
-.TP
-.B \-C
-Only valid if
-.B \-d
-is also specified. Tells all clvmds in a cluster to enable/disable debug logging.
-Without this switch, only the local clvmd will change its debug level to that
-given with
-.B \-d
.
+.HP
+.BR \-E
+.IR lock_uuid
.br
-This does not work correctly if specified on the command-line that starts clvmd.
-If you want to start clvmd
-.B and
-enable cluster-wide logging then the command needs to be issued twice, eg:
-.br
-.B clvmd
-.br
-.B clvmd \-d2
+Pass lock uuid to be reacquired exclusively when clvmd is restarted.
+.
+.HP
+.BR \-f
.br
-.TP
-.BR \-E "\fI lock uuid"
-Pass \fIlock uuid\fP to be reacquired exclusively when clvmd is restarted.
-.TP
-.B \-f
Don't fork, run in the foreground.
-.TP
-.B \-h
+.
+.HP
+.BR \-h
+.br
Show help information.
-.TP
-.BR \-I "\fI cluster manager"
-Selects the \fIcluster manager\fP to use for locking and internal
+.
+.HP
+.BR \-I
+.IR cluster_manager
+.br
+Selects the cluster manager to use for locking and internal
communications. As it is quite possible to have multiple managers available on
the same system you might have to manually specify this option to override the
search.
-By default, omit \fB-I\fP is equivalent to \fB\-Iauto\fP. \fBClvmd\fP
-will use the first cluster manager that succeeds, and it checks them in a
-predefined order cman,corosync,openais.
+By default, omit \fB-I\fP is equivalent to \fB\-Iauto\fP.
+Clvmd will use the first cluster manager that succeeds,
+and it checks them in a predefined order
+.BR cman ,
+.BR corosync ,
+.BR openais .
The available managers will be listed by order as part of the
\fBclvmd \-h\fP output.
-.TP
-.B \-R
+.
+.HP
+.BR \-R
+.br
Tells all the running instance of \fBclvmd\fP in the cluster to reload their device cache and
re-read the lvm configuration file \fBlvm.conf\fP(5). This command should be run whenever the
devices on a cluster system are changed.
-.TP
-.B \-S
+.
+.HP
+.BR \-S
+.br
Tells the running \fBclvmd\fP to exit and reexecute itself, for example at the
end of a package upgrade. The new instance is instructed to reacquire
any locks in the same state as they were previously held. (Alternative
methods of restarting the daemon have the side effect of changing
exclusive LV locks into shared locks.)
-.TP
-.BR \-t "\fI timeout"
+.
+.HP
+.BR \-t
+.IR timeout
+.br
Specifies the \fItimeout\fP for commands to run around the cluster. This should not
be so small that commands with many disk updates to do will fail, so you
may need to increase this on systems with very large disk farms.
The default is 60 seconds.
-.TP
-.BR \-T "\fI start timeout"
-Specifies the \fIstart timeout\fP for \fBclvmd\fP daemon startup. If the
+.
+.HP
+.BR \-T
+.IR start_timeout
+.br
+Specifies the start timeout for \fBclvmd\fP daemon startup. If the
daemon does not report that it has started up within this time then the parent
command will exit with status of 5. This does NOT mean that \fBclvmd\fP has
not started! What it means is that the startup has been delayed for some
reason; the most likely cause of this is an inquorate cluster though it
could be due to locking latencies on a cluster with large numbers of logical
volumes. If you get the return code of 5 it is usually not necessary to
-restart \fBclvmd\fP — it will start as soon as that blockage has cleared.
+restart \fBclvmd\fP it will start as soon as that blockage has cleared.
This flag is to allow startup scripts to exit in a timely fashion even if the
cluster is stalled for some reason.
-The default is 0 (no timeout) and the value is in seconds. Don't set this too
+The default is \fB0\fP (no timeout) and the value is in seconds. Don't set this too
small or you will experience spurious errors. 10 or 20 seconds might be
sensible.
This timeout will be ignored if you start \fBclvmd\fP with the \fB\-d\fP.
-.TP
-.B \-V
+.
+.HP
+.BR \-V
+.br
Display the version of the cluster LVM daemon.
-
+.
.SH ENVIRONMENT VARIABLES
.TP
.B LVM_CLVMD_BINARY
@@ -129,7 +163,10 @@ Defaults to \fI#CLVMD_PATH#\fP.
.B LVM_BINARY
The LVM2 binary to use.
Defaults to \fI#LVM_PATH#\fP.
-
+.SH FILES
+.I #CLVMD_PATH#
+.br
+.I #LVM_PATH#
.SH SEE ALSO
.BR syslog (3),
.BR lvm.conf (5),
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index e8babba..62bdca1 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -1,21 +1,30 @@
.TH LVCHANGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
+
+.de UNITS
+..
+
+.
.SH NAME
+.
lvchange \(em change attributes of a logical volume
+.
.SH SYNOPSIS
+.
+.ad l
.B lvchange
-.RB [ \-\-addtag
-.IR Tag ]
-.RB [ \-A | \-\-autobackup
-.RB { y | n }]
.RB [ \-a | \-\-activate
.RB [ a ][ e | s | l ]{ y | n }]
.RB [ \-\-activationmode
.RB { complete | degraded | partial }]
+.RB [ \-\-addtag
+.IR Tag ]
+.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-k | \-\-setactivationskip
.RB { y | n }]
-.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-\-alloc
.IR AllocationPolicy ]
+.RB [ \-A | \-\-autobackup
+.RB { y | n }]
.RB [ \-\-cachepolicy
.IR policy ]
.RB [ \-\-cachesettings
@@ -33,13 +42,24 @@ lvchange \(em change attributes of a logical volume
.RB { ignore | nopassdown | passdown }]
.RB [ \-\-errorwhenfull
.RB { y | n }]
-.RB [ \-\-resync ]
.RB [ \-h | \-? | \-\-help ]
-.RB [ \-\-ignorelockingfailure ]
-.RB [ \-\-ignoremonitoring ]
-.RB [ \-\-ignoreskippedcluster ]
+.RB \%[ \-\-ignorelockingfailure ]
+.RB \%[ \-\-ignoremonitoring ]
+.RB \%[ \-\-ignoreskippedcluster ]
+.RB \%[ \-\-metadataprofile
+.IR ProfileName ]
.RB [ \-\-monitor
.RB { y | n }]
+.RB [ \-\-noudevsync ]
+.RB [ \-P | \-\-partial ]
+.RB [ \-p | \-\-permission
+.RB { r | rw }]
+.RB [ \-M | \-\-persistent
+.RB { y | n }
+.RB [ \-\-major
+.IR major ]
+.RB [ \-\-minor
+.IR minor ]]
.RB [ \-\-poll
.RB { y | n }]
.RB [ \-\- [ raid ] maxrecoveryrate
@@ -52,41 +72,38 @@ lvchange \(em change attributes of a logical volume
.IR IOCount ]
.RB [ \-\- [ raid ] writemostly
.BR \fIPhysicalVolume [ : { y | n | t }]]
-.RB [ \-\-sysinit ]
-.RB [ \-\-noudevsync ]
-.RB [ \-\-metadataprofile
-.IR ProfileName ]
-.RB [ \-M | \-\-persistent
-.RB { y | n }
-.RB [ \-\-minor
-.IR minor ]
-.RB [ \-\-major
-.IR major ]]
-.RB [ \-P | \-\-partial ]
-.RB [ \-p | \-\-permission
-.RB { r | rw }]
.RB [ \-r | \-\-readahead
.RB { \fIReadAheadSectors | auto | none }]
.RB [ \-\-refresh ]
+.RB [ \-\-resync ]
.RB [ \-S | \-\-select
.IR Selection ]
+.RB [ \-\-sysinit ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
.RB [ \-Z | \-\-zero
.RB { y | n }]
.RI [ LogicalVolumePath ...]
+.ad b
+.
.SH DESCRIPTION
+.
lvchange allows you to change the attributes of a logical volume
including making them known to the kernel ready for use.
+.
.SH OPTIONS
+.
See \fBlvm\fP(8) for common options.
-.TP
-.BR \-a ", " \-\-activate " [" a ][ e | s | l ]{ y | n }
+.
+.HP
+.BR \-a | \-\-activate
+.RB [ a ][ e | s | l ]{ y | n }
+.br
Controls the availability of the logical volumes for use.
Communicates with the kernel device-mapper driver via
libdevmapper to activate (\fB\-ay\fP) or deactivate (\fB\-an\fP) the
logical volumes.
-.IP
+.br
Activation of a logical volume creates a symbolic link
\fI/dev/VolumeGroupName/LogicalVolumeName\fP pointing to the device node.
This link is removed on deactivation.
@@ -95,19 +112,16 @@ this symbolic link and present this as the name of the device.
The location and name of the underlying device node may depend on
the distribution and configuration (e.g. udev) and might change
from release to release.
-.IP
+.br
If autoactivation option is used (\fB\-aay\fP),
the logical volume is activated only if it matches an item in
-the
-.B activation/auto_activation_volume_list
+the \fBactivation/auto_activation_volume_list\fP
set in \fBlvm.conf\fP(5).
If this list is not set, then all volumes are considered for
activation. The \fB\-aay\fP option should be also used during system
boot so it's possible to select which volumes to activate using
-the
-.B activation/auto_activation_volume_list
-setting.
-.IP
+the \fBactivation/auto_activation_volume_list\fP setting.
+.br
In a clustered VG, clvmd is used for activation, and the
following options are possible:
@@ -137,9 +151,11 @@ LVs with snapshots are always activated exclusively because they can only
be used on one node at once.
For local VGs \fB\-ay\fP, \fB\-aey\fP, and \fB\-asy\fP are all equivalent.
-
-.TP
-.BR \-\-activationmode " {" complete | degraded | partial }
+.
+.HP
+.BR \-\-activationmode
+.RB { complete | degraded | partial }
+.br
The activation mode determines whether logical volumes are allowed to
activate when there are physical volumes missing (e.g. due to a device
failure). \fBcomplete\fP is the most restrictive; allowing only those
@@ -150,106 +166,168 @@ considered a RAID logical volume. The "\fIraid1\fP" segment type should
be used instead.) Finally, \fBpartial\fP allows any logical volume to
be activated even if portions are missing due to a missing or failed
PV. This last option should only be used when performing recovery or
-repair operations. \fBdegraded\fP is the default mode. To change it, modify
-.B activation_mode
-in
-.BR lvm.conf (5).
-.TP
-.BR \-k ", " \-\-setactivationskip " {" y | n }
+repair operations. \fBdegraded\fP is the default mode. To change it,
+modify \fBactivation_mode\fP in \fBlvm.conf\fP(5).
+.
+.HP
+.BR \-K | \-\-ignoreactivationskip
+.br
+Ignore the flag to skip Logical Volumes during activation.
+.
+.HP
+.BR \-k | \-\-setactivationskip
+.RB { y | n }
+.br
Controls whether Logical Volumes are persistently flagged to be
skipped during activation. By default, thin snapshot volumes are
flagged for activation skip. To activate such volumes,
-an extra
-.BR \-K / \-\-ignoreactivationskip
-option must be used.
+an extra \fB\-\-ignoreactivationskip\fP option must be used.
The flag is not applied during deactivation. To see whether
the flag is attached, use \fBlvs\fP(8) command where the state
of the flag is reported within \fBlv_attr\fP bits.
-.TP
-.BR \-K ", " \-\-ignoreactivationskip
-Ignore the flag to skip Logical Volumes during activation.
-.TP
-.BR \-\-cachepolicy " " \fIpolicy ", " \-\-cachesettings " " \fIkey = \fIvalue
+.
+.HP
+.BR \-\-cachepolicy
+.IR policy ,
+.BR \-\-cachesettings
+.IR key \fB= value
+.br
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
the cache policy and its associated tunable settings. In most use-cases,
default values should be adequate.
-.TP
-.BR \-C ", " \-\-contiguous " {" y | n }
+.
+.HP
+.BR \-C | \-\-contiguous
+.RB { y | n }
+.br
Tries to set or reset the contiguous allocation policy for
logical volumes. It's only possible to change a non-contiguous
logical volume's allocation policy to contiguous, if all of the
allocated physical extents are already contiguous.
-.TP
+.
+.HP
.BR \-\-detachprofile
+.br
Detach any metadata configuration profiles attached to given
Logical Volumes. See \fBlvm.conf\fP(5) for more information
about metadata profiles.
-.TP
-.BR \-\-discards " {" ignore | nopassdown | passdown }
+.
+.HP
+.BR \-\-discards
+.RB { ignore | nopassdown | passdown }
+.br
Set this to \fBignore\fP to ignore any discards received by a
thin pool Logical Volume. Set to \fBnopassdown\fP to process such
discards within the thin pool itself and allow the no-longer-needed
extents to be overwritten by new data. Set to \fBpassdown\fP (the
default) to process them both within the thin pool itself and to
pass them down the underlying device.
-.TP
-.BR \-\-errorwhenfull " {" y | n }
+.
+.HP
+.BR \-\-errorwhenfull
+.RB { y | n }
+.br
Sets thin pool behavior when data space is exhaused. See
.BR lvcreate (8)
for information.
-.TP
-.B \-\-resync
-Forces the complete resynchronization of a mirror. In normal
-circumstances you should not need this option because synchronization
-happens automatically. Data is read from the primary mirror device
-and copied to the others, so this can take a considerable amount of
-time - and during this time you are without a complete redundant copy
-of your data.
-.TP
-.B \-\-metadataprofile " " \fIProfileName
+.
+.HP
+.BR \-\-ignoremonitoring
+.br
+Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
+is specified.
+Do not use this if dmeventd is already monitoring a device.
+.
+.HP
+.BR \-\-major
+.IR major
+.br
+Sets the major number. This option is supported only on older systems
+(kernel version 2.4) and is ignored on modern Linux systems where major
+numbers are dynamically assigned.
+.
+.HP
+.BR \-\-minor
+.IR minor
+.br
+Set the minor number.
+.
+.HP
+.BR \-\-metadataprofile
+.IR ProfileName
+.br
Uses and attaches \fIProfileName\fP configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
profile attached, the logical volume profile is preferred.
See \fBlvm.conf\fP(5) for more information about metadata profiles.
-.TP
-.B \-\-minor \fIminor
-Set the minor number.
-.TP
-.B \-\-major \fImajor
-Sets the major number. This option is supported only on older systems
-(kernel version 2.4) and is ignored on modern Linux systems where major
-numbers are dynamically assigned.
-.TP
-.BR \-\-monitor " {" y | n }
+.
+.HP
+.BR \-\-monitor
+.RB { y | n }
+.br
Start or stop monitoring a mirrored or snapshot logical volume with
dmeventd, if it is installed.
If a device used by a monitored mirror reports an I/O error,
the failure is handled according to
-\fBmirror_image_fault_policy\fP and \fBmirror_log_fault_policy\fP
+\%\fBmirror_image_fault_policy\fP and \fBmirror_log_fault_policy\fP
set in \fBlvm.conf\fP(5).
-.TP
-.BR \-\-poll " {" y | n }
+.
+.HP
+.BR \-\-noudevsync
+.br
+Disable udev synchronisation. The
+process will not wait for notification from udev.
+It will continue irrespective of any possible udev processing
+in the background. You should only use this if udev is not running
+or has rules that ignore the devices LVM2 creates.
+.
+.HP
+.BR \-p | \-\-permission
+.RB { r | rw }
+.br
+Change access permission to read-only or read/write.
+.
+.HP
+.BR \-M | \-\-persistent
+.RB { y | n }
+.br
+Set to \fBy\fP to make the minor number specified persistent.
+Change of persistent numbers is not supported for pool volumes.
+.
+.HP
+.BR \-\-poll
+.RB { y | n }
+.br
Without polling a logical volume's backgrounded transformation process
will never complete. If there is an incomplete pvmove or lvconvert (for
example, on rebooting after a crash), use \fB\-\-poll y\fP to restart the
process from its last checkpoint. However, it may not be appropriate to
immediately poll a logical volume when it is activated, use
\fB\-\-poll n\fP to defer and then \fB\-\-poll y\fP to restart the process.
-.TP
-.BR \-\- [ raid ] maxrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.
+.HP
+.BR \-\- [ raid ] maxrecoveryrate
+.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.br
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
If no suffix is given, then KiB/sec/device is assumed. Setting the
recovery rate to \fB0\fP means it will be unbounded.
-.TP
-.BR \-\- [ raid ] minrecoveryrate " " \fIRate [ bBsSkKmMgG ]
+.
+.HP
+.BR \-\- [ raid ] minrecoveryrate
+.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.br
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
If no suffix is given, then KiB/sec/device is assumed. Setting the
recovery rate to \fB0\fP means it will be unbounded.
-.TP
-.BR \-\- [ raid ] syncaction " {" check | repair }
+.
+.HP
+.BR \-\- [ raid ] syncaction
+.RB { check | repair }
+.br
This argument is used to initiate various RAID synchronization operations.
The \fBcheck\fP and \fBrepair\fP options provide a way to check the
integrity of a RAID logical volume (often referred to as "scrubbing").
@@ -260,16 +338,22 @@ If \fBcheck\fP is used, the discrepancies will be counted but not repaired.
If \fBrepair\fP is used, the discrepancies will be corrected as they are
encountered. The \fBlvs\fP(8) command can be used to show the number of
discrepancies found or repaired.
-.TP
-.BR \-\- [ raid ] writebehind " " \fIIOCount
+.
+.HP
+.BR \-\- [ raid ] writebehind
+.IR IOCount
+.br
Specify the maximum number of outstanding writes that are allowed to
devices in a RAID1 logical volume that are marked as write-mostly.
Once this value is exceeded, writes become synchronous (i.e. all writes
to the constituent devices must complete before the array signals the
write has completed). Setting the value to zero clears the preference
and allows the system to choose the value arbitrarily.
-.TP
-.BR \-\- [ raid ] writemostly " " \fIPhysicalVolume [ : { y | n | t }]
+.
+.HP
+.BR \-\- [ raid ] writemostly
+.BR \fIPhysicalVolume [ : { y | n | t }]
+.br
Mark a device in a RAID1 logical volume as write-mostly. All reads
to these drives will be avoided unless absolutely necessary. This keeps
the number of I/Os to the drive to a minimum. The default behavior is to
@@ -279,8 +363,39 @@ appending a "\fB:n\fP" to the physical volume or to toggle the value by specifyi
"\fB:t\fP". The \fB\-\-writemostly\fP argument can be specified more than one time
in a single command; making it possible to toggle the write-mostly attributes
for all the physical volumes in a logical volume at once.
-.TP
-.B \-\-sysinit
+.
+.HP
+.BR \-r | \-\-readahead
+.RB { \fIReadAheadSectors | auto | none }
+.br
+Set read ahead sector count of this logical volume.
+For volume groups with metadata in lvm1 format, this must
+be a value between 2 and 120 sectors.
+The default value is "\fBauto\fP" which allows the kernel to choose
+a suitable value automatically.
+"\fBnone\fP" is equivalent to specifying zero.
+.
+.HP
+.BR \-\-refresh
+.br
+If the logical volume is active, reload its metadata.
+This is not necessary in normal operation, but may be useful
+if something has gone wrong or if you're doing clustering
+manually without a clustered lock manager.
+.
+.HP
+.BR \-\-resync
+.br
+Forces the complete resynchronization of a mirror. In normal
+circumstances you should not need this option because synchronization
+happens automatically. Data is read from the primary mirror device
+and copied to the others, so this can take a considerable amount of
+time - and during this time you are without a complete redundant copy
+of your data.
+.
+.HP
+.BR \-\-sysinit
+.br
Indicates that \fBlvchange\fP(8) is being invoked from early system
initialisation scripts (e.g. rc.sysinit or an initrd),
before writeable filesystems are available. As such,
@@ -295,51 +410,24 @@ If \fB\-\-sysinit\fP is used in conjunction with
\fBlvmetad\fP(8) enabled and running,
autoactivation is preferred over manual activation via direct lvchange call.
Logical volumes are autoactivated according to
-.B auto_activation_volume_list
-set in \fBlvm.conf\fP(5).
-.TP
-.B \-\-noudevsync
-Disable udev synchronisation. The
-process will not wait for notification from udev.
-It will continue irrespective of any possible udev processing
-in the background. You should only use this if udev is not running
-or has rules that ignore the devices LVM2 creates.
-.TP
-.B \-\-ignoremonitoring
-Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
-is specified.
-Do not use this if dmeventd is already monitoring a device.
-.TP
-.BR \-M ", " \-\-persistent " {" y | n }
-Set to \fBy\fP to make the minor number specified persistent.
-Change of persistent numbers is not supported for pool volumes.
-.TP
-.BR \-p ", " \-\-permission " {" r | rw }
-Change access permission to read-only or read/write.
-.TP
-.BR \-r ", " \-\-readahead " {" \fIReadAheadSectors | auto | none }
-Set read ahead sector count of this logical volume.
-For volume groups with metadata in lvm1 format, this must
-be a value between 2 and 120 sectors.
-The default value is "\fBauto\fP" which allows the kernel to choose
-a suitable value automatically.
-"\fBnone\fP" is equivalent to specifying zero.
-.TP
-.B \-\-refresh
-If the logical volume is active, reload its metadata.
-This is not necessary in normal operation, but may be useful
-if something has gone wrong or if you're doing clustering
-manually without a clustered lock manager.
-.TP
-.BR \-Z ", " \-\-zero " {" y | n }
+\fB auto_activation_volume_list\fP set in \fBlvm.conf\fP(5).
+.
+.HP
+.BR \-Z | \-\-zero
+.RB { y | n }
+.br
Set zeroing mode for thin pool. Note: already provisioned blocks from pool
in non-zero mode are not cleared in unwritten parts when setting zero to
\fBy\fP.
+.
.SH ENVIRONMENT VARIABLES
+.
.TP
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Suppress locking failure messages.
+.
.SH Examples
+.
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
.sp
.B lvchange \-pr vg00/lvol1
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index ee10392..8a364c4 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -2,40 +2,41 @@
.SH NAME
lvcreate \- create a logical volume in an existing volume group
.SH SYNOPSIS
+.ad l
.B lvcreate
.RB [ \-a | \-\-activate
-.RI [ a | e | l ]{ y | n }]
+.RB [ a ][ e | l | s ]{ y | n }]
.RB [ \-\-addtag
.IR Tag ]
.RB [ \-\-alloc
-.IR AllocationPolicy ]
+.IR Allocation\%Policy ]
.RB [ \-A | \-\-autobackup
-.RI { y | n }]
+.RB { y | n }]
.RB [ \-H | \-\-cache ]
.RB [ \-\-cachemode
-.RI { passthrough | writeback | writethrough }]
+.RB { passthrough | writeback | writethrough }]
.RB [ \-\-cachepolicy
.IR policy ]
.RB [ \-\-cachepool
-.IR CachePoolLogicalVolume { Name | Path }
+.IR CachePoolLogicalVolume ]
.RB [ \-\-cachesettings
-.IR key=value ]
+.IR key \fB= value ]
.RB [ \-c | \-\-chunksize
-.IR ChunkSize [ bBsSkKmMgG ]]
+.IR ChunkSize ]
.RB [ \-\-commandprofile
.IR ProfileName ]
.RB [ \-C | \-\-contiguous
-.RI { y | n }]
+.RB { y | n }]
.RB [ \-d | \-\-debug ]
.RB [ \-\-discards
-.RI { ignore | nopassdown | passdown }]
+.RB \%{ ignore | nopassdown | passdown }]
.RB [ \-\-errorwhenfull
-.RI { y | n }]
+.RB { y | n }]
.RB [{ \-l | \-\-extents
-.IR LogicalExtentsNumber [ % { FREE | PVS | VG }]
-|
+.BR \fILogicalExtents\%Number [ % { FREE | PVS | VG }]
+.RB |
.BR \-L | \-\-size
-.IR LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]}
+.BR \fILogicalVolumeSize }
.RB [ \-i | \-\-stripes
.IR Stripes
.RB [ \-I | \-\-stripesize
@@ -48,86 +49,79 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-j | \-\-major
.IR major ]]
.RB [ \-\-metadataprofile
-.IR ProfileName ]
+.IR Profile\%Name ]
.RB [ \-m | \-\-mirrors
.IR Mirrors
-.RB [{ \-\-corelog
-|
-.B \-\-mirrorlog
-.RI { disk | core | mirrored }}]
+.RB [ \-\-corelog | \-\-mirrorlog
+.RB { disk | core | mirrored }]
.RB [ \-\-nosync ]
.RB [ \-R | \-\-regionsize
-.IR MirrorLogRegionSize [ bBsSkKmMgG ]]]
+.BR \fIMirrorLogRegionSize ]]
.RB [ \-\-monitor
-.RI { y | n }]
+.RB { y | n }]
.RB [ \-n | \-\-name
-.IR LogicalVolume { Name | Path }]
+.IR Logical\%Volume ]
.RB [ \-\-noudevsync ]
.RB [ \-p | \-\-permission
-.RI { r | rw }]
+.RB { r | rw }]
.RB [ \-M | \-\-persistent
-.RI { y | n }]
+.RB { y | n }]
.\" .RB [ \-\-pooldatasize
-.\" .IR DataVolumeSize [ bBsSkKmMgGtTpPeE ]]
-.RB [ \-\-poolmetadatasize
-.IR MetadataVolumeSize [ bBsSkKmMgG ]]
+.\" .I DataVolumeSize
+.RB \%[ \-\-poolmetadatasize
+.IR MetadataVolumeSize ]
.RB [ \-\-poolmetadataspare
-.RI { y | n }]
+.RB { y | n }]
.RB [ \-\- [ raid ] maxrecoveryrate
.IR Rate ]
.RB [ \-\- [ raid ] minrecoveryrate
.IR Rate ]
.RB [ \-r | \-\-readahead
-.RI { ReadAheadSectors | auto | none }]
+.RB { \fIReadAheadSectors | auto | none }]
.RB [ \-k | \-\-setactivationskip
-.RI { y | n }]
-.RB [ \-s | \-\-snapshot
+.RB { y | n }]
+.RB [ \-s | \-\-snapshot ]
.RB [ \-V | \-\-virtualsize
-.IR VirtualSize [ bBsSkKmMgGtTpPeE ]]
+.IR VirtualSize ]
.RB [ \-t | \-\-test ]
.RB [ \-T | \-\-thin ]
.RB [ \-\-thinpool
-.IR ThinPoolLogicalVolume { Name | Path }]
+.IR ThinPoolLogicalVolume ]
.RB [ \-\-type
.IR SegmentType ]
.RB [ \-v | \-\-verbose ]
.RB [ \-W | \-\-wipesignatures
-.RI { y | n }]
+.RB { y | n }]
.RB [ \-Z | \-\-zero
-.RI { y | n }]
-.RI [ VolumeGroup { Name | Path }
-.RI [/\{ ExternalOrigin
-|
-.I Origin
-|
+.RB { y | n }]
+.RI [ VolumeGroup [ \fB/ { ExternalOrigin |\: Origin |
.IR Pool } LogicalVolumeName ]
-.RI [ PhysicalVolumePath [ :PE [ \-PE ]]...]
-
+.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.LP
.B lvcreate
.RB [ \-l | \-\-extents
-.IR LogicalExtentsNumber [ % { FREE | ORIGIN | PVS | VG }]
+.BR \fILogicalExtentsNumber [ % { FREE | ORIGIN | PVS | VG }]
|
.BR \-L | \-\-size
.\" | \-\-pooldatasize
-.IR LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]]
+.IR LogicalVolumeSize ]
.RB [ \-c | \-\-chunksize
-.IR ChunkSize [ bBsSkKmMgG ]]
+.IR ChunkSize ]
.RB [ \-\-commandprofile
-.IR Profilename ]
+.IR Profile\%Name ]
.RB [ \-\-noudevsync ]
.RB [ \-\-ignoremonitoring ]
-.RB [ \-\-metadataProfile
-.IR ProfileName ]
-.RB [ \-\-monitor
-.RI { y | n }]
+.RB [ \-\-metadataprofile
+.IR Profile\%Name ]
+.RB \%[ \-\-monitor
+.RB { y | n }]
.RB [ \-n | \-\-name
-.IR SnapshotLogicalVolume { Name | Path }]
+.IR SnapshotLogicalVolume ]
.BR \-s | \-\-snapshot | \-H | \-\-cache
-.RI {[ VolumeGroup { Name | Path }/] OriginalLogicalVolumeName
+.RI \%{[ VolumeGroup \fB/ ] OriginalLogicalVolume
.BR \-V | \-\-virtualsize
-.IR VirtualSize [ bBsSkKmMgGtTpPeE ]}
-.br
-
+.IR VirtualSize }
+.ad b
.SH DESCRIPTION
lvcreate creates a new logical volume in a volume group (see
.BR vgcreate "(8), " vgchange (8))
@@ -144,12 +138,17 @@ extents will be restricted to these volumes.
.br
The second form supports the creation of snapshot logical volumes which
keep the contents of the original logical volume for backup purposes.
+.
.SH OPTIONS
+.
See
.BR lvm (8)
for common options.
-.TP
-.IR \fB\-a ", " \fB\-\-activate " {" y | ay | n | ey | en | ly | ln }
+.
+.HP
+.BR \-a | \-\-activate
+.RB [ a ][ l | e | s ]{ y | n }
+.br
Controls the availability of the Logical Volumes for immediate use after
the command finishes running.
By default, new Logical Volumes are activated (\fB\-a\fIy\fR).
@@ -171,8 +170,10 @@ be overridden. If the clustered locking is enabled,
\fB\-a\fIey\fR will activate exclusively on one node and
.IR \fB\-a { a | l } y
will activate only on the local node.
-.TP
-.IR \fB\-H ", " \fB\-\-cache
+.
+.HP
+.BR \-H | \-\-cache
+.br
Creates cache or cache pool logical volume or both.
Specifying the optional argument \fB\-\-size\fP will cause the creation of
the cache logical volume.
@@ -187,33 +188,49 @@ the \fB\-\-size\fP is used to specify size of cache pool volume.
See \fBlvmcache\fP(7) for more info about caching support.
Note that the cache segment type requires a dm-cache kernel module version
1.3.0 or greater.
-.TP
-.IR \fB\-\-cachemode " {" passthrough | writeback | writethrough }
+.
+.HP
+.BR \-\-cachemode
+.RB { passthrough | writeback | writethrough }
+.br
Specifying a cache mode determines when the writes to a cache LV
-are considered complete. When \fIwriteback\fP is specified, a write is
+are considered complete. When \fBwriteback\fP is specified, a write is
considered complete as soon as it is stored in the cache pool LV.
-If \fIwritethough\fP is specified, a write is considered complete only
+If \fBwritethough\fP is specified, a write is considered complete only
when it has been stored in the cache pool LV and on the origin LV.
-While \fIwritethrough\fP may be slower for writes, it is more
+While \fBwritethrough\fP may be slower for writes, it is more
resilient if something should happen to a device associated with the
cache pool LV.
-.TP
-.B \-\-cachepolicy \fIpolicy
+.
+.HP
+.BR \-\-cachepolicy
+.IR policy
+.br
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
-the cache policy. \fImq\fP is the basic policy name. \fIsmq\fP is more advanced
+the cache policy. \fBmq\fP is the basic policy name. \fBsmq\fP is more advanced
version available in newer kernels.
-.TP
-.IR \fB\-\-cachepool " " CachePoolLogicalVolume { Name | Path }
+.
+.HP
+.BR \-\-cachepool
+.IR CachePoolLogicalVolume { Name | Path }
+.br
Specifies the name of cache pool volume name. The other way to specify pool name
is to append name to Volume group name argument.
-.TP
-.BR \-\-cachesettings " " \fIkey=value
+.
+.HP
+.BR \-\-cachesettings
+.IB key = value
+.br
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
the cache tunable settings. In most use-cases, default values should be adequate.
-Special string value \fIdefault\fP switches setting back to its default kernel value
+Special string value \fBdefault\fP switches setting back to its default kernel value
and removes it from the list of settings stored in lvm2 metadata.
-.TP
-.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
+.
+.HP
+.BR \-c | \-\-chunksize
+.IR ChunkSize \c
+.RB [ b | B | s | S | k | K | m | M | g | G ]
+.br
Gives the size of chunk for snapshot, cache pool and thin pool logical volumes.
Default unit is in kilobytes.
.br
@@ -230,79 +247,108 @@ fit the pool metadata size within 128MiB,
if the pool metadata size is not specified.
See
.BR lvm.conf (5)
-setting
-.IR allocation / thin_pool_chunk_size_policy
+setting \fBallocation/thin_pool_chunk_size_policy\fP
to select different calculation policy.
Thin pool target version <1.4 requires this value to be a power of 2.
For target version <1.5 discard is not supported for non power of 2 values.
-.TP
-.BR \-C ", " \-\-contiguous " {" \fIy | \fIn }
+.
+.HP
+.BR \-C | \-\-contiguous
+.RB { y | n }
+.br
Sets or resets the contiguous allocation policy for
logical volumes. Default is no contiguous allocation based
on a next free principle.
-.TP
+.
+.HP
.BR \-\-corelog
-This is shortcut for option \fB\-\-mirrorlog\fP \fIcore\fP.
-.TP
-.BR \-\-discards " {" \fIignore | \fInopassdown | \fIpassdown }
+.br
+This is shortcut for option \fB\-\-mirrorlog core\fP.
+.
+.HP
+.BR \-\-discards
+.RB { ignore | nopassdown | passdown }
+.br
Sets discards behavior for thin pool.
-Default is \fIpassdown\fP.
-.TP
-.BR \-\-errorwhenfull " {" \fIy |\fIn }
+Default is \fBpassdown\fP.
+.
+.HP
+.BR \-\-errorwhenfull
+.RB { y | n }
+.br
Configures thin pool behaviour when data space is exhausted.
-Default is \fIn\fPo.
+Default is \fBn\fPo.
Device will queue I/O operations until target timeout
(see dm-thin-pool kernel module option \fIno_space_timeout\fP)
expires. Thus configured system has a time to i.e. extend
the size of thin pool data device.
-When set to \fIy\fPes, the I/O operation is immeditelly errored.
-.TP
-.BR \-K ", " \-\-ignoreactivationskip
+When set to \fBy\fPes, the I/O operation is immeditelly errored.
+.
+.HP
+.BR \-K | \-\-ignoreactivationskip
+.br
Ignore the flag to skip Logical Volumes during activation.
Use \fB\-\-setactivationskip\fP option to set or reset
activation skipping flag persistently for logical volume.
-.TP
-.B \-\-ignoremonitoring
+.
+.HP
+.BR \-\-ignoremonitoring
+.br
Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
is specified.
-.TP
-.IR \fB\-l ", " \fB\-\-extents " " LogicalExtentsNumber [ % { VG | PVS | FREE | ORIGIN }]
+.
+.HP
+.BR -l | \-\-extents
+.IR LogicalExtentsNumber \c
+.RB [ % { VG | PVS | FREE | ORIGIN }]
+.br
Gives the number of logical extents to allocate for the new
logical volume. The total number of physical extents allocated will be
greater than this, for example, if the volume is mirrored.
The number can also be expressed as a percentage of the total space
-in the Volume Group with the suffix \fI%VG\fR, as a percentage of the
-remaining free space in the Volume Group with the suffix \fI%FREE\fR, as a
+in the Volume Group with the suffix \fB%VG\fP, as a percentage of the
+remaining free space in the Volume Group with the suffix \fB%FREE\fP, as a
percentage of the remaining free space for the specified
-PhysicalVolume(s) with the suffix \fI%PVS\fR, or (for a snapshot) as a
+PhysicalVolume(s) with the suffix \fB%PVS\fP, or (for a snapshot) as a
percentage of the total space in the Origin Logical Volume with the
-suffix \fI%ORIGIN\fR (i.e. \fI100%ORIGIN\fR provides space for the whole origin).
+suffix \fB%ORIGIN\fP (i.e. \fB100%ORIGIN\fP provides space for the whole origin).
When expressed as a percentage, the number is treated
as an approximate upper limit for the total number of physical extents
to be allocated (including extents used by any mirrors, for example).
-.TP
-.BR \-j ", " \-\-major " " \fImajor
+.
+.HP
+.BR \-j | \-\-major
+.IR major
+.br
Sets the major number.
Major numbers are not supported with pool volumes.
This option is supported only on older systems
(kernel version 2.4) and is ignored on modern Linux systems where major
numbers are dynamically assigned.
-.TP
-.BR \-\-metadataprofile " " \fIProfileName
+.
+.HP
+.BR \-\-metadataprofile
+.IR ProfileName
+.br
Uses and attaches the ProfileName configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
profile attached, the logical volume profile is preferred.
See \fBlvm.conf\fP(5) for more information about \fBmetadata profiles\fP.
-.TP
-.B \-\-minor \fIminor
+.
+.HP
+.BR \-\-minor
+.IR minor
+.br
Sets the minor number.
Minor numbers are not supported with pool volumes.
-.TP
-.BR \-m ", " \-\-mirrors " " \fIMirrors
-Creates a mirrored logical volume with \fIMirrors\fP copies.
-For example, specifying
-.BI \-m\ 1
+.
+.HP
+.BR \-m | \-\-mirrors
+.IR mirrors
+.br
+Creates a mirrored logical volume with \fImirrors\fP copies.
+For example, specifying \fB\-m 1\fP
would result in a mirror with two-sides; that is,
a linear volume plus one copy.
@@ -318,131 +364,173 @@ The default is "\fIraid1\fP". See the
\fB\-\-type\fP option for more information if you would like to use the
legacy "\fImirror\fP" segment type. See
.BR lvm.conf (5)
-settings
-.IR global / mirror_segtype_default
-and
-.IR global / raid10_segtype_default
+settings \fB global/mirror_segtype_default\fP
+and \fBglobal/raid10_segtype_default\fP
to configure default mirror segment type.
The options
\fB\-\-mirrorlog\fP and \fB\-\-corelog\fP apply
to the legacy "\fImirror\fP" segment type only.
-.TP
-.BR \-\-mirrorlog " {" \fIdisk | \fIcore | \fImirrored }
+.
+.HP
+.BR \-\-mirrorlog
+.RB { disk | core | mirrored }
+.br
Specifies the type of log to be used for logical volumes utilizing
the legacy "\fImirror\fP" segment type.
.br
-The default is \fIdisk\fP, which is persistent and requires
+The default is \fBdisk\fP, which is persistent and requires
a small amount of storage space, usually on a separate device from the
data being mirrored.
.br
-Using \fIcore\fP means the mirror is regenerated by copying the data
+Using \fBcore\fP means the mirror is regenerated by copying the data
from the first device each time the logical volume is activated,
like after every reboot.
.br
-Using \fImirrored\fP will create a persistent log that is itself mirrored.
-.TP
-.BR \-\-monitor " {" \fIy | \fIn }
+Using \fBmirrored\fP will create a persistent log that is itself mirrored.
+.
+.HP
+.BR \-\-monitor
+.RB { y | n }
+.br
Starts or avoids monitoring a mirrored, snapshot or thin pool logical volume with
dmeventd, if it is installed.
If a device used by a monitored mirror reports an I/O error,
the failure is handled according to
-.IR activation / mirror_image_fault_policy
-and
-.IR activation / mirror_log_fault_policy
+\fBactivation/mirror_image_fault_policy\fP
+and \fBactivation/mirror_log_fault_policy\fP
set in \fBlvm.conf\fP(5).
-.TP
-.IR \fB\-n ", " \fB\-\-name " " LogicalVolume { Name | Path }
+.
+.HP
+.BR \-n | \-\-name
+.IR LogicalVolume { Name | Path }
+.br
Sets the name for the new logical volume.
.br
Without this option a default name of "lvol#" will be generated where
# is the LVM internal number of the logical volume.
-.TP
-.B \-\-nosync
+.
+.HP
+.BR \-\-nosync
+.br
Causes the creation of the mirror to skip the initial resynchronization.
-.TP
-.B \-\-noudevsync
+.
+.HP
+.BR \-\-noudevsync
+.br
Disables udev synchronisation. The
process will not wait for notification from udev.
It will continue irrespective of any possible udev processing
in the background. You should only use this if udev is not running
or has rules that ignore the devices LVM2 creates.
-.TP
-.BR \-p ", " \-\-permission " {" \fIr | \fIrw }
-Sets access permissions to read only (\fIr\fP) or read and write (\fIrw\fP).
+.
+.HP
+.BR \-p | \-\-permission
+.RB { r | rw }
+.br
+Sets access permissions to read only (\fBr\fP) or read and write (\fBrw\fP).
.br
Default is read and write.
-.TP
-.BR \-M ", " \-\-persistent " {" \fIy | \fIn }
-Set to \fIy\fP to make the minor number specified persistent.
+.
+.HP
+.BR \-M | \-\-persistent
+.RB { y | n }
+.br
+Set to \fBy\fP to make the minor number specified persistent.
Pool volumes cannot have persistent major and minor numbers.
-Defaults to \fIy\fPes only when major or minor number is specified.
-Otherwise it is \fIn\fPo.
-.TP
+Defaults to \fBy\fPes only when major or minor number is specified.
+Otherwise it is \fBn\fPo.
+.\" .HP
.\" .IR \fB\-\-pooldatasize " " PoolDataVolumeSize [ bBsSkKmMgGtTpPeE ]
.\" Sets the size of pool's data logical volume.
.\" For thin pools you may also specify the size
.\" with the option \fB\-\-size\fP.
-.\" .TP
-.IR \fB\-\-poolmetadatasize " " MetadataVolumeSize [ bBsSkKmMgG ]
+.\"
+.
+.HP
+.BR \-\-poolmetadatasize
+.BR \fIMetadataVolumeSize [ b | B | s | S | k | K | m | M | g | G ]
+.br
Sets the size of pool's metadata logical volume.
Supported values are in range between 2MiB and 16GiB for thin pool,
and upto 16GiB for cache pool. The minimum value is computed from pool's
data size.
Default value for thin pool is (Pool_LV_size / Pool_LV_chunk_size * 64b).
Default unit is megabytes.
-.TP
-.IR \fB\-\-poolmetadataspare " {" y | n }
+.
+.HP
+.BR \-\-poolmetadataspare
+.RB { y | n }
+.br
Controls creation and maintanence of pool metadata spare logical volume
that will be used for automated pool recovery.
Only one such volume is maintained within a volume group
with the size of the biggest pool metadata volume.
-Default is \fIy\fPes.
-.TP
-.BR \-\- [ raid ] maxrecoveryrate " " \fIRate [ \fIbBsSkKmMgG ]
+Default is \fBy\fPes.
+.
+.HP
+.BR \-\- [ raid ] maxrecoveryrate
+.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.br
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
If no suffix is given, then KiB/sec/device is assumed. Setting the
recovery rate to 0 means it will be unbounded.
-.TP
-.BR \-\- [ raid ] minrecoveryrate " " \fIRate [ \fIbBsSkKmMgG ]
+.
+.HP
+.BR \-\- [ raid ] minrecoveryrate
+.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.br
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
If no suffix is given, then KiB/sec/device is assumed. Setting the
recovery rate to 0 means it will be unbounded.
-.TP
-.IR \fB\-r ", " \fB\-\-readahead " {" ReadAheadSectors | auto | none }
+.
+.HP
+.BR \-r | \-\-readahead
+.RB { \fIReadAheadSectors | auto | none }
+.br
Sets read ahead sector count of this logical volume.
For volume groups with metadata in lvm1 format, this must
be a value between 2 and 120.
-The default value is \fIauto\fP which allows the kernel to choose
+The default value is \fBauto\fP which allows the kernel to choose
a suitable value automatically.
-\fINone\fP is equivalent to specifying zero.
-.TP
-.BR \-R ", " \-\-regionsize " " \fIMirrorLogRegionSize [ \fIbBsSkKmMgG ]
+\fBnone\fP is equivalent to specifying zero.
+.
+.HP
+.BR \-R | \-\-regionsize
+.BR \fIMirrorLogRegionSize [ b | B | s | S | k | K | m | M | g | G ]
+.br
A mirror is divided into regions of this size (in MiB), and the mirror log
uses this granularity to track which regions are in sync.
-.TP
-.IR \fB\-k ", " \fB\-\-setactivationskip " {" y | n }
+.
+.HP
+.BR \-k | \-\-setactivationskip
+.RB { y | n }
+.br
Controls whether Logical Volumes are persistently flagged to be skipped during
activation. By default, thin snapshot volumes are flagged for activation skip.
See
.BR lvm.conf (5)
-.IR activation / auto_set_activation_skip
+\fBactivation/auto_set_activation_skip\fP
how to change its default behaviour.
-To activate such volumes, an extra
-.BR \-K | \-\-ignoreactivationskip
+To activate such volumes, an extra \fB\-\-ignoreactivationskip\fP
option must be used. The flag is not applied during deactivation. Use
-.B lvchange \-\-setactivationskip {y|n}
+\fBlvchange \-\-setactivationskip\fP
command to change the skip flag for existing volumes.
To see whether the flag is attached, use \fBlvs\fP command
where the state of the flag is reported within \fBlv_attr\fP bits.
-.TP
-.IR \fB\-L ", " \fB\-\-size " " LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
+.
+.HP
+.BR \-L | \-\-size
+.BR \fILogicalVolumeSize [ b | B | s | S | k | K | m | M | \c
+.BR g | G | t | T | p | P | e | E ]
+.\" man2html cannot handle all those changes in 1 line
+.br
Gives the size to allocate for the new logical volume.
-A size suffix of \fIB\fR for bytes, \fIS\fR for sectors as 512 bytes,
-\fIK\fR for kilobytes, \fIM\fR for megabytes,
-\fIG\fR for gigabytes, \fIT\fR for terabytes, \fIP\fR for petabytes
-or \fIE\fR for exabytes is optional.
+A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
+\fBK\fP for kilobytes, \fBM\fP for megabytes,
+\fBG\fP for gigabytes, \fBT\fP for terabytes, \fBP\fP for petabytes
+or \fBE\fP for exabytes is optional.
.br
Default unit is megabytes.
.TP
@@ -589,7 +677,7 @@ If blkid wiping is used
setting in
.BR lvm.conf (5))
and LVM2 is compiled with blkid wiping support, then \fBblkid\fP(8) library is used
-to detect the signatures (use \fBblkid -k\fP command to list the signatures that are recognized).
+to detect the signatures (use \fBblkid \-k\fP command to list the signatures that are recognized).
Otherwise, native LVM2 code is used to detect signatures (MD RAID, swap and LUKS
signatures are detected only in this case).
.br
@@ -705,7 +793,7 @@ volume (i.e. the origin LV), creating a cache LV.
.\" Create a 1G cached LV "lvol1" with 10M cache pool "vg00/pool".
.\" .sp
-.\" .B lvcreate \-\-cache \-L 1G \-n lv --pooldatasize 10M vg00/pool
+.\" .B lvcreate \-\-cache \-L 1G \-n lv \-\-pooldatasize 10M vg00/pool
.SH SEE ALSO
.BR lvm (8),
diff --git a/man/lvm.8.in b/man/lvm.8.in
index daab791..8ff31ae 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -1,29 +1,35 @@
.TH LVM 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
+.
.SH NAME
+.
lvm \(em LVM2 tools
+.
.SH SYNOPSIS
+.
.B lvm
-[command | file]
+.RI [ command | file ]
+.
.SH DESCRIPTION
+.
lvm provides the command-line tools for LVM2. A separate
manual page describes each command in detail.
-.LP
+.P
If \fBlvm\fP is invoked with no arguments it presents a readline prompt
(assuming it was compiled with readline support).
LVM commands may be entered interactively at this prompt with
readline facilities including history and command name and option
completion. Refer to \fBreadline\fP(3) for details.
-.LP
+.P
If \fBlvm\fP is invoked with argv[0] set to the name of a specific
LVM command (for example by using a hard or soft link) it acts as
that command.
-.LP
+.P
On invocation, \fBlvm\fP requires that only the standard file descriptors
stdin, stdout and stderr are available. If others are found, they
get closed and messages are issued warning about the leak.
This warning can be suppressed by setting the environment variable
.B LVM_SUPPRESS_FD_WARNINGS\fP.
-.LP
+.P
Where commands take VG or LV names as arguments, the full path name is
optional. An LV called "lvol0" in a VG called "vg0" can be specified
as "vg0/lvol0". Where a list of VGs is required but is left empty,
@@ -31,223 +37,319 @@ a list of all VGs will be substituted. Where a list of LVs is required
but a VG is given, a list of all the LVs in that VG will be substituted.
So \fBlvdisplay vg0\fP will display all the LVs in "vg0".
Tags can also be used - see \fB\-\-addtag\fP below.
-.LP
+.P
One advantage of using the built-in shell is that configuration
information gets cached internally between commands.
-.LP
+.P
A file containing a simple script with one command per line
can also be given on the command line. The script can also be
executed directly if the first line is #! followed by the absolute
path of \fBlvm\fP.
+.
.SH BUILT-IN COMMANDS
-The following commands are built into lvm without links normally
-being created in the filesystem for them.
+.
+The following commands are built into lvm without links
+normally being created in the filesystem for them.
+.sp
.PD 0
-.HP
-\fBconfig\fP \(em The same as \fBlvmconfig\fP(8) below.
-.HP
-\fBdevtypes\fP \(em Display the recognised built-in block device types.
-.HP
-\fBdumpconfig\fP \(em The same as \fBlvmconfig\fP(8) below.
-.HP
-\fBformats\fP \(em Display recognised metadata formats.
-.HP
-\fBhelp\fP \(em Display the help text.
-.HP
-\fBlvpoll\fP \(em Internal command used by lvmpolld to complete some Logical Volume operations.
-.HP
-\fBpvdata\fP \(em Not implemented in LVM2.
-.HP
-\fBsegtypes\fP \(em Display recognised Logical Volume segment types.
-.HP
-\fBsystemid\fP \(em Display the system ID, if any, currently set on this host.
-.HP
-\fBtags\fP \(em Display any tags defined on this host.
-.HP
-\fBversion\fP \(em Display version information.
+.TP 14
+.B config
+The same as \fBlvmconfig\fP(8) below.
+.TP
+.B devtypes
+Display the recognised built-in block device types.
+.TP
+.B dumpconfig
+The same as \fBlvmconfig\fP(8) below.
+.TP
+.B formats
+Display recognised metadata formats.
+.TP
+.B help
+Display the help text.
+.TP
+.B lvpoll
+Complete lvmpolld operations (Internal command).
+.TP
+.B pvdata
+Not implemented in LVM2.
+.TP
+.B segtypes
+Display recognised Logical Volume segment types.
+.TP
+.B systemid
+Display any system ID currently set on this host.
+.TP
+.B tags
+Display any tags defined on this host.
+.TP
+.B version
+Display version information.
.PD
+.
.SH COMMANDS
+.
The following commands implement the core LVM functionality.
+.sp
.PD 0
-.HP
-\fBpvchange\fP \(em Change attributes of a Physical Volume.
-.HP
-\fBpvck\fP \(em Check Physical Volume metadata.
-.HP
-\fBpvcreate\fP \(em Initialize a disk or partition for use by LVM.
-.HP
-\fBpvdisplay\fP \(em Display attributes of a Physical Volume.
-.HP
-\fBpvmove\fP \(em Move Physical Extents.
-.HP
-\fBpvremove\fP \(em Remove a Physical Volume.
-.HP
-\fBpvresize\fP \(em Resize a disk or partition in use by LVM2.
-.HP
-\fBpvs\fP \(em Report information about Physical Volumes.
-.HP
-\fBpvscan\fP \(em Scan all disks for Physical Volumes.
-.HP
-\fBvgcfgbackup\fP \(em Backup Volume Group descriptor area.
-.HP
-\fBvgcfgrestore\fP \(em Restore Volume Group descriptor area.
-.HP
-\fBvgchange\fP \(em Change attributes of a Volume Group.
-.HP
-\fBvgck\fP \(em Check Volume Group metadata.
-.HP
-\fBvgconvert\fP \(em Convert Volume Group metadata format.
-.HP
-\fBvgcreate\fP \(em Create a Volume Group.
-.HP
-\fBvgdisplay\fP \(em Display attributes of Volume Groups.
-.HP
-\fBvgexport\fP \(em Make volume Groups unknown to the system.
-.HP
-\fBvgextend\fP \(em Add Physical Volumes to a Volume Group.
-.HP
-\fBvgimport\fP \(em Make exported Volume Groups known to the system.
-.HP
-\fBvgimportclone\fP \(em Import and rename duplicated Volume Group (e.g. a hardware snapshot).
-.HP
-\fBvgmerge\fP \(em Merge two Volume Groups.
-.HP
-\fBvgmknodes\fP \(em Recreate Volume Group directory and Logical Volume special files
-.HP
-\fBvgreduce\fP \(em Reduce a Volume Group by removing one or more
-Physical Volumes.
-.HP
-\fBvgremove\fP \(em Remove a Volume Group.
-.HP
-\fBvgrename\fP \(em Rename a Volume Group.
-.HP
-\fBvgs\fP \(em Report information about Volume Groups.
-.HP
-\fBvgscan\fP \(em Scan all disks for Volume Groups and rebuild caches.
-.HP
-\fBvgsplit\fP \(em Split a Volume Group into two, moving any logical
+.TP 14
+.B pvchange
+Change attributes of a Physical Volume.
+.TP
+.B pvck
+Check Physical Volume metadata.
+.TP
+.B pvcreate
+Initialize a disk or partition for use by LVM.
+.TP
+.B pvdisplay
+Display attributes of a Physical Volume.
+.TP
+.B pvmove
+Move Physical Extents.
+.TP
+.B pvremove
+Remove a Physical Volume.
+.TP
+.B pvresize
+Resize a disk or partition in use by LVM2.
+.TP
+.B pvs
+Report information about Physical Volumes.
+.TP
+.B pvscan
+Scan all disks for Physical Volumes.
+.TP
+.B vgcfgbackup
+Backup Volume Group descriptor area.
+.TP
+.B vgcfgrestore
+Restore Volume Group descriptor area.
+.TP
+.B vgchange
+Change attributes of a Volume Group.
+.TP
+.B vgck
+Check Volume Group metadata.
+.TP
+.B vgconvert
+Convert Volume Group metadata format.
+.TP
+.B vgcreate
+Create a Volume Group.
+.TP
+.B vgdisplay
+Display attributes of Volume Groups.
+.TP
+.B vgexport
+Make volume Groups unknown to the system.
+.TP
+.B vgextend
+Add Physical Volumes to a Volume Group.
+.TP
+.B vgimport
+Make exported Volume Groups known to the system.
+.TP
+.B vgimportclone
+Import and rename duplicated Volume Group (e.g. a hardware snapshot).
+.TP
+.B vgmerge
+Merge two Volume Groups.
+.TP
+.B vgmknodes
+Recreate Volume Group directory and Logical Volume special files
+.TP
+.B vgreduce
+Reduce a Volume Group by removing one or more Physical Volumes.
+.TP
+.B vgremove
+Remove a Volume Group.
+.TP
+.B vgrename
+Rename a Volume Group.
+.TP
+.B vgs
+Report information about Volume Groups.
+.TP
+.B vgscan
+Scan all disks for Volume Groups and rebuild caches.
+.TP
+.B vgsplit
+Split a Volume Group into two, moving any logical
volumes from one Volume Group to another by moving entire Physical
Volumes.
-.HP
-\fBlvchange\fP \(em Change attributes of a Logical Volume.
-.HP
-\fBlvconvert\fP \(em Convert a Logical Volume from linear to mirror or snapshot.
-.HP
-\fBlvcreate\fP \(em Create a Logical Volume in an existing Volume Group.
-.HP
-\fBlvdisplay\fP \(em Display attributes of a Logical Volume.
-.HP
-\fBlvextend\fP \(em Extend the size of a Logical Volume.
-.HP
-\fBlvmchange\fP \(em Change attributes of the Logical Volume Manager.
-.HP
-\fBlvmconfig\fP \(em Display the configuration information after
+.TP
+.B lvchange
+Change attributes of a Logical Volume.
+.TP
+.B lvconvert
+Convert a Logical Volume from linear to mirror or snapshot.
+.TP
+.B lvcreate
+Create a Logical Volume in an existing Volume Group.
+.TP
+.B lvdisplay
+Display attributes of a Logical Volume.
+.TP
+.B lvextend
+Extend the size of a Logical Volume.
+.TP
+.B lvmchange
+Change attributes of the Logical Volume Manager.
+.TP
+.B lvmconfig
+Display the configuration information after
loading \fBlvm.conf\fP(5) and any other configuration files.
-.HP
-\fBlvmdiskscan\fP \(em Scan for all devices visible to LVM2.
-.HP
-\fBlvmdump\fP \(em Create lvm2 information dumps for diagnostic purposes.
-.HP
-\fBlvreduce\fP \(em Reduce the size of a Logical Volume.
-.HP
-\fBlvremove\fP \(em Remove a Logical Volume.
-.HP
-\fBlvrename\fP \(em Rename a Logical Volume.
-.HP
-\fBlvresize\fP \(em Resize a Logical Volume.
-.HP
-\fBlvs\fP \(em Report information about Logical Volumes.
-.HP
-\fBlvscan\fP \(em Scan (all disks) for Logical Volumes.
+.TP
+.B lvmdiskscan
+Scan for all devices visible to LVM2.
+.TP
+.B lvmdump
+Create lvm2 information dumps for diagnostic purposes.
+.TP
+.B lvreduce
+Reduce the size of a Logical Volume.
+.TP
+.B lvremove
+Remove a Logical Volume.
+.TP
+.B lvrename
+Rename a Logical Volume.
+.TP
+.B lvresize
+Resize a Logical Volume.
+.TP
+.B lvs
+Report information about Logical Volumes.
+.TP
+.B lvscan
+Scan (all disks) for Logical Volumes.
.PD
-.HP
-The following commands are not implemented in LVM2 but might be in the future: lvmsadc, lvmsar, pvdata.
+.P
+The following commands are not implemented in LVM2 but might be
+in the future:
+.BR lvmsadc ", " lvmsar ", " pvdata .
+.
.SH OPTIONS
+.
The following options are available for many of the commands.
They are implemented generically and documented here rather
than repeated on individual manual pages.
-
+.P
Additional hyphens within option names are ignored. For example,
-\-\-readonly and \-\-read\-only are both accepted.
-
-.TP
-.BR \-h ", " \-? ", " \-\-help
+\fB\-\-readonly\fP and \fB\-\-read\-only\fP are both accepted.
+.
+.HP
+.BR \-h | \-? | \-\-help
+.br
Display the help text.
-.TP
-.B \-\-version
+.
+.HP
+.BR \-\-version
+.br
Display version information.
-.TP
-.BR \-v ", " \-\-verbose
+.
+.HP
+.BR \-v | \-\-verbose
+.br
Set verbose level. Repeat from 1 to 3 times to increase the detail
of messages sent to stdout and stderr. Overrides config file setting.
-.TP
-.BR \-d ", " \-\-debug
+.
+.HP
+.BR \-d | \-\-debug
+.br
Set debug level. Repeat from 1 to 6 times to increase the detail of
messages sent to the log file and/or syslog (if configured).
Overrides config file setting.
-.TP
-.BR \-q ", " \-\-quiet
+.
+.HP
+.BR \-q | \-\-quiet
+.br
Suppress output and log messages.
Overrides \fB\-d\fP and \fB\-v\fP.
Repeat once to also suppress any prompts with answer 'no'.
-.TP
+.
+.HP
.BR \-\-yes
+.br
Don't prompt for confirmation interactively but instead always assume the
answer is 'yes'. Take great care if you use this!
-.TP
-.BR \-t ", " \-\-test
+.
+.HP
+.BR \-t | \-\-test
+.br
Run in test mode. Commands will not update metadata.
This is implemented by disabling all metadata writing but nevertheless
returning success to the calling function. This may lead to unusual
error messages in multi-stage operations if a tool relies on reading
back metadata it believes has changed but hasn't.
-.TP
-.BR \-\-driverloaded " {" \fIy | \fIn }
+.
+.HP
+.BR \-\-driverloaded
+.RB { y | n }
+.br
Whether or not the device-mapper kernel driver is loaded.
-If you set this to \fIn\fP, no attempt will be made to contact the driver.
-.TP
-.BR \-A ", " \-\-autobackup " {" \fIy | \fIn }
+If you set this to \fBn\fP, no attempt will be made to contact the driver.
+.
+.HP
+.BR \-A | \-\-autobackup
+.RB { y | n }
+.br
Whether or not to metadata should be backed up automatically after a change.
You are strongly advised not to disable this!
See \fBvgcfgbackup\fP(8).
-.TP
-.BR \-P ", " \-\-partial
+.
+.HP
+.BR \-P | \-\-partial
+.br
When set, the tools will do their best to provide access to Volume Groups
that are only partially available (one or more Physical Volumes belonging
to the Volume Group are missing from the system). Where part of a logical
-volume is missing, \fB/dev/ioerror\fP will be substituted, and you could use
+volume is missing, \fI\%/dev/ioerror\fP will be substituted, and you could use
\fBdmsetup\fP(8) to set this up to return I/O errors when accessed,
or create it as a large block device of nulls. Metadata may not be
changed with this option. To insert a replacement Physical Volume
of the same or large size use \fBpvcreate \-u\fP to set the uuid to
match the original followed by \fBvgcfgrestore\fP(8).
-.TP
-.BR \-S ", " \-\-select " " \fISelection
-For reporting commands, display only rows that match selection criteria.
+.
+.HP
+.BR \-S | \-\-select
+.IR Selection
+.br
+For reporting commands, display only rows that match \fISelection\fP criteria.
All rows are displayed with the additional "selected" column (\fB-o selected\fP)
-showing 1 if the row matches the Selection and 0 otherwise. For non-reporting
+showing 1 if the row matches the \fISelection\fP and 0 otherwise. For non-reporting
commands which process LVM entities, the selection can be used to match items
to process. See \fBSELECTION CRITERIA\fP section of this man page for more
information about the way the selection criteria are constructed.
-.TP
-.BR \-M ", " \-\-metadatatype " " \fIType
-Specifies which type of on-disk metadata to use, such as \fIlvm1\fP
-or \fIlvm2\fP, which can be abbreviated to \fI1\fP or \fI2\fP respectively.
-The default (\fIlvm2\fP) can be changed by setting \fBformat\fP
-in the \fBglobal\fP section of the config file.
-.TP
-.B \-\-ignorelockingfailure
+.
+.HP
+.BR \-M | \-\-metadatatype
+.IR Type
+.br
+Specifies which \fItype\fP of on-disk metadata to use, such as \fBlvm1\fP
+or \fBlvm2\fP, which can be abbreviated to \fB1\fP or \fB2\fP respectively.
+The default (\fBlvm2\fP) can be changed by setting \fBformat\fP
+in the \fBglobal\fP section of the config file \fBlvm.conf\fP(5).
+.
+.HP
+.BR \-\-ignorelockingfailure
+.br
This lets you proceed with read-only metadata operations such as
\fBlvchange \-ay\fP and \fBvgchange \-ay\fP even if the locking module fails.
One use for this is in a system init script if the lock directory
is mounted read-only when the script runs.
-.TP
-.B \-\-ignoreskippedcluster
+.
+.HP
+.BR \-\-ignoreskippedcluster
+.br
Use to avoid exiting with an non-zero status code if the command is run
without clustered locking and some clustered Volume Groups have to be
skipped over.
-.TP
-.B \-\-readonly
+.
+.HP
+.BR \-\-readonly
+.br
Run the command in a special read-only mode which will read on-disk
metadata without needing to take any locks. This can be used to peek
inside metadata used by a virtual machine image while the virtual
@@ -255,21 +357,28 @@ machine is running.
It can also be used to peek inside the metadata of clustered Volume
Groups when clustered locking is not configured or running. No attempt
will be made to communicate with the device-mapper kernel driver, so
-this option is unable to report whether or not Logical Volumes are
+this option is unable to report whether or not Logical Volumes are
actually in use.
-.TP
-.B \-\-foreign
+.
+.HP
+.BR \-\-foreign
+.br
Cause the command to access foreign VGs, that would otherwise be skipped.
It can be used to report or display a VG that is owned by another host.
This option can cause a command to perform poorly because lvmetad caching
is not used and metadata is read from disks.
-.TP
-.B \-\-shared
+.
+.HP
+.BR \-\-shared
+.br
Cause the command to access shared VGs, that would otherwise be skipped
when lvmlockd is not being used. It can be used to report or display a
lockd VG without locking.
-.TP
-.B \-\-addtag \fITag
+.
+.HP
+.BR \-\-addtag
+.IR Tag
+.br
Add the tag \fITag\fP to a PV, VG or LV.
Supply this argument multiple times to add more than one tag at once.
A tag is a word that can be used to group LVM2 objects of the same type
@@ -288,79 +397,113 @@ Only the new LVM2 metadata format supports tagging: objects using the
LVM1 metadata format cannot be tagged because the on-disk format does not
support it.
Characters allowed in tags are:
-.B A-Z a-z 0-9 _ + . -
+.BR A - Z
+.BR a - z
+.BR 0 - 9
+.BR "_ + . -"
and as of version 2.02.78 the following characters are also accepted:
-.B / = ! : # &
-.TP
-.B \-\-deltag \fITag
+.BR "/ = ! : # &"
+..
+.HP
+.BR \-\-deltag
+.IR Tag
+.br
Delete the tag \fITag\fP from a PV, VG or LV, if it's present.
Supply this argument multiple times to remove more than one tag at once.
-.TP
-.IR \fB\-\-alloc \ { anywhere | contiguous | cling | inherit | normal }
+.
+.HP
+.BR \-\-alloc
+.RB { anywhere | contiguous | cling | inherit | normal }
+.br
Selects the allocation policy when a command needs to allocate
Physical Extents from the Volume Group.
Each Volume Group and Logical Volume has an allocation policy defined.
-The default for a Volume Group is \fInormal\fP which applies
+The default for a Volume Group is \fBnormal\fP which applies
common-sense rules such as not placing parallel stripes on the same
-Physical Volume. The default for a Logical Volume is \fIinherit\fP
+Physical Volume. The default for a Logical Volume is \fBinherit\fP
which applies the same policy as for the Volume Group. These policies can
be changed using \fBlvchange\fP(8) and \fBvgchange\fP(8) or overridden
on the command line of any command that performs allocation.
-The \fIcontiguous\fP policy requires that new Physical Extents be placed adjacent
+The \fBcontiguous\fP policy requires that new Physical Extents be placed adjacent
to existing Physical Extents.
-The \fIcling\fP policy places new Physical Extents on the same Physical
+The \fBcling\fP policy places new Physical Extents on the same Physical
Volume as existing Physical Extents in the same stripe of the Logical Volume.
If there are sufficient free Physical Extents to satisfy
-an allocation request but \fInormal\fP doesn't use them,
-\fIanywhere\fP will - even if that reduces performance by
+an allocation request but \fBnormal\fP doesn't use them,
+\fBanywhere\fP will - even if that reduces performance by
placing two stripes on the same Physical Volume.
-.TP
-.IR \fB\-\-commandprofile " " \fIProfileName
+.
+.HP
+.BR \-\-commandprofile
+.IR ProfileName
+.br
Selects the command configuration profile to use when processing an LVM command.
See also \fBlvm.conf\fP(5) for more information about \fBcommand profile config\fP and
the way it fits with other LVM configuration methods. Using \fB\-\-commandprofile\fP
option overrides any command profile specified via \fBLVM_COMMAND_PROFILE\fP
environment variable.
-.TP
-.IR \fB\-\-metadataprofile " " \fIProfileName
+.
+.HP
+.BR \-\-metadataprofile
+.IR ProfileName
+.br
Selects the metadata configuration profile to use when processing an LVM command.
When using metadata profile during Volume Group or Logical Volume creation,
the metadata profile name is saved in metadata. When such Volume Group or Logical
Volume is processed next time, the metadata profile is automatically applied
-and the use of \-\-metadataprofile option is not necessary. See also
+and the use of \fB\-\-metadataprofile\fP option is not necessary. See also
\fBlvm.conf\fP(5) for more information about \fBmetadata profile config\fP and the
way it fits with other LVM configuration methods.
-.TP
-.IR \fB\-\-profile " " \fIProfileName
+.
+.HP
+.BR \-\-profile
+.IR ProfileName
+.br
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
for any other command (with the exception of \fBlvmconfig\fP command where the
-\-\-profile has special meaning, see \fBlvmconfig\fP(8) for more information).
-.TP
-.IR \fB\-\-config " " \fIConfigurationString
+\fB\-\-profile\fP has special meaning, see \fBlvmconfig\fP(8) for more information).
+.
+.HP
+.BR \-\-config
+.IR ConfigurationString
+.br
Uses the ConfigurationString as direct string representation of the configuration
to override the existing configuration. The ConfigurationString is of exactly
the same format as used in any LVM configuration file. See \fBlvm.conf\fP(5)
for more information about \fBdirect config override on command line\fP and the
way it fits with other LVM configuration methods.
+.
.SH VALID NAMES
+.
The valid characters for VG and LV names are:
-.B a-z A-Z 0-9 + _ . -
-.LP
+.BR a - z
+.BR A - Z
+.BR 0 - 9
+.BR "+ _ . -"
+.P
VG and LV names cannot begin with a hyphen.
-There are also various reserved names that are used internally by lvm that can not be used as LV or VG names.
-A VG cannot be called anything that exists in /dev/ at the time of creation, nor can it be called '.' or '..'.
-An LV cannot be called '.', '..', 'snapshot' or 'pvmove'. The LV name may also not contain any of the following
-strings: '_cdata', '_cmeta', '_corig', '_mlog', '_mimage', '_pmspare', '_rimage', '_rlog', '_tdata' or '_tmeta'.
-A directory bearing the name of each Volume Group is created under /dev when any of its Logical Volumes are activated.
-Each active Logical Volume is accessible from this directory as a symbolic link leading to a device node.
-Links or nodes in /dev/mapper are intended only for internal use and the precise format and escaping might change between releases and distributions.
+There are also various reserved names that are used internally by lvm that can
+not be used as LV or VG names. A VG cannot be called anything that exists in
+\fI/dev/\fP at the time of creation, nor can it be called '.' or '..'.
+An LV cannot be called '.', '..', 'snapshot' or 'pvmove'.
+The LV name may also not contain any of the following strings:
+'_cdata', '_cmeta', '_corig', '_mlog', '_mimage', '_pmspare', '_rimage',
+'_rlog', '_tdata' or '_tmeta'.
+A directory bearing the name of each Volume Group is created under
+\fI/dev\fP when any of its Logical Volumes are activated.
+Each active Logical Volume is accessible from this directory as a symbolic
+link leading to a device node.
+Links or nodes in \fI/dev/mapper\fP are intended only for internal use and
+the precise format and escaping might change between releases and distributions.
Other software and scripts should use the
-/dev/VolumeGroupName/LogicalVolumeName format to reduce the chance of needing
+\fI/dev/VolumeGroupName/LogicalVolumeName\fP format to reduce the chance of needing
amendment when the software is updated. Should you need to process the node
names in /dev/mapper, you may use \fBdmsetup splitname\fP to separate out the
original VG, LV and internal layer names.
+.
.SH ALLOCATION
+.
When an operation needs to allocate Physical Extents for one or more
Logical Volumes, the tools proceed as follows:
@@ -370,7 +513,7 @@ the end of the command line, only unallocated Physical Extents within
those ranges on the specified Physical Volumes are considered.
Then they try each allocation policy in turn, starting with the strictest
-policy (\fIcontiguous\fP) and ending with the allocation policy specified
+policy (\fBcontiguous\fP) and ending with the allocation policy specified
using \fB\-\-alloc\fP or set as the default for the particular Logical
Volume or Volume Group concerned. For each policy, working from the
lowest-numbered Logical Extent of the empty Logical Volume space that
@@ -380,15 +523,15 @@ they move on to the next policy.
The restrictions are as follows:
-\fIContiguous\fP requires that the physical location of any Logical
+\fBContiguous\fP requires that the physical location of any Logical
Extent that is not the first Logical Extent of a Logical Volume is
adjacent to the physical location of the Logical Extent immediately
preceding it.
-\fICling\fP requires that the Physical Volume used for any Logical
+\fBCling\fP requires that the Physical Volume used for any Logical
Extent to be added to an existing Logical Volume is already in use by at
least one Logical Extent earlier in that Logical Volume. If the
-configuration parameter allocation/cling_tag_list is defined, then two
+configuration parameter \fBallocation/cling_tag_list\fP is defined, then two
Physical Volumes are considered to match if any of the listed tags is
present on both Physical Volumes. This allows groups of Physical
Volumes with similar properties (such as their physical location) to be
@@ -398,25 +541,25 @@ When a Logical Volume is striped or mirrored, the above restrictions are
applied independently to each stripe or mirror image (leg) that needs
space.
-\fINormal\fP will not choose a Physical Extent that shares the same Physical
+\fBNormal\fP will not choose a Physical Extent that shares the same Physical
Volume as a Logical Extent already allocated to a parallel Logical
-Volume (i.e. a different stripe or mirror image/leg) at the same offset
+Volume (i.e. a different stripe or mirror image/leg) at the same offset
within that parallel Logical Volume.
When allocating a mirror log at the same time as Logical Volumes to hold
the mirror data, Normal will first try to select different Physical
Volumes for the log and the data. If that's not possible and the
-allocation/mirror_logs_require_separate_pvs configuration parameter is
-set to 0, it will then allow the log to share Physical Volume(s) with
-part of the data.
+.B allocation/mirror_logs_require_separate_pvs
+configuration parameter is set to 0, it will then allow the log
+to share Physical Volume(s) with part of the data.
When allocating thin pool metadata, similar considerations to those of a
mirror log in the last paragraph apply based on the value of the
-allocation/thin_pool_metadata_require_separate_pvs configuration
-parameter.
+.B allocation/thin_pool_metadata_require_separate_pvs
+configuration parameter.
If you rely upon any layout behaviour beyond that documented here, be
-aware that it might change in future versions of the code.
+aware that it might change in future versions of the code.
For example, if you supply on the command line two empty Physical
Volumes that have an identical number of free Physical Extents available for
@@ -431,87 +574,123 @@ discretion over the layout.
To view the way the allocation process currently works in any specific
case, read the debug logging output, for example by adding \fB\-vvvv\fP to
a command.
-
+.
.SH LOGICAL VOLUME TYPES
+.
Some logical volume types are simple to create and can be done with a
single \fBlvcreate\fP(8) command. The linear and striped logical
volume types are an example of this. Other logical volume types may
require more than one command to create. The cache (\fBlvmcache\fP(7))
and thin provisioning (\fBlvmthin\fP(7)) types are examples of this.
-
+.
.SH SELECTION CRITERIA
-.LP
+.
The selection criteria are a set of \fBstatements\fP combined by \fBlogical
and grouping operators\fP. The \fBstatement\fP consists of \fBcolumn\fP
name for which a set of valid \fBvalues\fP is defined using
\fBcomparison operators\fP. For complete list of column names (fields)
that can be used in selection, see the output of \fB<lvm reporting command> -S help\fP.
-.LP
-\fBComparison operators\fP (cmp_op):
-.IP
-\fB=~\fP \(em Matching regular expression.
-.IP
-\fB!~\fP \(em Not matching regular expression.
-.IP
-\fB=\fP \(em Equal to.
-.IP
-\fB!=\fP \(em Not equal to.
-.IP
-\fB>=\fP \(em Greater than or equal to.
-.IP
-\fB>\fP \(em Greater than
-.IP
-\fB<=\fP \(em Less than or equal to.
-.IP
-\fB<\fP \(em Less than.
-.LP
-\fBBinary logical operators\fP (cmp_log):
-.IP
-\fB&&\fP \(em All fields must match
-.IP
-\fB,\fP \(em All fields must match
-.IP
-\fB||\fP \(em At least one field must match
-.IP
-\fB#\fP \(em At least one field must match
-.LP
-\fBUnary logical operators\fP:
-.IP
-\fB!\fP \(em Logical negation
-.LP
-\fBGrouping operators\fP:
-.IP
-\fB(\fP \(em Left parenthesis
-.IP
-\fB)\fP \(em Right parenthesis
-.IP
-\fB[\fP \(em List start
-.IP
-\fB]\fP \(em List end
-.IP
-\fB{\fP \(em List subset start
-.IP
-\fB}\fP \(em List subset end
-.LP
-\fBInformal grammar specification\fP:
-.IP
-.BR STATEMENT " = " column " cmp_op " VALUE " | " STATEMENT " log_op " STATEMENT " | " (STATEMENT) " | " !(STATEMENT)
-.IP
+.P
+.SS Comparison operators \fR(cmp_op)
+.sp
+.PD 0
+.TP
+.B =~
+Matching regular expression.
+.TP
+.B !~
+Not matching regular expression.
+.TP
+.B =
+Equal to.
+.TP
+.B !=
+Not equal to.
+.TP
+.B >=
+Greater than or equal to.
+.TP
+.B >
+Greater than
+.TP
+.B <=
+Less than or equal to.
+.TP
+.B <
+Less than.
+.PD
+.P
+.SS Binary logical operators \fR(cmp_log)
+.sp
+.PD 0
+.TP
+.B &&
+All fields must match
+.TP
+.B ,
+All fields must match
+.TP
+.B ||
+At least one field must match
+.TP
+.B #
+At least one field must match
+.PD
+.P
+.SS Unary logical operators
+.TP
+.B !
+Logical negation
+.P
+.SS Grouping operators
+.sp
+.PD 0
+.TP
+.B (
+Left parenthesis
+.TP
+.B )
+Right parenthesis
+.TP
+.B [
+List start
+.TP
+.B ]
+List end
+.TP
+.B {
+List subset start
+.TP
+.B }
+List subset end
+.PD
+.SS Informal grammar specification
+.HP
+.BR STATEMENT " = " column " cmp_op " VALUE " | " \%STATEMENT " log_op " STATEMENT " | " \%(STATEMENT) " | " \%!(STATEMENT)
+.br
+.HP
.BR VALUE " = " [VALUE " log_op " VALUE]
.br
-For list-based types: string list. Matches strictly. The log_op must always be of one type within the whole list value.
-.IP
+For list-based types: string list. Matches strictly.
+The log_op must always be of one type within the whole list value.
+.HP
.BR VALUE " = " {VALUE " log_op " VALUE}
.br
-For list-based types: string list. Matches a subset. The log_op must always be of one type within the whole list value.
-.IP
+For list-based types: string list. Matches a subset.
+The log_op must always be of one type within the whole list value.
+.HP
.BR VALUE " = " value
.br
-For scalar types: number (integer), size (floating point number with size unit suffix), percent (floating point number with or without % suffix), string.
-
+For scalar types: number (integer), size (floating point number
+with size unit suffix), percent (floating point number with or
+without % suffix), string.
+.
.SH DIAGNOSTICS
+.
All tools return a status code of zero on success or non-zero on failure.
+.
.SH ENVIRONMENT VARIABLES
+.
.TP
.B HOME
Directory containing \fI.lvm_history\fP if the internal readline
@@ -523,7 +702,7 @@ is overriden by direct use of \fB\-\-commandprofile\fP command line option.
.TP
.B LVM_SYSTEM_DIR
Directory containing \fBlvm.conf\fP(5) and other LVM system files.
-Defaults to "#DEFAULT_SYS_DIR#".
+Defaults to "\fI#DEFAULT_SYS_DIR#\fP".
.TP
.B LVM_SUPPRESS_FD_WARNINGS
Suppress warnings about unexpected file descriptors passed into LVM.
@@ -554,9 +733,10 @@ separate file.
The status anticipated when the process exits. Use ">N" to match any
status greater than N. If the actual exit status matches and a log
file got produced, it is deleted.
-
-LVM_LOG_FILE_EPOCH and LVM_EXPECTED_EXIT_STATUS together allow
-automated test scripts to discard uninteresting log data.
+.B LVM_LOG_FILE_EPOCH
+and
+.B LVM_EXPECTED_EXIT_STATUS
+together allow automated test scripts to discard uninteresting log data.
.TP
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known
@@ -568,11 +748,15 @@ Abort processing if the code detects a non-fatal internal error.
.B DM_DISABLE_UDEV
Avoid interaction with udev. LVM will manage the relevant nodes in /dev
directly.
+.
.SH FILES
+.
.I #DEFAULT_SYS_DIR#/lvm.conf
.br
.I $HOME/.lvm_history
+.
.SH SEE ALSO
+.
.BR lvm.conf (5),
.BR lvmcache (7),
.BR lvmthin (7),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=867a36b4197e2abe…
Commit: 867a36b4197e2abe6efd3b16e229590eedc566a3
Parent: a139275eca4fadca4a456fd27e8b2ba30d7d2c02
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 11:25:00 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 1 15:03:12 2015 +0200
man: update dmsetup and dmstats pages
Try to provide properly rendered pages no just with
plain 'man' but also for:
man -Tps
man -Thtml
man2html
---
man/dmsetup.8.in | 1039 +++++++++++++++++++++++++++++++++---------------------
man/dmstats.8.in | 890 ++++++++++++++++++++++++----------------------
2 files changed, 1099 insertions(+), 830 deletions(-)
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index eff805a..183f4fc 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -1,171 +1,378 @@
.TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"
+.
.SH NAME
+.
dmsetup \(em low level logical volume management
+.
.SH SYNOPSIS
+.
+.\".nh
.ad l
.PD 0
+.HP 9
+.B dmsetup
+.de CMD_CLEAR
+. BR clear
+. IR device_name
+..
+.CMD_CLEAR
+.
+.HP
+.B dmsetup
+.de CMD_CREATE
+. ad l
+. BR create
+. IR device_name
+. RB [ -u | \-\-uuid
+. IR uuid ]
+. RB \%[ \-\-addnodeoncreate | \-\-addnodeonresume ]
+. RB \%[ \-n | \-\-notable | \-\-table
+. RI \%{ table | table_file }]
+. RB [ \-\-readahead
+. RB \%{[ + ] \fIsectors | auto | none }]
+. ad b
+..
+.CMD_CREATE
+.
+.HP
+.B dmsetup
+.de CMD_DEPS
+. ad l
+. BR deps
+. RB [ \-o
+. IR options ]
+. RI [ device_name ]
+. ad b
+..
+.CMD_DEPS
+.
+.HP
+.B dmsetup
+.de CMD_HELP
+. BR help
+. RB [ \-c | \-C | \-\-columns ]
+..
+.CMD_HELP
+.
+.HP
+.B dmsetup
+.de CMD_INFO
+. BR info
+. RI [ device_name ]
+..
+.CMD_INFO
+.
+.HP
+.B dmsetup
+.de CMD_INFOLONG
+. ad l
+. BR info
+. BR \-c | \-C | \-\-columns
+. RB [ \-\-count
+. IR count ]
+. RB [ \-\-interval
+. IR seconds ]
+. RB \%[ \-\-nameprefixes ]
+. RB \%[ \-\-noheadings ]
+. RB [ \-o
+. IR fields ]
+. RB [ \-O | \-\-sort
+. IR sort_fields ]
+. RB [ \-\-separator
+. IR separator ]
+. RI [ device_name ]
+. ad b
+..
+.CMD_INFOLONG
+.
+.HP
+.B dmsetup
+.de CMD_LOAD
+. ad l
+. BR load
+. IR device_name
+. RB [ \-\-table
+. RI { table | table_file }]
+. ad b
+..
+.CMD_LOAD
+.
+.HP
+.B dmsetup
+.de CMD_LS
+. ad l
+. BR ls
+. RB [ \-\-target
+. IR target_type ]
+. RB [ \-\-exec
+. IR command ]
+. RB [ \-\-tree ]
+. RB [ \-o
+. IR options ]
+. ad b
+..
+.CMD_LS
+.
+.HP
+.B dmsetup
+.de CMD_MANGLE
+. BR mangle
+. RI [ device_name ]
+..
+.CMD_MANGLE
+.
+.HP
+.B dmsetup
+.de CMD_MESSAGE
+. BR message
+. IR device_name
+. IR sector
+. IR message
+..
+.CMD_MESSAGE
+.
+.HP
+.B dmsetup
+.de CMD_MKNODES
+. BR mknodes
+. RI [ device_name ]
+..
+.CMD_MKNODES
+.
+.HP
+.B dmsetup
+.de CMD_RELOAD
+. ad l
+. BR reload
+. IR device_name
+. RB [ \-\-table
+. RI { table | table_file }]
+. ad b
+..
+.CMD_RELOAD
+.
+.HP
+.B dmsetup
+.de CMD_REMOVE
+. ad l
+. BR remove
+. RB [ \-f | \-\-force ]
+. RB [ \-\-retry ]
+. RB [ \-\-deferred ]
+. IR device_name
+. ad b
+..
+.CMD_REMOVE
+.
+.HP
+.B dmsetup
+.de CMD_REMOVE_ALL
+. BR remove_all
+. RB [ \-f | \-\-force ]
+. RB [ \-\-deferred ]
+..
+.CMD_REMOVE_ALL
+.
+.HP
+.B dmsetup
+.de CMD_RENAME
+. BR rename
+. IR device_name
+. IR new_name
+..
+.CMD_RENAME
+.
+.HP
+.B dmsetup
+.de CMD_RENAME_UUID
+. BR rename
+. IR device_name
+. BR \-\-setuuid
+. IR uuid
+..
+.CMD_RENAME_UUID
+.
+.HP
+.B dmsetup
+.de CMD_RESUME
+. ad l
+. BR resume
+. IR device_name
+. RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
+. RB [ \-\-noflush ]
+. RB [ \-\-nolockfs ]
+. RB \%[ \-\-readahead
+. RB \%{[ + ] \fIsectors | auto | none }]
+. ad b
+..
+.CMD_RESUME
+.
+.HP
+.B dmsetup
+.de CMD_SETGEOMETRY
+. ad l
+. BR setgeometry
+. IR device_name
+. IR cyl
+. IR head
+. IR sect
+. IR start
+. ad b
+..
+.CMD_SETGEOMETRY
+.
+.HP
+.B dmsetup
+.de CMD_SPLITNAME
+. BR splitname
+. IR device_name
+. RI [ subsystem ]
+..
+.CMD_SPLITNAME
+.
+.HP
+.B dmsetup
+.de CMD_STATS
+. BR stats
+. IR command
+. RI [ options ]
+..
+.CMD_STATS
+.
+.HP
+.B dmsetup
+.de CMD_STATUS
+. ad l
+. BR status
+. RB [ \-\-target
+. IR target_type ]
+. RB [ \-\-noflush ]
+. RI [ device_name ]
+. ad b
+..
+.CMD_STATUS
+.
+.HP
+.B dmsetup
+.de CMD_SUSPEND
+. ad l
+. BR suspend
+. RB [ \-\-nolockfs ]
+. RB [ \-\-noflush ]
+. IR device_name
+. ad b
+..
+.CMD_SUSPEND
+.
+.HP
+.B dmsetup
+.de CMD_TABLE
+. ad l
+. BR table
+. RB [ \-\-target
+. IR target_type ]
+. RB [ \-\-showkeys ]
+. RI [ device_name ]
+. ad b
+..
+.CMD_TABLE
+.
+.HP
+.B dmsetup
+.de CMD_TARGETS
+. BR targets
+..
+.CMD_TARGETS
+.
+.HP
+.B dmsetup
+.de CMD_UDEVCOMPLETE
+. BR udevcomplete
+. IR cookie
+..
+.CMD_UDEVCOMPLETE
+.
+.HP
+.B dmsetup
+.de CMD_UDEVCOMPLETE_ALL
+. BR udevcomplete_all
+. RI [ age_in_minutes ]
+..
+.CMD_UDEVCOMPLETE_ALL
+.
+.HP
+.B dmsetup
+.de CMD_UDEVCOOKIES
+. BR udevcookie
+..
+.CMD_UDEVCOOKIES
+.
+.HP
+.B dmsetup
+.de CMD_UDEVCTEATECOOKIE
+. BR udevcreatecookie
+..
+.CMD_UDEVCTEATECOOKIE
+.
+.HP
+.B dmsetup
+.de CMD_UDEVFLAGS
+. BR udevflags
+. IR cookie
+..
+.CMD_UDEVFLAGS
+.
+.HP
+.B dmsetup
+.de CMD_UDEVRELEASECOOKIE
+. BR udevreleasecookie
+. RI [ cookie ]
+..
+.CMD_UDEVRELEASECOOKIE
+.
+.HP
+.B dmsetup
+.de CMD_VERSION
+. BR version
+..
+.CMD_VERSION
+.
+.HP
+.B dmsetup
+.de CMD_WAIT
+. ad l
+. BR wait
+. RB [ \-\-noflush ]
+. IR device_name
+. RI [ event_nr ]
+. ad b
+..
+.CMD_WAIT
+.
+.HP
+.B dmsetup
+.de CMD_WIPE_TABLE
+. ad l
+. BR wipe_table
+. IR device_name
+. RB [ \-f | \-\-force ]
+. RB [ \-\-noflush ]
+. RB [ \-\-nolockfs ]
+. ad b
+..
+.CMD_WIPE_TABLE
+.PD
+.P
.HP
-.B dmsetup clear
-.I device_name
-.HP
-.B dmsetup create
-.I device_name
-.RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
-.RB [ \-\-readahead
-.RB {[ + ] \fIsectors | auto | none }]
-.RB [ \-u
-.IR uuid ]
-.RB [ \-n | \-\-notable | \-\-table
-.RI { table | table_file }]
-.HP
-.B dmsetup deps
-.RB [ \-o
-.IR options ]
-.RI [ device_name ]
-.HP
-.B dmsetup help
-.RB [ \-c | \-C | \-\-columns ]
-.HP
-.B dmsetup info
-.RI [ device_name ]
-.HP
-.B dmsetup info
-.BR \-c | \-C | \-\-columns
-.RB [ \-\-count
-.IR count ]
-.RB [ \-\-interval
-.IR seconds ]
-.RB [ \-\-nameprefixes ]
-.RB [ \-\-noheadings ]
-.RB [ \-o
-.IR fields ]
-.RB [ \-O | \-\-sort
-.IR sort_fields ]
-.RB [ \-S | \-\-select
-.IR selection ]
-.RB [ \-\-separator
-.IR separator ]
-.RI [ device_name ]
-.HP
-.B dmsetup load
-.I device_name
-.RB [ \-\-table
-.RI { table | table_file }]
-.HP
-.B dmsetup ls
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-exec
-.IR command ]
-.RB [ \-\-tree ]
-.RB [ \-o
-.IR options ]
-.HP
-.B dmsetup message
-.I device_name sector message
-.HP
-.B dmsetup mknodes
-.RI [ device_name ]
-.HP
-.B dmsetup mangle
-.RI [ device_name ]
-.HP
-.B dmsetup reload
-.I device_name
-.RB [ \-\-table
-.RI { table | table_file }]
-.HP
-.B dmsetup remove
-.RB [ \-f | \-\-force ]
-.RB [ \-\-retry ]
-.RB [ \-\-deferred ]
-.I device_name
-.HP
-.B dmsetup remove_all
-.RB [ \-f | \-\-force ]
-.RB [ \-\-deferred ]
-.HP
-.B dmsetup rename
-.I device_name new_name
-.HP
-.B dmsetup rename
-.I device_name
-.B \-\-setuuid
-.I uuid
-.HP
-.B dmsetup resume
-.I device_name
-.RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
-.RB [ \-\-readahead
-.RB {[ + ] \fIsectors | auto | none }]
-.HP
-.B dmsetup setgeometry
-.I device_name cyl head sect start
-.HP
-.B dmsetup splitname
-.I device_name
-.RI [ subsystem ]
-.HP
-.B dmsetup stats
-.I command
-.RI [ options ]
-.HP
-.B dmsetup status
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-noflush ]
-.RI [ device_name ]
-.HP
-.B dmsetup suspend
-.RB [ \-\-nolockfs ]
-.RB [ \-\-noflush ]
-.I device_name
-.HP
-.B dmsetup table
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-showkeys ]
-.RI [ device_name ]
-.HP
-.B dmsetup targets
-.HP
-.B dmsetup udevcomplete
-.I cookie
-.HP
-.B dmsetup udevcomplete_all
-.RI [ age_in_minutes ]
-.HP
-.B dmsetup udevcookies
-.HP
-.B dmsetup udevcreatecookie
-.HP
-.B dmsetup udevflags
-.I cookie
-.HP
-.B dmsetup udevreleasecookie
-.RI [ cookie ]
-.HP
-.B dmsetup version
-.HP
-.B dmsetup wait
-.RB [ \-\-noflush ]
-.I device_name
-.RI [ event_nr ]
-.HP
-.B dmsetup wipe_table
-.I device_name
-.RB [ \-f | \-\-force ]
-.RB [ \-\-noflush ]
-.RB [ \-\-nolockfs ]
-.HP
-.B devmap_name
-.I major minor
+.PD 0
+.B devmap_name \fImajor minor
.HP
-.B devmap_name
-.I major:minor
-.ad b
+.B devmap_name \fImajor:minor
.PD
+.ad b
+.
.SH DESCRIPTION
+.
dmsetup manages logical devices that use the device-mapper driver.
Devices are created by loading a table that specifies a target for
each sector (512 bytes) in the logical device.
@@ -173,166 +380,235 @@ each sector (512 bytes) in the logical device.
The first argument to dmsetup is a command.
The second argument is the logical device name or uuid.
-Invoking the command as \fBdevmap_name\fP is equivalent to
-.br
-\fBdmsetup info \-c \-\-noheadings \-j \fImajor\fB \-m \fIminor\fP.
+Invoking the dmsetup tool as \fBdevmap_name\fP
+(which is not normally distributed and is supported
+only for historical reasons) is equivalent to
+.BI \%dmsetup\ info\ \-c\ \-\-noheadings\ \-j \ major\ \-m \ minor \c
+\fR.
+.\" dot above here fixes -Thtml rendering for next HP option
+.
.SH OPTIONS
-.TP
-.B \-\-addnodeoncreate
-Ensure /dev/mapper node exists after dmsetup create.
-.TP
-.B \-\-addnodeonresume
-Ensure /dev/mapper node exists after dmsetup resume (default with udev).
-.TP
-.B \-\-checks
+.
+.HP
+.BR \-\-addnodeoncreate
+.br
+Ensure \fI/dev/mapper\fP node exists after \fBdmsetup create\fP.
+.
+.HP
+.BR \-\-addnodeonresume
+.br
+Ensure \fI/dev/mapper\fP node exists after \fBdmsetup resume\fP (default with udev).
+.
+.HP
+.BR \-\-checks
+.br
Perform additional checks on the operations requested and report
potential problems. Useful when debugging scripts.
In some cases these checks may slow down operations noticeably.
-.TP
+.
+.HP
.BR \-c | \-C | \-\-columns
+.br
Display output in columns rather than as Field: Value lines.
-.TP
-.B \-\-count \fIcount
+.
+.HP
+.BR \-\-count
+.IR count
+.br
Specify the number of times to repeat a report. Set this to zero
continue until interrupted. The default interval is one second.
-.TP
+.
+.HP
.BR \-f | \-\-force
+.br
Try harder to complete operation.
-.TP
+.
+.HP
.BR \-h | \-\-help
+.br
Outputs a summary of the commands available, optionally including
the list of report fields (synonym with \fBhelp\fP command).
-.TP
-.B \-\-inactive
+.
+.HP
+.BR \-\-inactive
+.br
When returning any table information from the kernel report on the
inactive table instead of the live table.
Requires kernel driver version 4.16.0 or above.
-.TP
-.B \-\-interval \fIseconds
+.
+.HP
+.BR \-\-interval
+.IR seconds
+.br
Specify the interval in seconds between successive iterations for
repeating reports. If \fB\-\-interval\fP is specified but \fB\-\-count\fP
is not, reports will continue to repeat until interrupted.
The default interval is one second.
-.TP
-.BR \-\-manglename \ { none | hex | auto }
+.
+.HP
+.BR \-\-manglename
+.RB { auto | hex | none }
+.br
Mangle any character not on a whitelist using mangling_mode when
processing device-mapper device names and UUIDs. The names and UUIDs
are mangled on input and unmangled on output where the mangling mode
is one of:
-\fBnone\fP (no mangling),
-\fBhex\fP (always do the mangling) and
\fBauto\fP (only do the mangling if not mangled yet, do nothing
-if already mangled, error on mixed)
+if already mangled, error on mixed),
+\fBhex\fP (always do the mangling) and
+\fBnone\fP (no mangling).
Default mode is \fB#DEFAULT_MANGLING#\fP.
Character whitelist: 0-9, A-Z, a-z, #+-.:=@_. This whitelist is
also supported by udev. Any character not on a whitelist is replaced
with its hex value (two digits) prefixed by \\x.
Mangling mode could be also set through
-.B DM_DEFAULT_NAME_MANGLING_MODE
+\fBDM_DEFAULT_NAME_MANGLING_MODE\fP
environment variable.
-.TP
-.BR \-j | \-\-major\ \fImajor
+.
+.HP
+.BR \-j | \-\-major
+.IR major
+.br
Specify the major number.
-.TP
-.BR \-m | \-\-minor\ \fIminor
+.
+.HP
+.BR \-m | \-\-minor
+.IR minor
+.br
Specify the minor number.
-.TP
+.
+.HP
.BR \-n | \-\-notable
+.br
When creating a device, don't load any table.
-.TP
+.
+.HP
.BR \-\-nameprefixes
+.br
Add a "DM_" prefix plus the field name to the output. Useful with
\fB\-\-noheadings\fP to produce a list of
field=value pairs that can be used to set environment variables
(for example, in
.BR udev (7)
rules).
-.TP
+.
+.HP
.BR \-\-noheadings
Suppress the headings line when using columnar output.
-.TP
-.B \-\-noflush
+.
+.HP
+.BR \-\-noflush
Do not flush outstading I/O when suspending a device, or do not
commit thin-pool metadata when obtaining thin-pool status.
-.TP
-.B \-\-nolockfs
+.
+.HP
+.BR \-\-nolockfs
+.br
Do not attempt to synchronize filesystem eg, when suspending a device.
-.TP
-.B \-\-noopencount
+.
+.HP
+.BR \-\-noopencount
+.br
Tell the kernel not to supply the open reference count for the device.
-.TP
-.B \-\-noudevrules
+.
+.HP
+.BR \-\-noudevrules
+.br
Do not allow udev to manage nodes for devices in device-mapper directory.
-.TP
-.B \-\-noudevsync
+.
+.HP
+.BR \-\-noudevsync
+.br
Do not synchronise with udev when creating, renaming or removing devices.
-.TP
+.
+.HP
.BR \-o | \-\-options
+.IR options
+.br
Specify which fields to display.
-.TP
-.BR \-\-readahead \ {[ + ] \fIsectors | auto | none }
+.
+.HP
+.BR \-\-readahead
+.RB {[ + ] \fIsectors | auto | none }
+.br
Specify read ahead size in units of sectors.
The default value is \fBauto\fP which allows the kernel to choose
a suitable value automatically. The \fB+\fP prefix lets you
specify a minimum value which will not be used if it is
smaller than the value chosen by the kernel.
The value \fBnone\fP is equivalent to specifying zero.
-.TP
+.
+.HP
.BR \-r | \-\-readonly
+.br
Set the table being loaded read-only.
-.TP
-.BR \-S | \-\-select \ \fIselection
+.
+.HP
+.BR \-S | \-\-select
+.IR selection
+.br
Display only rows that match \fIselection\fP criteria. All rows are displayed
with the additional "selected" column (\fB-o selected\fP) showing 1 if the row
matches the \fIselection\fP and 0 otherwise. The selection criteria are defined
by specifying column names and their valid values while making use of
supported comparison operators. As a quick help and to see full list of
column names that can be used in selection and the set of supported
-selection operators, check the output of \fBdmsetup info -c -S help\fP
+selection operators, check the output of \fBdmsetup\ info\ -c\ -S\ help\fP
command.
-.TP
-.IR \fB\-\-table \ table
+.
+.HP
+.BR \-\-table
+.IR table
+.br
Specify a one-line table directly on the command line.
See below for more information on the table format.
-.TP
-.B \-\-udevcookie \fIcookie
+.
+.HP
+.BR \-\-udevcookie
+.IR cookie
+.br
Use cookie for udev synchronisation.
Note: Same cookie should be used for same type of operations i.e. creation of
multiple different devices. It's not adviced to combine different
operations on the single device.
-.TP
+.
+.HP
.BR \-u | \-\-uuid
+.br
Specify the \fIuuid\fP.
-.TP
+.
+.HP
.BR \-y | \-\-yes
+.br
Answer yes to all prompts automatically.
-.TP
-.BR \-v | \-\-verbose \ [ \-v | \-\-verbose ]
+.
+.HP
+.BR \-v | \-\-verbose
+.RB [ \-v | \-\-verbose ]
+.br
Produce additional output.
-.TP
-.B \-\-verifyudev
+.
+.HP
+.BR \-\-verifyudev
+.br
If udev synchronisation is enabled, verify that udev operations get performed
correctly and try to fix up the device nodes afterwards if not.
-.TP
-.B \-\-version
+.
+.HP
+.BR \-\-version
+.br
Display the library and kernel driver version.
.br
+.
.SH COMMANDS
+.
.HP
-.B clear
-.I device_name
+.CMD_CLEAR
.br
Destroys the table in the inactive table slot for device_name.
+.
.HP
-.B create
-.I device_name
-.RB [ \-u
-.IR uuid ]
-.RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
-.RB [ \-n | \-\-notable | \-\-table
-.RI { table | table_file }]
-.RB [ \-\-readahead
-.RB {[ + ] \fIsectors | auto | none }]
+.CMD_CREATE
.br
Creates a device with the given name.
If \fItable\fP or \fItable_file\fP is supplied, the table is loaded and made live.
@@ -340,28 +616,26 @@ Otherwise a table is read from standard input unless \fB\-\-notable\fP is used.
The optional \fIuuid\fP can be used in place of
device_name in subsequent dmsetup commands.
If successful the device will appear in table and for live
-device the node /dev/mapper/\fIdevice_name\fP is created.
+device the node \fI/dev/mapper/device_name\fP is created.
See below for more information on the table format.
+.
.HP
-.B deps
-.RB [ \-o
-.IR options ]
-.RI [ device_name ]
+.CMD_DEPS
.br
Outputs a list of devices referenced by the live table for the specified
device. Device names on output can be customised by following \fIoptions\fP:
\fBdevno\fP (major and minor pair, used by default),
\fBblkdevname\fP (block device name),
\fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
+.
.HP
-.B help
-.RB [ \-c | \-C | \-\-columns ]
+.CMD_HELP
.br
Outputs a summary of the commands available, optionally including
the list of report fields.
+.
.HP
-.B info
-.RI [ device_name ]
+.CMD_INFO
.br
Outputs some brief information about the device in the form:
.RS
@@ -376,45 +650,38 @@ Outputs some brief information about the device in the form:
.RE
.RE
.HP
-.B info
-.BR \-c | \-C | \-\-columns
-.RB [ \-\-count
-.IR count ]
-.RB [ \-\-interval
-.IR seconds ]
-.RB [ \-\-nameprefixes ]
-.RB [ \-\-noheadings ]
-.RB [ \-o
-.IR fields ]
-.RB [ \-O | \-\-sort
-.IR sort_fields ]
-.RB [ \-\-separator
-.IR separator ]
-.RI [ device_name ]
+.CMD_INFOLONG
.br
Output you can customise.
Fields are comma-separated and chosen from the following list:
-name, major, minor, attr, open, segments, events, uuid.
-Attributes are: (L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.
+.BR name ,
+.BR major ,
+.BR minor ,
+.BR attr ,
+.BR open ,
+.BR segments ,
+.BR events ,
+.BR uuid .
+Attributes are:
+.RI ( L )ive,
+.RI ( I )nactive,
+.RI ( s )uspended,
+.RI ( r )ead-only,
+.RI read-( w )rite.
Precede the list with '\fB+\fP' to append
to the default selection of columns instead of replacing it.
-Precede any sort_field with '\fB-\fP' for a reverse sort on that column.
+Precede any sort field with '\fB-\fP' for a reverse sort on that column.
+.
.HP
-.B ls
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-exec
-.IR command ]
-.RB [ \-\-tree ]
-.RB [ \-o
-.IR options ]
+.CMD_LS
.br
List device names. Optionally only list devices that have at least
one target of the specified type. Optionally execute a command for
each device. The device name is appended to the supplied command.
-Device names on output can be customised by following options: devno (major
-and minor pair, used by default), blkdevname (block device name),
-devname (map name for device-mapper devices, equal to blkdevname otherwise).
+Device names on output can be customised by following options:
+\fBdevno\fP (major and minor pair, used by default),
+\fBblkdevname\fP (block device name),
+\fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
\fB\-\-tree\fP displays dependencies between devices as a tree.
It accepts a comma-separate list of \fIoptions\fP.
Some specify the information displayed against each node:
@@ -424,17 +691,16 @@ Some specify the information displayed against each node:
Others specify how the tree is displayed:
.BR ascii ", " utf ", " vt100 ;
.BR compact ", " inverted ", " notrunc .
+.
.HP
-.BR load | reload
-.I device_name
-.RB [ \-\-table
-.RI { table | table_file }]
+.BR load | \c
+.CMD_RELOAD
.br
Loads \fItable\fP or \fItable_file\fP into the inactive table slot for device_name.
If neither is supplied, reads a table from standard input.
+.
.HP
-.B mangle
-.RI [ device_name ]
+.CMD_MANGLE
.br
Ensure existing device-mapper \fIdevice_name\fP and UUID is in the correct mangled
form containing only whitelisted characters (supported by udev) and do
@@ -444,25 +710,22 @@ names and not for device UUIDs because the kernel does not allow changing
the UUID of active devices. Any incorrect UUIDs are reported only and they
must be manually corrected by deactivating the device first and then
reactivating it with proper mangling mode used (see also \fB\-\-manglename\fP).
+.
.HP
-.B message
-.I device_name sector message
+.CMD_MESSAGE
.br
Send message to target. If sector not needed use 0.
+.
.HP
-.B mknodes
-.RI [ device_name ]
+.CMD_MKNODES
.br
-Ensure that the node in /dev/mapper for device_name is correct.
-If no device_name is supplied, ensure that all nodes in /dev/mapper
+Ensure that the node in \fI/dev/mapper\fP for \fIdevice_name\fP is correct.
+If no device_name is supplied, ensure that all nodes in \fI/dev/mapper\fP
correspond to mapped devices currently loaded by the device-mapper kernel
driver, adding, changing or removing nodes as necessary.
+.
.HP
-.B remove
-.RB [ \-f | \-\-force ]
-.RB [ \-\-retry ]
-.RB [ \-\-deferred ]
-.I device_name
+.CMD_REMOVE
.br
Removes a device. It will no longer be visible to dmsetup. Open devices
cannot be removed, but adding \fB\-\-force\fP will replace the table with one
@@ -477,10 +740,9 @@ Do NOT combine
\fB\-\-force\fP and \fB\-\-udevcookie\fP, as udev may start to process udev
rules in the middle of error target replacement and result in nondeterministic
result.
+.
.HP
-.B remove_all
-.RB [ \-f | \-\-force ]
-.RB [ \-\-deferred ]
+.CMD_REMOVE_ALL
.br
Attempts to remove all device definitions i.e. reset the driver. This also runs
\fBmknodes\fP afterwards. Use with care! Open devices cannot be removed, but
@@ -489,42 +751,34 @@ adding \fB\-\-force\fP will replace the table with one that fails all I/O.
will be removed when the last user closes it. The deferred removal feature is
supported since version 4.27.0 of the device-mapper driver available in
upstream kernel version 3.13.
+.
.HP
-.B rename
-.I device_name new_name
+.CMD_RENAME
.br
Renames a device.
+.
.HP
-.B rename
-.I device_name
-.B \-\-setuuid
-.I uuid
+.CMD_RENAME_UUID
.br
Sets the uuid of a device that was created without a uuid.
After a uuid has been set it cannot be changed.
+.
.HP
-.B resume
-.I device_name
-.RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
-.RB [ \-\-nolockfs ]
-.RB [ \-\-noflush ]
-.RB [ \-\-readahead
-.RB {[ + ] \fIsectors | auto | none }]
+.CMD_RESUME
.br
Un-suspends a device.
If an inactive table has been loaded, it becomes live.
Postponed I/O then gets re-queued for processing.
+.
.HP
-.B setgeometry
-.I device_name cyl head sect start
+.CMD_SETGEOMETRY
.br
Sets the device geometry to C/H/S.
+.
.HP
-.B splitname
-.I device_name
-.RI [ subsystem ]
+.CMD_SPLITNAME
.br
-Splits given device name into subsystem constituents.
+Splits given \fIdevice name\fP into \fIsubsystem\fP constituents.
The default subsystem is LVM.
LVM currently generates device names by concatenating the names of the Volume
Group, Logical Volume and any internal Layer with a hyphen as separator.
@@ -533,30 +787,22 @@ The precise encoding might change without notice in any future
release, so we recommend you always decode using the current version of
this command.
.HP
-.B stats
-.I command
-.RI [ options ]
+.BR stats " " \fIcommand " [" \fIoptions ]
.br
Manages IO statistics regions for devices.
-See
+See
.BR dmstats (8)
for more details.
.HP
-.B status
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-noflush ]
-.RI [ device_name ]
+.CMD_STATS
.br
Outputs status information for each of the device's targets.
With \fB\-\-target\fP, only information relating to the specified target type
any is displayed. With \fB\-\-noflush\fP, the thin target (from version 1.3.0)
doesn't commit any outstanding changes to disk before reporting its statistics.
+
.HP
-.B suspend
-.RB [ \-\-nolockfs ]
-.RB [ \-\-noflush ]
-.I device_name
+.CMD_SUSPEND
.br
Suspends a device. Any I/O that has already been mapped by the device
but has not yet completed will be flushed. Any further I/O to that
@@ -566,12 +812,9 @@ an attempt will be made to sync it first unless \fB\-\-nolockfs\fP is specified.
Some targets such as recent (October 2006) versions of multipath may support
the \fB\-\-noflush\fP option. This lets outstanding I/O that has not yet reached the
device to remain unflushed.
+.
.HP
-.B table
-.RB [ \-\-target
-.IR target_type ]
-.RB [ \-\-showkeys ]
-.RI [ device_name ]
+.CMD_TABLE
.br
Outputs the current table for the device in a format that can be fed
back in using the create or load commands.
@@ -579,28 +822,31 @@ With \fB\-\-target\fP, only information relating to the specified target type
is displayed.
Encryption keys are suppressed in the table output for the crypt
target unless the \fB\-\-showkeys\fP parameter is supplied.
+.
.HP
-.B targets
+.CMD_TARGETS
.br
Displays the names and versions of the currently-loaded targets.
+.
.HP
-.B udevcomplete
-.I cookie
+.CMD_UDEVCOMPLETE
.br
Wake any processes that are waiting for udev to complete processing the specified cookie.
+.
.HP
-.B udevcomplete_all
-.RI [ age_in_minutes ]
+.CMD_UDEVCOMPLETE_ALL
.br
Remove all cookies older than the specified number of minutes.
Any process waiting on a cookie will be resumed immediately.
+.
.HP
-.B udevcookies
+.CMD_UDEVCOOKIES
.br
List all existing cookies. Cookies are system-wide semaphores with keys
prefixed by two predefined bytes (0x0D4D).
+.
.HP
-.B udevcreatecookie
+.CMD_UDEVCREATECOOKIE
.br
Creates a new cookie to synchronize actions with udev processing.
The output is a cookie value. Normally we don't need to create cookies since
@@ -612,33 +858,32 @@ of the dmsetup process as \fBDM_UDEV_COOKIE\fP variable and it will be used auto
with all subsequent commands until it is unset.
Invoking this command will create system-wide semaphore that needs to be cleaned
up explicitly by calling udevreleasecookie command.
+.
.HP
-.B udevflags
-.I cookie
+.CMD_UDEVFLAGS
.br
-Parses given cookie value and extracts any udev control flags encoded.
+Parses given \fIcookie\fP value and extracts any udev control flags encoded.
The output is in environment key format that is suitable for use in udev
rules. If the flag has its symbolic name assigned then the output is
-DM_UDEV_FLAG_<flag_name>='1', DM_UDEV_FLAG<flag_position>='1' otherwise.
+DM_UDEV_FLAG_<flag_name> = '1', DM_UDEV_FLAG<flag_position> = '1' otherwise.
Subsystem udev flags don't have symbolic names assigned and these ones are
-always reported as DM_SUBSYSTEM_UDEV_FLAG<flag_position>='1'. There are
+always reported as DM_SUBSYSTEM_UDEV_FLAG<flag_position> = '1'. There are
16 udev flags altogether.
+.
.HP
-.B udevreleasecookie
-.RI [ cookie ]
+.CMD_UDEVRELEASECOOKIE
.br
Waits for all pending udev processing bound to given cookie value and clean up
the cookie with underlying semaphore. If the cookie is not given directly,
the command will try to use a value defined by \fBDM_UDEV_COOKIE\fP environment variable.
+.
.HP
-.B version
+.CMD_VERSION
.br
Outputs version information.
+.
.HP
-.B wait
-.RB [ \-\-noflush ]
-.I device_name
-.RI [ event_nr ]
+.CMD_WAIT
.br
Sleeps until the event counter for device_name exceeds event_nr.
Use \fB\-v\fP to see the event number returned.
@@ -646,39 +891,30 @@ To wait until the next event is triggered, use \fBinfo\fP to find
the last event number.
With \fB\-\-noflush\fP, the thin target (from version 1.3.0) doesn't commit
any outstanding changes to disk before reporting its statistics.
+.
.HP
-.B wipe_table
-.I device_name
-.RB [ \-f | \-\-force ]
-.RB [ \-\-noflush ]
-.RB [ \-\-nolockfs ]
+.CMD_WIPE_TABLE
.br
Wait for any I/O in-flight through the device to complete, then
replace the table with a new table that fails any new I/O
sent to the device. If successful, this should release any devices
held open by the device's table(s).
+.
.SH TABLE FORMAT
+.
Each line of the table specifies a single target and is of the form:
-.P
+.sp
.I logical_start_sector num_sectors
.B target_type
.I target_args
-.P
-Simple target types and \fItarget_args\fP include:
-.HP
-.PD 0
-.B linear
-.I destination_device
-.I start_sector
-.br
+.sp
+Simple target types and target args include:
+.
+.TP
+.B linear \fIdestination_device start_sector
The traditional linear mapping.
-.HP
-.B striped
-.I num_stripes
-.I chunk_size
-.RI [ destination
-.IR start_sector ]...
-.br
+.TP
+.B striped \fInum_stripes chunk_size \fR[\fIdestination start_sector\fR]...
Creates a striped area.
.br
e.g. striped 2 32 /dev/hda1 0 /dev/hdb1 0
@@ -692,93 +928,78 @@ will map the first chunk (16k) as follows:
etc.
.RE
.RE
-.HP
+.TP
.B error
-.br
Errors any I/O that goes to this area. Useful for testing or
for creating devices with holes in them.
-.HP
+.TP
.B zero
-.br
Returns blocks of zeroes on reads. Any data written is discarded silently.
-This is a block-device equivalent of the /dev/zero character-device data sink
-described in \fBnull\fP(4).
-.PD
-.HP
+This is a block-device equivalent of the \fI/dev/zero\fP
+character-device data sink described in \fBnull\fP(4).
+.P
More complex targets include:
-.HP
-.PD 0
+.TP
.B cache
-.br
Improves performance of a block device (eg, a spindle) by dynamically
migrating some of its data to a faster smaller device (eg, an SSD).
-.HP
+.TP
.B crypt
-.br
Transparent encryption of block devices using the kernel crypto API.
-.HP
+.TP
.B delay
-.br
Delays reads and/or writes to different devices. Useful for testing.
-.HP
+.TP
.B flakey
-.br
Creates a similar mapping to the linear target but
exhibits unreliable behaviour periodically.
Useful for simulating failing devices when testing.
-.HP
+.TP
.B mirror
-.br
Mirrors data across two or more devices.
-.HP
+.TP
.B multipath
-.br
Mediates access through multiple paths to the same device.
-.HP
+.TP
.B raid
-.br
Offers an interface to the kernel's software raid driver, md.
-.HP
+.TP
.B snapshot
-.br
Supports snapshots of devices.
-.HP
-.BR thin ,\ thin-pool
-.br
+.TP
+.BR thin ", " thin-pool
Supports thin provisioning of devices and also provides a better snapshot support.
-.PD
.P
To find out more about the various targets and their table formats and status
lines, please read the files in the Documentation/device-mapper directory in
the kernel source tree.
(Your distribution might include a copy of this information in the
documentation directory for the device-mapper package.)
-
+.
.SH EXAMPLES
-
+.
# A table to join two disks together
.br
-.br
0 1028160 linear /dev/hda 0
.br
1028160 3903762 linear /dev/hdb 0
-
-
+.br
# A table to stripe across the two disks,
.br
# and add the spare space from
.br
# hdb to the back of the volume
-
+.br
0 2056320 striped 2 32 /dev/hda 0 /dev/hdb 0
.br
2056320 2875602 linear /dev/hdb 1028160
-
+.
.SH ENVIRONMENT VARIABLES
+.
.TP
.B DM_DEV_DIR
The device directory name.
-Defaults to "/dev" and must be an absolute path.
+Defaults to "\fI/dev\fP" and must be an absolute path.
.TP
.B DM_UDEV_COOKIE
A cookie to use for all relevant commands to synchronize with udev processing.
@@ -787,15 +1008,17 @@ It is an alternative to using \fB\-\-udevcookie\fP option.
.B DM_DEFAULT_NAME_MANGLING_MODE
A default mangling mode. Defaults to "\fB#DEFAULT_MANGLING#\fP"
and it is an alternative to using \fB\-\-manglename\fP option.
-
+.
.SH AUTHORS
-Original version: Joe Thornber (thornber(a)redhat.com)
-
+.
+Original version: Joe Thornber <thornber(a)redhat.com>
+.
.SH SEE ALSO
+.
.BR dmstats (8),
.BR udev (7),
.BR udevadm (8)
-
-LVM2 resource page https://www.sourceware.org/lvm2/
+.P
+LVM2 resource page: https://www.sourceware.org/lvm2/
.br
Device-mapper resource page: http://sources.redhat.com/dm/
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index 985f3fd..9776aa7 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -1,278 +1,420 @@
.TH DMSTATS 8 "Jul 25 2015" "Linux" "MAINTENANCE COMMANDS"
+
+.de OPT_PROGRAMS
+. RB \%[ \-\-allprograms | \-\-programid
+. IR id ]
+..
+.
+.de OPT_REGIONS
+. RB \%[ \-\-allregions | \-\-regionid
+. IR id ]
+..
+.
+.\" Print units suffix, use with arg to print human
+.\" man2html can't handle too many changes per command
+.de UNITS
+. BR b | B | s | S | k | K | m | M | \c
+. BR g | G | t | T | p | P | e | E ]
+..
+.
+.\" Print help text for units, use with arg to print human
+.de HELP_UNITS
+. RB ( b )ytes,
+. RB ( s )ectors,
+. RB ( k )ilobytes,
+. RB ( m )egabytes,
+. RB ( g )igabytes,
+. RB ( t )erabytes,
+. RB ( p )etabytes,
+. RB ( e )xabytes.
+. nop Capitalise to use multiples of 1000 (S.I.) instead of 1024.
+..
+.
.SH NAME
+.
dmstats \(em device-mapper statistics management
+.
.SH SYNOPSIS
-.ad l
-.B dmsetup stats
+.
+.B dmsetup
+.B stats
.I command
.RB [ options ]
-.HP
+.sp
+.
.PD 0
+.HP
.B dmstats
-.I command
-.RI [ device_name | \fB\-\-uuid
-.IR uuid | \fB\-\-major
-.I major
-.B \-\-minor
-.IR minor ]
-.HP
-.B dmstats clear
-.I device_name
-.RB [ \-\-allregions | \-\-regionid
-.IR id ]
-.HP
-.B dmstats create
-.I device_name
-.RB [ \-\-alldevices ]
-.RB [ \-\-areas
-.IR nr_areas | \fB\-\-areasize
-.IR area_size ]
-.RB [ \-\-bounds
-.IR histogram_boundaries ]
-.RB [ \-\-precise ]
-.RB [ \-\-start
-.I start_sector
-.B \-\-length
-.IR length | \fB\-\-segments ]
-.RB [ \-\-auxdata
-.IR data ]
-.RB [ \-\-programid
-.IR id ]
-.HP
-.B dmstats delete
-.I device_name
-.RB [ \-\-alldevices ]
-.RB [ \-\-allregions | \-\-regionid
-.IR id ]
-.RB [ \-\-allprograms | \-\-programid
-.IR id ]
-.HP
-.B dmstats help
-.RB [ \-c | \-C | \-\-columns ]
-.HP
-.B dmstats list
-.RI [ device_name ]
-.RB [ \-\-allprograms | \-\-programid
-.IR id ]
-.RB [ \-\-histogram ]
-.RB [ \-\-units
-.IR units ]
-.RB [ \-\-nosuffix ]
-.RB [ \-\-notimesuffix ]
-.RB [ \-v | \-\-verbose \ [ \-v | \-\-verbose ]]
-.HP
-.B dmstats print
-.RI [ device_name ]
-.RB [ \-\-clear ]
-.RB [ \-\-allprograms | \-\-programid
-.IR id ]
-.RB [ \-\-allregions | \-\-regionid
-.IR id ]
+.de CMD_COMMAND
+. ad l
+. IR command
+. RI [ device_name
+. RB | \-\-uuid
+. IR uuid | \fB\-\-major
+. IR major
+. BR \-\-minor
+. IR minor ]
+. ad b
+..
+.CMD_COMMAND
+.
.HP
-.B dmstats report
-.RI [ device_name ]
-.RB [ \-\-interval
-.IR seconds ]
-.RB [ \-\-count
-.IR count ]
-.RB [ \-\-units
-.IR units ]
-.RB [ \-\-histogram ]
-.RB [ \-\-allprograms ]
-.RB [ \-\-programid
-.IR id ]
-.RB [ \-\-regionid
-.IR id ]
-.RB [ \-O | \-\-sort
-.IR sort_fields ]
-.RB [ \-S | \-\-select
-.IR Selection ]
-.RB [ \-\-units
-.IR units ]
-.RB [ \-\-nosuffix ]
-.RB [ \-\-notimesuffix ]
-.PD
+.B dmstats
+.de CMD_CLEAR
+. ad l
+. BR clear
+. IR device_name
+. OPT_PROGRAMS
+. OPT_REGIONS
+. ad b
+..
+.CMD_CLEAR
+.
+.HP
+.B dmstats
+.de CMD_CREATE
+. ad l
+. BR create
+. IR device_name
+. RB [ \-\-alldevices ]
+. RB [ \-\-areas
+. IR nr_areas | \fB\-\-areasize
+. IR area_size ]
+. RB [ \-\-bounds
+. IR \%histogram_boundaries ]
+. RB [ \-\-precise ]
+. RB [ \-\-start
+. IR start_sector
+. BR \-\-length
+. IR length | \fB\-\-segments ]
+. RB \%[ \-\-auxdata
+. IR data ]
+. RB [ \-\-programid
+. IR id ]
+. ad b
+..
+.CMD_CREATE
+.
+.HP
+.B dmstats
+.de CMD_DELETE
+. ad l
+. BR delete
+. RI [ device_name ]
+. RB [ \-\-alldevices ]
+. OPT_PROGRAMS
+. OPT_REGIONS
+. ad b
+..
+.CMD_DELETE
+.
.HP
+.B dmstats
+.de CMD_HELP
+. ad l
+. BR help
+. RB [ \-c | \-C | \-\-columns ]
+. ad b
+..
+.CMD_HELP
+.
+.HP
+.B dmstats
+.de CMD_LIST
+. ad l
+. BR list
+. RI [ device_name ]
+. RB [ \-\-histogram ]
+. OPT_PROGRAMS
+. RB [ \-\-units
+. IR units ]
+. RB \%[ \-\-nosuffix ]
+. RB [ \-\-notimesuffix ]
+. RB \%[ \-v | \-\-verbose [ \-v | \-\-verbose ]]
+. ad b
+..
+.CMD_LIST
+.
+.HP
+.B dmstats
+.de CMD_PRINT
+. ad l
+. BR print
+. RI [ device_name ]
+. RB [ \-\-clear ]
+. OPT_PROGRAMS
+. OPT_REGIONS
+. ad b
+..
+.CMD_PRINT
+.
+.HP
+.B dmstats
+.de CMD_REPORT
+. ad l
+. BR report
+. RI [ device_name ]
+. RB [ \-\-interval
+. IR seconds ]
+. RB [ \-\-count
+. IR count ]
+. RB [ \-\-units
+. IR units ]
+. RB [ \-\-histogram ]
+. OPT_PROGRAMS
+. OPT_REGIONS
+. RB [ \-O | \-\-sort
+. IR sort_fields ]
+. RB [ \-S | \-\-select
+. IR selection ]
+. RB [ \-\-units
+. IR units ]
+. RB [ \-\-nosuffix ]
+. RB \%[ \-\-notimesuffix ]
+. ad b
+..
+.CMD_REPORT
+.
+.PD
.ad b
+.
.SH DESCRIPTION
+.
The dmstats program manages IO statistics regions for devices that use
the device-mapper driver. Statistics regions may be created, deleted,
listed and reported on using the tool.
-The first argument to dmstats is a command.
+The first argument to dmstats is a \fIcommand\fP.
-The second argument is the device name, uuid, or major and minor
-numbers.
+The second argument is the \fIdevice name\fP,
+\fIuuid\fP or \fImajor\fP and \fIminor\fP numbers.
Further options permit the selection of regions, output format
control, and reporting behaviour.
-When the program is run using the 'dmstats' alias, the command
+When the program is run using the '\fBdmstats\fP' alias, the command
\fBmust\fP be the first argument and any switches and options should be
specified following the command itself. This limitation is not present
-when run as 'dmsetup stats'.
+when run as '\fBdmsetup stats\fP'.
When no device argument is given dmstats will by default operate on all
device-mapper devices present. The \fBcreate\fP and \fBdelete\fP
-commands require the use of \fB--alldevices\fP when used in this way.
-
+commands require the use of \fB\-\-alldevices\fP when used in this way.
+.
.SH OPTIONS
-.TP
-.B \-\-alldevices
+.
+.HP
+.BR \-\-alldevices
+.br
If no device arguments are given allow operation on all devices when
creating or deleting regions.
-.TP
-.B \-\-allprograms
+.
+.HP
+.BR \-\-allprograms
+.br
Include regions from all program IDs for list and report operations.
-.TP
-.B \-\-allregions
+.br
+.HP
+.BR \-\-allregions
+.br
Include all present regions for commands that normally accept a single
region identifier.
-.TP
-.B \-\-areas \fInr_areas
+.
+.HP
+.BR \-\-areas
+.IR nr_areas
+.br
Specify the number of statistics areas to create within a new region.
-.TP
-.B \-\-areasize \fIarea_size
+.
+.HP
+.BR \-\-areasize
+.IR area_size \c
+.RB [ \c
+.UNITS
+.br
Specify the size of areas into which a new region should be divided. An
-optional suffix selects units of bBsSkKmMgGtTpPeE: (b)ytes,
-(s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes,
-(p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)
-instead of 1024.
-.TP
-.B \-\-auxdata \fIaux_data
+optional suffix selects units of:
+.HELP_UNITS
+.
+.HP
+.BR \-\-auxdata
+.IR aux_data
+.br
Specify auxilliary data (a string) to be stored with a new region.
-.TP
-.B \-\-clear
+.
+.HP
+.BR \-\-clear
+.br
When printing statistics counters, also atomically reset them to zero.
-.TP
-.B \-\-count \fIcount
+.
+.HP
+.BR \-\-count
+.IR count
+.br
Specify the iteration count for repeating reports. If the count
argument is zero reports will continue to repeat until interrupted.
-.TP
-.B \-\-bounds \fIhistogram_boundaries
+.
+.HP
+.BR \-\-bounds
+.IR histogram_boundaries \c
+.RB [ ns | us | ms | s ]
+.br
Specify the boundaries of a latency histogram to be tracked for the
region as a comma separated list of latency values. Latency values are
-given in nanoseconds. An optional unit suffix of ns, us, ms, or s may be
-given after each value to specify units of nanoseconds, microseconds,
-miliseconds or seconds respectively.
-.TP
-.B \-\-histogram
+given in nanoseconds. An optional unit suffix of
+.BR ns ,
+.BR us ,
+.BR ms ,
+or \fBs\fP may be given after each value to specify units of
+nanoseconds, microseconds, miliseconds or seconds respectively.
+.
+.HP
+.BR \-\-histogram
+.br
When used with the \fBreport\fP and \fBlist\fP commands select default
fields that emphasize latency histogram data.
-.TP
-.B \-\-interval \fIseconds
+.
+.HP
+.BR \-\-interval
+.IR seconds
+.br
Specify the interval in seconds between successive iterations for
-repeating reports. If \-\-interval is specified but \-\-count is not,
+repeating reports. If \fB\-\-interval\fP is specified but
+\fB\-\-count\fP is not,
reports will continue to repeat until interrupted.
-.TP
-.B \-\-length \fIlength
+.
+.HP
+.BR \-\-length
+.IR length \c
+.RB [ \c
+.UNITS
+.br
Specify the length of a new statistics region in sectors. An optional
-suffix selects units of bBsSkKmMgGtTpPeE: (b)ytes, (s)ectors,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes,
-(e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024.
-.TP
-.BR \-j | \-\-major\ \fImajor
+suffix selects units of:
+.HELP_UNITS
+.
+.HP
+.BR \-j | \-\-major
+.IR major
+.br
Specify the major number.
-.TP
-.BR \-m | \-\-minor\ \fIminor
+.
+.HP
+.BR \-m | \-\-minor
+.IR minor
+.br
Specify the minor number.
-.TP
-.B \-\-nosuffix
+.
+.HP
+.BR \-\-nosuffix
+.br
Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
-.TP
-.B \-\-notimesuffix
+.
+.HP
+.BR \-\-notimesuffix
+.br
Suppress the suffix on output time values. Histogram boundary values
will be reported in units of nanoseconds.
-.TP
+.
+.HP
.BR \-o | \-\-options
+.br
Specify which report fields to display.
-.TP
-.BR \-O | \-\-sort\ \fIsort_fields
+.
+.HP
+.BR \-O | \-\-sort
+.IR sort_fields
+.br
Sort output according to the list of fields given. Precede any
-sort_field with - for a reverse sort on that column.
-.TP
+sort field with '\fB-\fP' for a reverse sort on that column.
+.
+.HP
.BR \-\-precise
+.br
Attempt to use nanosecond precision counters when creating new
statistics regions.
-.TP
-.B \-\-programid \fIid
+.
+.HP
+.BR \-\-programid
+.IR id
+.br
Specify a program ID string. When creating new statistics regions this
string is stored with the region. Subsequent operations may supply a
program ID in order to select only regions with a matching value. The
default program ID for dmstats-managed regions is "dmstats".
-.TP
-.B \-\-regionid \fIid
+.
+.HP
+.BR \-\-regionid
+.IR id
+.br
Specify the region to operate on.
-.TP
+.
+.HP
.BR \-\-relative
+.br
If displaying the histogram report show relative (percentage) values
instead of absolute counts.
-.TP
-.BR \-S | \-\-select \ \fIselection
-Display only rows that match selection criteria. All rows with the
-additional "selected" column (-o selected) showing 1 if the row matches
-the selection and 0 otherwise. The selection criteria are defined by
+.
+.HP
+.BR \-S | \-\-select
+.IR selection
+.br
+Display only rows that match \fIselection\fP criteria. All rows with the
+additional "selected" column (\fB\-o selected\fP) showing 1 if the row matches
+the \fIselection\fP and 0 otherwise. The selection criteria are defined by
specifying column names and their valid values while making use of
supported comparison operators.
-.TP
-.B \-\-start \fIstart
+.
+.HP
+.BR \-\-start
+.IR start \c
+.RB [ \c
+.UNITS
+.br
Specify the start offset of a new statistics region in sectors. An
-optional suffix selects units of bBsSkKmMgGtTpPeE: (b)ytes,
-(s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes,
-(p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.)
-instead of 1024.
-.TP
-.B \-\-segments
+optional suffix selects units of:
+.HELP_UNITS
+.
+.HP
+.BR \-\-segments
+.br
Create a new statistics region for each target contained in the target
device. This causes a separate region to be allocated for each segment
of the device.
-.TP
-.BR \-\-units \ hHbBsSkKmMgGtTpPeE
-Set the display units for report output. All sizes are output in these
-units: (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes,
-(g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use
-multiples of 1000 (S.I.) instead of 1024. Can also specify custom units
-e.g. \fB\-\-units 3M\fP
-.TP
+.
+.HP
+.BR \-\-units
+.RI [ units ] \c
+.RB [ h | H | \c
+.UNITS
+.br
+Set the display units for report output.
+All sizes are output in these units:
+.RB ( h )uman-readable,
+.HELP_UNITS
+Can also specify custom units e.g. \fB\-\-units\ 3M\fP.
+.
+.HP
.BR \-u | \-\-uuid
+.br
Specify the uuid.
-.TP
-.BR \-v | \-\-verbose \ [ \-v | \-\-verbose ]
-Produce additional output.
+.
+.HP
+.BR \-v | \-\-verbose " [" \-v | \-\-verbose ]
.br
+Produce additional output.
+.
.SH COMMANDS
-.TP
-.B clear
-.I device_name
-.RB [ \-\-allregions | \-\-regionid
-.IR id ]
-.RB [ \-\-allprograms
-.RB |
-.B \-\-programid
-.IR id ]
+.
+.HP
+.CMD_CLEAR
.br
Instructs the kernel to clear statistics counters for the speficied
regions (with the exception of in-flight IO counters).
-.br
-.TP
-.B create
-.I device_name
-.RB [ \-\-areas
-.IR nr_areas ]
-.RB [ \-\-areasize
-.IR area_size ]
-.RB [ --bounds
-.IR histogram_boundaries ]
-.RB [ \-\-precise ]
-.RB [ \-\-start
-.I start_sector
-.B \-\-length
-.IR length | \fB\-\-segments ]
-.RB [ \-\-auxdata
-.IR data ]
-.RB [ \-\-programid
-.IR id ]
+.
+.HP
+.CMD_CREATE
.br
Creates one or more new statistics regions on the specified device(s).
@@ -286,7 +428,7 @@ device-mapper device's table.
If the \fB\-\-precise\fP option is used the command will attempt to
create a region using nanosecond precision counters.
-If \fB--bounds\fP is given a latency histogram will be tracked for
+If \fB\-\-bounds\fP is given a latency histogram will be tracked for
the new region. The boundaries of the histogram bins are given as a
comma separated list of latency values. There is an implicit lower bound
of zero on the first bin and an implicit upper bound of infinity (or the
@@ -311,17 +453,9 @@ By default dmstats creates regions with a \fBprogram_id\fP of
On success the \fBregion_id\fP of the newly created region is printed to
stdout.
-.br
-.TP
-.B delete
-.RI [ device_name ]
-.RB [ \-\-alldevices ]
-.RB [ \-\-allregions
-|
-.B \-\-regionid
-.IR id ]
-.RB [ \-\-allprograms | \-\-programid
-.IR id ]
+.
+.HP
+.CMD_DELETE
.br
Delete the specified statistics region. All counters and resources used
by the region are released and the region will not appear in the output
@@ -330,24 +464,17 @@ of subsequent list, print, or report operations.
All regions registered on a device may be removed using
\fB\-\-allregions\fP.
-To remove all regions on all devices both \fB--allregions\fP and
+To remove all regions on all devices both \fB\-\-allregions\fP and
\fB\-\-alldevices\fP must be used.
-.br
-.TP
-.B help
-.RB [ \-c | \-C | \-\-columns ]
+.
+.HP
+.CMD_HELP
.br
Outputs a summary of the commands available, optionally including
the list of report fields.
-.br
-.TP
-.B list
-.RI [ device_name ]
-.RB [ \-\-histogram ]
-.RB [ \-\-allprograms ]
-.RB [ \-\-programid
-.IR id ]
-.RB [ \-v | \-\-verbose \ [ \-v | \-\-verbose ]]
+.
+.HP
+.CMD_LIST
.br
List the statistics regions registered on the device. If the
\fB\-\-allprograms\fP switch is given all regions will be listed
@@ -358,37 +485,15 @@ a row of information for each area contained in each region displayed.
If \fB\-\-histogram\fP is given the report will include the bin count
and latency boundary values for any configured histograms.
-.br
-.TP
-.B print
-.RB [ \-\-allregions | \-\-regionid
-.IR id ]
-.RB [ \-\-allprograms | \-\-programid
-.IR id ]
-.RB [ \-\-clear ]
+.
+.HP
+.CMD_PRINT
.br
Print raw statistics counters for the specified region or for all
present regions.
-.br
-.TP
-.B report
-.RB [ \-\-allprograms ]
-.RB [ \-\-interval
-.IR seconds ]
-.RB [ \-\-count
-.IR count ]
-.RB [ \-\-units
-.IR unit ]
-.RB [ \-\-regionid
-.IR id ]
-.RB [ \-\-programid
-.IR id ]
-.RB [ \-O | \-\-sort
-.IR sort_fields ]
-.RB [ \-S | \-\-select
-.IR selection ]
-.RB [ \-\-units
-.IR units ]
+.
+.HP
+.CMD_REPORT
.br
Start a report for the specified region or for all present regions. If
the count argument is specified, the report will repeat at a fixed
@@ -398,14 +503,14 @@ one second.
If the \fB\-\-allprograms\fP switch is given, all regions will be
listed, regardless of region program ID values.
-If \fB\-\-histogram\fP is given the report will include the histogram
+If the \fB\-\-histogram\fP is given the report will include the histogram
values and latency boundaries.
-If \fB\-\-relative\fP is used the default histogram field displays
+If the \fB\-\-relative\fP is used the default histogram field displays
bin values as a percentage of the total number of I/Os.
-
-.br
+.
.SH REGIONS AND AREAS
+.
The device-mapper statistics facility allows separate performance
counters to be maintained for arbitrary regions of devices. A region may
span any range: from a single sector to the whole device. A region may
@@ -421,113 +526,96 @@ areas, or into areas of the given size by specifying one of
\fB\-\-areas\fP or \fB\-\-areasize\fP when creating a region with the
\fBcreate\fP command. Depending on the size of the areas and the device
region the final area within the region may be smaller than requested.
-
-.SS Region identifiers
+.P
+.B Region identifiers
+.P
Each region is assigned an identifier when it is created that is used to
reference the region in subsequent operations. Region identifiers are
unique within a given device (including across different \fBprogram_id\fP
values).
-.br
+
Depending on the sequence of create and delete operations, gaps may
exist in the sequence of \fBregion_id\fP values for a particular device.
-
+.
.SH REPORT FIELDS
+.
The dmstats report provides several types of field that may be added to
the default field set, or used to create custom reports.
-.br
+
All performance counters and metrics are calculated per-area.
-.br
+.
.SS Derived metrics
+.
A number of metrics fields are included that provide high level
performance indicators. These are based on the fields provided by the
conventional Linux iostat program and are derived from the basic counter
values provided by the kernel for each area.
-.br
-.HP
+.TP
.B reads_merged_per_sec
-.br
Reads merged per second.
-.HP
+.TP
.B writes_merged_per_sec
-.br
Writes merged per second.
-.HP
+.TP
.B reads_per_sec
-.br
Reads completed per second.
-.HP
+.TP
.B writes_per_sec
-.br
Writes completed per second.
-.HP
+.TP
.B read_size_per_sec
-.br
Size of data read per second.
-.HP
+.TP
.B write_size_per_sec
-.br
Size of data written per second.
-.HP
+.TP
.B avg_request_size
-.br
Average request size.
-.HP
+.TP
.B queue_size
-.br
Average queue size.
-.HP
+.TP
.B await
-.br
The average wait time for read and write operations.
-.HP
+.TP
.B r_await
-.br
The average wait time for read operations.
-.HP
+.TP
.B w_await
-.br
The average wait time for write operations.
-.HP
+.TP
.B throughput
-.br
The device throughput in operations per second.
-.HP
+.TP
.B service_time
-.br
-The average service time (in milliseconds) for operations issued
+The average service time (in milliseconds) for operations issued
to the device.
-.HP
+.TP
.B util
-.br
Percentage of CPU time during which I/O requests were issued to the
device (bandwidth utilization for the device). Device saturation occurs
when this value is close to 100%.
-.br
+.
.SS Region and area meta fields
+.
Meta fields provide information about the region or area that the
statistics values relate to. This includes the region and area
identifier, start, length, and counts, as well as the program ID and
auxiliary data values.
-.br
-.HP
+.TP
.B region_id
-.br
Region identifier. This is a non-negative integer returned by the kernel
when a statistics region is created.
-.HP
+.TP
.B region_start
-.br
-.br
The region start location. Display units are selected by the
-\fB--units\fP option.
-.HP
+\fB\-\-units\fP option.
+.TP
.B region_len
-.br
The length of the region. Display units are selected by the
-\fB--units\fP option.
-.HP
+\fB\-\-units\fP option.
+.TP
.B area_id
-.br
Area identifier. Area identifiers are assigned by the device-mapper
statistics library and uniquely identify each area within a region. Each
ID corresponds to a distinct set of performance counters for that area
@@ -535,206 +623,170 @@ of the statistics region. Area identifiers are always monotonically
increasing within a region so that higher ID values correspond to
greater sector addresses within the area and no gaps in the sequence of
identifiers exist.
-.HP
+.TP
.B area_start
-.br
The area start location. Display units are selected by the
-\fB--units\fP option.
-.HP
+\fB\-\-units\fP option.
+.TP
.B area_len
-.br
The length of the area. Display units are selected by the
-\fB--units\fP option.
-.HP
+\fB\-\-units\fP option.
+.TP
.B area_count
-.br
The number of areas in this region.
-.HP
+.TP
.B program_id
-.br
The program ID value associated with this region.
-.HP
+.TP
.B aux_data
-.br
The auxiliary data value associated with this region.
-.br
-.HP
+.TP
.B interval_ns
-.br
The estimated interval over which the current counter values have
accumulated. The value is reported as an interger expressed in units
of nanoseconds.
-.br
-.HP
+.TP
.B interval
-.br
The estimated interval over which the current counter values have
accumulated. The value is reported as a real number in units of
seconds.
-.br
+.
.SS Basic counters
+.
Basic counters provide access to the raw counter data from the kernel,
allowing further processing to be carried out by another program.
-
+.P
The kernel provides thirteen separate counters for each statistics
area. The first eleven of these match the counters provided in
/proc/diskstats or /sys/block/*/*/stat. The final pair provide separate
counters for read and write time.
-.P
-.HP
+.TP
.B read_count
-.br
Count of reads completed this interval.
-.HP
+.TP
.B reads_merged_count
-.br
Count of reads merged this interval.
-.HP
+.TP
.B read_sector_count
-.br
Count of 512 byte sectors read this interval.
-.HP
+.TP
.B read_time
-.br
Accumulated duration of all read requests (ns).
-.HP
+.TP
.B write_count
-.br
Count of writes completed this interval.
-.HP
+.TP
.B writes_merged_count
-.br
Count of writes merged this interval.
-.HP
+.TP
.B write_sector_count
-.br
Count of 512 byte sectors written this interval.
-.HP
+.TP
.B write_nsecs
-.br
Accumulated duration of all write requests (ns).
-.HP
+.TP
.B in_progress_count
-.br
Count of requests currently in progress.
-.HP
+.TP
.B io_ticks
-.br
Nanoseconds spent servicing requests.
-.HP
+.TP
.B queue_ticks
-.br
This field is incremented at each I/O start, I/O completion, I/O merge,
or read of these stats by the number of I/Os in progress multiplied by
the number of milliseconds spent doing I/O since the last update of this
field. This can provide an easy measure of both I/O completion time and
the backlog that may be accumulating.
-.HP
+.TP
.B read_ticks
-.br
Nanoseconds spent servicing reads.
-.HP
+.TP
.B write_ticks
-.br
Nanoseconds spent servicing writes.
-.br
+.
.SS Histogram fields
+.
Histograms measure the frequency distribution of user specified I/O
latency intervals. Histogram bin boundaries are specified when a region
is created.
-
+.P
A brief representation of the histogram values and latency intervals can
be included in the report using these fields.
-.P
-.HP
+.TP
.B hist_count
-.br
A list of the histogram counts for the current statistics area in order
of ascending latency value. Each value represents the number of I/Os
with latency times falling into that bin's time range during the sample
period.
-.HP
+.TP
.B hist_count_bounds
-.br
A list of the histogram counts for the current statistics area in order
of ascending latency value including bin boundaries: each count is
prefixed by the lower bound of the corresponding histogram bin.
-.HP
+.TP
.B hist_count_ranges
-.br
A list of the histogram counts for the current statistics area in order
of ascending latency value including bin boundaries: each count is
prefixed by both the lower and upper bounds of the corresponding
histogram bin.
-.HP
+.TP
.B hist_percent
-.br
A list of the relative histogram values for the current statistics area
in order of ascending latency value, expressed as a percentage. Each
value represents the proportion of I/Os with latency times falling into
that bin's time range during the sample period.
-.HP
+.TP
.B hist_percent_bounds
-.br
A list of the relative histogram values for the current statistics area
in order of ascending latency value, expressed as a percentage and
including bin boundaries. Each value represents the proportion of I/Os
with latency times falling into that bin's time range during the sample
period and is prefixed with the corresponding bin's lower bound.
-.HP
+.TP
.B hist_percent_ranges
-.br
A list of the relative histogram values for the current statistics area
in order of ascending latency value, expressed as a percentage and
including bin boundaries. Each value represents the proportion of I/Os
with latency times falling into that bin's time range during the sample
period and is prefixed with the corresponding bin's lower and upper
bounds.
-.HP
+.TP
.B hist_bounds
-.br
A list of the histogram boundary values for the current statistics area
in order of ascending latency value. The values are expressed in whole
units of seconds, miliseconds, microseconds or nanoseconds with a suffix
indicating the unit.
-.HP
+.TP
.B hist_ranges
-.br
A list of the histogram bin ranges for the current statistics area in
order of ascending latency value. The values are expressed as
"LOWER-UPPER" in whole units of seconds, miliseconds, microseconds or
nanoseconds with a suffix indicating the unit.
-.HP
+.TP
.B hist_bins
-.br
The number of latency histogram bins configured for the area.
-.br
-.br
-.P
+.
.SH EXAMPLES
+.
Create a whole-device region with one area on vg00/lvol1
.br
-.br
-# dmstats create vg00/lvol1
+#
+.B dmstats create vg00/lvol1
.br
vg00/lvol1: Created new region with 1 area(s) as region ID 0
-.br
-.br
-
-
+.P
Create a 32M region 1G into device d0
.br
-.br
-# dmstats create --start 1G --length 32M d0
+#
+.B dmstats create \-\-start 1G \-\-length 32M d0
.br
d0: Created new region with 1 area(s) as region ID 0
-.br
-
-
+.P
Create a whole-device region with 8 areas on every device
.br
.br
-# dmstats create --areas 8
+#
+.B dmstats create \-\-areas 8
.br
vg00-lvol1: Created new region with 8 area(s) as region ID 0
.br
@@ -747,37 +799,33 @@ vg01-lvol0: Created new region with 8 area(s) as region ID 2
vg01-lvol1: Created new region with 8 area(s) as region ID 0
.br
vg00-lvol2: Created new region with 8 area(s) as region ID 1
-.br
-.br
-
+.P
Delete all regions on all devices
.br
.br
-# dmstats delete --alldevices --allregions
-.br
-.br
-
+#
+.B dmstats delete \-\-alldevices \-\-allregions
+.P
Create a whole-device region with areas 10GiB in size on vg00/lvol1
using dmsetup
.br
.br
-# dmsetup stats create --areasize 10G vg00/lvol1
+#
+.B dmsetup stats create \-\-areasize 10G vg00/lvol1
.br
vg00-lvol1: Created new region with 5 area(s) as region ID 1
-.br
-.br
-
+.P
Create a 1GiB region with 16 areas at the start of vg00/lvol1
.br
-# dmstats create --start 0 --len 1G --areas=16 vg00/lvol1
+#
+.B dmstats create \-\-start 0 \-\-len 1G \-\-areas=16 vg00/lvol1
.br
vg00-lvol1: Created new region with 16 area(s) as region ID 0
-.br
-.br
-
+.P
List the statistics regions registered on vg00/lvol1
.br
-# dmstats list vg00/lvol1
+#
+.B dmstats list vg00/lvol1
.br
Name RgID RStart RSize #Areas ASize ProgID
.br
@@ -786,15 +834,15 @@ vg00-lvol1 0 0 61.00g 1 61.00g dmstats
vg00-lvol1 1 61.00g 19.20g 1 19.20g dmstats
.br
vg00-lvol1 2 80.20g 2.14g 1 2.14g dmstats
-.br
-.br
-
+.P
Display five statistics reports for vg00/lvol1 at an interval of one second
.br
.br
-# dmstats report --interval 1 --count 5 vg00/lvol1
+#
+.B dmstats report \-\-interval 1 \-\-count 5 vg00/lvol1
.br
-# dmstats report
+#
+.B dmstats report
.br
Name RgID ArID AStart ASize RRqM/s WRqM/s R/s W/s RSz/s WSz/s AvRqSz QSize Util% AWait RdAWa WrAWa
.br
@@ -803,41 +851,39 @@ vg_hex-lv_home 0 0 0 61.00g 0.00 0.00 0.00 218.00 0
vg_hex-lv_home 1 0 61.00g 19.20g 0.00 0.00 0.00 5.00 0 548.00k 109.50k 0.14 11.00 27.40 0.00 27.40
.br
vg_hex-lv_home 2 0 80.20g 2.14g 0.00 0.00 0.00 14.00 0 1.15m 84.00k 0.39 18.70 27.71 0.00 27.71
-.br
-.br
-
+.P
Create one region for reach target contained in device vg00/lvol1
.br
.br
-# dmstats create --segments vg00/lvol1
+#
+.B dmstats create \-\-segments vg00/lvol1
.br
vg00-lvol1: Created new region with 1 area(s) as region ID 0
.br
vg00-lvol1: Created new region with 1 area(s) as region ID 1
.br
vg00-lvol1: Created new region with 1 area(s) as region ID 2
-.br
-.br
-
+.P
Print raw counters for region 4 on device d0
.br
-.br
-# dmstats print --regionid 4 d0
+#
+.B dmstats print \-\-regionid 4 d0
.br
2097152+65536 0 0 0 0 29 0 264 701 0 41 701 0 41
-.br
-.br
+.
.SH AUTHORS
+.
Bryn M. Reeves <bmr(a)redhat.com>
-
+.
.SH SEE ALSO
+.
.BR dmsetup (8)
-LVM2 resource page https://www.sourceware.org/lvm2/
+LVM2 resource page: https://www.sourceware.org/lvm2/
.br
Device-mapper resource page: http://sources.redhat.com/dm/
.br
Device-mapper statistics kernel documentation
.br
-Documentation/device-mapper/statistics.txt
+.I Documentation/device-mapper/statistics.txt