master - tests: uncache with missing PV
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bfc0edd12d1f4...
Commit: 5bfc0edd12d1f4e31fcd3813edd8de99816ec6c3
Parent: 00e641ef37a977129acc503f3fa1b67f556ac5eb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 8 10:56:36 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
tests: uncache with missing PV
For now repair of cache with missing PVs via usage of --uncache.
More will follow later.
---
test/shell/lvconvert-repair-cache.sh | 121 ++++++++++++++++++++++++++++++++++
1 files changed, 121 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-repair-cache.sh b/test/shell/lvconvert-repair-cache.sh
new file mode 100644
index 0000000..9ef8716
--- /dev/null
+++ b/test/shell/lvconvert-repair-cache.sh
@@ -0,0 +1,121 @@
+#!/bin/sh
+
+# Copyright (C) 2016 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Test repairing of broken cached LV
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+MKFS=mkfs.ext4
+FSCK=fsck
+
+which "$MKFS" || skip
+which "$FSCK" || skip
+
+#
+# Main
+#
+aux have_cache 1 3 0 || skip
+
+aux prepare_vg 4
+
+#if [ 1 -eq 0 ] ; then
+#############################
+###### WRITETHROUGH #########
+#############################
+
+# Create cached LV
+lvcreate --type cache-pool -L10 $vg/cpool "$dev1"
+lvcreate -H -L20 --cachemode writethrough -n $lv1 $vg/cpool "$dev2"
+
+"$MKFS" "$DM_DEV_DIR/$vg/$lv1"
+sync
+
+aux disable_dev "$dev1"
+
+#lvchange -an $vg
+
+# Check it is prompting fro confirmation
+not lvconvert --uncache $vg/$lv1
+# --yes to drop when Check its prompting
+lvconvert --yes --uncache $vg/$lv1
+
+"$FSCK" -n "$DM_DEV_DIR/$vg/$lv1"
+
+aux enable_dev "$dev1"
+
+##################
+
+lvcreate --type cache-pool -L10 $vg/cpool "$dev1"
+lvconvert -H --cachemode writethrough --cachepool $vg/cpool $lv1
+
+aux disable_dev "$dev2"
+
+# Check it is prompting for confirmation
+not lvconvert --uncache $vg/$lv1
+# --yes to drop when Check its prompting
+lvconvert --yes --uncache $vg/$lv1
+
+#lvconvert --repair $vg/$lv1 -vvvvv
+#/$lv1
+
+#lvchange -ay $vg
+
+aux enable_dev "$dev2"
+lvremove -ff $vg
+
+##########################
+###### WRITEBACK #########
+##########################
+#fi
+
+# Create cached LV so metadata is on dev1 and data on dev2
+lvcreate -L5 -n meta $vg "$dev1"
+lvcreate -L10 -n cpool $vg "$dev2"
+lvconvert --yes --poolmetadata $vg/meta --cachepool $vg/cpool
+
+lvcreate -H -L20 --cachemode writeback -n $lv1 $vg/cpool "$dev3"
+
+lvs -a -o+seg_pe_ranges,cachemode $vg
+
+"$MKFS" "$DM_DEV_DIR/$vg/$lv1"
+sync
+
+# Seriously damage cache metadata
+aux error_dev "$dev1" 2054:2
+
+# Here we usually for the 1st. notice needs_check
+check lv_attr_bit state $vg/$lv1 "c"
+
+sleep .1
+
+# And now cache is finaly Failed
+check lv_attr_bit health $vg/$lv1 "F"
+check lv_field $vg/$lv1 lv_health_status "failed"
+
+aux disable_dev "$dev1"
+
+# Check it is prompting for confirmation
+not lvconvert --uncache $vg/$lv1
+# Check --yes is not enought to drop writethrough caching
+not lvconvert --yes --uncache $vg/$lv1
+# --force needs --yes to drop when Check its prompting
+not lvconvert --force --uncache $vg/$lv1
+
+lvconvert --force --yes --uncache $vg/$lv1
+
+not "$FSCK" -n "$DM_DEV_DIR/$vg/$lv1"
+
+aux enable_dev "$dev1"
+
+vgremove -ff $vg
7 years, 8 months
master - cleanup: display_lvname
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00e641ef37a977...
Commit: 00e641ef37a977129acc503f3fa1b67f556ac5eb
Parent: 8507db192481b5539d9721c912ce5556049bf050
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 7 10:45:50 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
cleanup: display_lvname
---
tools/lvconvert.c | 46 +++++++++++++++++++++++-----------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index f02a7f9..d80292a 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1829,34 +1829,35 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
struct lvconvert_params *lp)
{
struct volume_group *vg = cow->vg;
+ const char *cow_name = display_lvname(cow);
if (!lv_is_cow(cow)) {
- log_error("%s/%s is not a snapshot.", vg->name, cow->name);
+ log_error("%s is not a snapshot.", cow_name);
return 0;
}
if (lv_is_origin(cow) || lv_is_external_origin(cow)) {
- log_error("Unable to split LV %s/%s that is a snapshot origin.", vg->name, cow->name);
+ log_error("Unable to split LV %s that is a snapshot origin.", cow_name);
return 0;
}
if (lv_is_merging_cow(cow)) {
- log_error("Unable to split off snapshot %s/%s being merged into its origin.", vg->name, cow->name);
+ log_error("Unable to split off snapshot %s being merged into its origin.", cow_name);
return 0;
}
if (lv_is_virtual_origin(origin_from_cow(cow))) {
- log_error("Unable to split off snapshot %s/%s with virtual origin.", vg->name, cow->name);
+ log_error("Unable to split off snapshot %s with virtual origin.", cow_name);
return 0;
}
if (lv_is_thin_pool(cow) || lv_is_pool_metadata_spare(cow)) {
- log_error("Unable to split off LV %s/%s needed by thin volume(s).", vg->name, cow->name);
+ log_error("Unable to split off LV %s needed by thin volume(s).", cow_name);
return 0;
}
if (!(vg->fid->fmt->features & FMT_MDAS)) {
- log_error("Unable to split off snapshot %s/%s using old LVM1-style metadata.", vg->name, cow->name);
+ log_error("Unable to split off snapshot %s using old LVM1-style metadata.", cow_name);
return 0;
}
@@ -1870,7 +1871,7 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
return_0;
if (lv_is_pvmove(cow) || lv_is_mirror_type(cow) || lv_is_raid_type(cow) || lv_is_thin_type(cow)) {
- log_error("LV %s/%s type is unsupported with --splitsnapshot.", vg->name, cow->name);
+ log_error("LV %s type is unsupported with --splitsnapshot.", cow_name);
return 0;
}
@@ -1882,8 +1883,8 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
lv_is_visible(cow) &&
lv_is_active(cow)) {
if (yes_no_prompt("Do you really want to split off active "
- "logical volume %s? [y/n]: ", cow->name) == 'n') {
- log_error("Logical volume %s not split.", cow->name);
+ "logical volume %s? [y/n]: ", cow_name) == 'n') {
+ log_error("Logical volume %s not split.", cow_name);
return 0;
}
}
@@ -1892,14 +1893,14 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
if (!archive(vg))
return_0;
- log_verbose("Splitting snapshot %s/%s from its origin.", vg->name, cow->name);
+ log_verbose("Splitting snapshot %s from its origin.", cow_name);
if (!vg_remove_snapshot(cow))
return_0;
backup(vg);
- log_print_unless_silent("Logical Volume %s/%s split from its origin.", vg->name, cow->name);
+ log_print_unless_silent("Logical Volume %s split from its origin.", cow_name);
return 1;
}
@@ -2056,27 +2057,27 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
struct lvconvert_params *lp)
{
struct logical_volume *org;
+ const char *snap_name = display_lvname(lv);
if (lv_is_cache_type(lv)) {
log_error("Snapshots are not yet supported with cache type LVs %s.",
- display_lvname(lv));
+ snap_name);
return 0;
}
if (lv_is_mirrored(lv)) {
- log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);
+ log_error("Unable to convert mirrored LV %s into a snapshot.", snap_name);
return 0;
}
if (lv_is_origin(lv)) {
/* Unsupported stack */
- log_error("Unable to convert origin \"%s\" into a snapshot.", lv->name);
+ log_error("Unable to convert origin %s into a snapshot.", snap_name);
return 0;
}
if (lv_is_pool(lv)) {
- log_error("Unable to convert pool LVs %s into a snapshot.",
- display_lvname(lv));
+ log_error("Unable to convert pool LVs %s into a snapshot.", snap_name);
return 0;
}
@@ -2087,8 +2088,7 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
}
if (org == lv) {
- log_error("Unable to use %s as both snapshot and origin.",
- display_lvname(lv));
+ log_error("Unable to use %s as both snapshot and origin.", snap_name);
return 0;
}
@@ -2112,23 +2112,23 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
}
log_warn("WARNING: Converting logical volume %s to snapshot exception store.",
- display_lvname(lv));
+ snap_name);
log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
if (!lp->yes &&
yes_no_prompt("Do you really want to convert %s? [y/n]: ",
- display_lvname(lv)) == 'n') {
+ snap_name) == 'n') {
log_error("Conversion aborted.");
return 0;
}
if (!deactivate_lv(cmd, lv)) {
- log_error("Couldn't deactivate LV %s.", lv->name);
+ log_error("Couldn't deactivate logical volume %s.", snap_name);
return 0;
}
if (!lp->zero || !(lv->status & LVM_WRITE))
- log_warn("WARNING: \"%s\" not zeroed", lv->name);
+ log_warn("WARNING: %s not zeroed", snap_name);
else {
lv->status |= LV_TEMPORARY;
if (!activate_lv_local(cmd, lv) ||
@@ -2156,7 +2156,7 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
if (!lv_update_and_reload(org))
return_0;
- log_print_unless_silent("Logical volume %s converted to snapshot.", lv->name);
+ log_print_unless_silent("Logical volume %s converted to snapshot.", snap_name);
return 1;
}
7 years, 8 months
master - cleanup: reoder lines
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8507db192481b5...
Commit: 8507db192481b5539d9721c912ce5556049bf050
Parent: b36cf94318171d9cfe35cee38e4f323ad4c8a0a4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 7 10:30:21 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
cleanup: reoder lines
---
tools/lvconvert.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index dc6cb48..f02a7f9 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -395,19 +395,10 @@ static int _read_params(struct cmd_context *cmd, int argc, char **argv,
return 0;
}
- if (arg_is_set(cmd, splitsnapshot_ARG)) {
- if (arg_outside_list_is_set(cmd, "cannot be used with --splitsnapshot",
- splitsnapshot_ARG,
- force_ARG, noudevsync_ARG, test_ARG,
- -1))
- return_0;
- lp->splitsnapshot = 1;
- }
-
if (arg_is_set(cmd, split_ARG)) {
if (arg_outside_list_is_set(cmd, "cannot be used with --split",
split_ARG,
- name_ARG,
+ name_ARG,
force_ARG, noudevsync_ARG, test_ARG,
-1))
return_0;
@@ -423,6 +414,15 @@ static int _read_params(struct cmd_context *cmd, int argc, char **argv,
lp->splitcache = 1;
}
+ if (arg_is_set(cmd, splitsnapshot_ARG)) {
+ if (arg_outside_list_is_set(cmd, "cannot be used with --splitsnapshot",
+ splitsnapshot_ARG,
+ force_ARG, noudevsync_ARG, test_ARG,
+ -1))
+ return_0;
+ lp->splitsnapshot = 1;
+ }
+
if (arg_is_set(cmd, uncache_ARG)) {
if (arg_outside_list_is_set(cmd, "cannot be used with --uncache",
uncache_ARG,
7 years, 8 months
master - cleanup: add backtrace
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b36cf94318171d...
Commit: b36cf94318171d9cfe35cee38e4f323ad4c8a0a4
Parent: 8e9deb2e701d495819d0a8c75f3a5e6c4240ad48
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 7 10:20:35 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
cleanup: add backtrace
---
libdaemon/client/daemon-client.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/libdaemon/client/daemon-client.c b/libdaemon/client/daemon-client.c
index 677e8c4..413d757 100644
--- a/libdaemon/client/daemon-client.c
+++ b/libdaemon/client/daemon-client.c
@@ -25,11 +25,7 @@
daemon_handle daemon_open(daemon_info i)
{
- daemon_handle h = {
- .protocol = NULL,
- .protocol_version = 0,
- .error = 0
- };
+ daemon_handle h = { .error = 0 };
daemon_reply r = { 0 };
struct sockaddr_un sockaddr = { .sun_family = AF_UNIX };
@@ -191,20 +187,22 @@ void daemon_close(daemon_handle h)
daemon_request daemon_request_make(const char *id)
{
daemon_request r;
- r.cft = NULL;
+
buffer_init(&r.buffer);
if (!(r.cft = dm_config_create()))
- goto bad;
+ goto_bad;
if (!(r.cft->root = make_text_node(r.cft, "request", id, NULL, NULL)))
- goto bad;
+ goto_bad;
return r;
bad:
- if (r.cft)
+ if (r.cft) {
dm_config_destroy(r.cft);
- r.cft = NULL;
+ r.cft = NULL;
+ }
+
return r;
}
7 years, 8 months
master - gcc: cast time_t to 64bit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8e9deb2e701d49...
Commit: 8e9deb2e701d495819d0a8c75f3a5e6c4240ad48
Parent: 5aade9c402e2195bc1742509300983b0d77f33e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 7 18:12:26 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
gcc: cast time_t to 64bit
Value is printed as uint64, so make sure right type is passed on all
platforms. Fixes gcc warning on some 32bit platforms.
---
lib/format_text/export.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/format_text/export.c b/lib/format_text/export.c
index 90fb044..c0af3fa 100644
--- a/lib/format_text/export.c
+++ b/lib/format_text/export.c
@@ -664,7 +664,7 @@ static int _print_timestamp(struct formatter *f,
"%Y-%m-%d %T %z", local_tm))
buf[0] = 0;
- outfc(f, buf, "%s = %" PRIu64, name, ts);
+ outfc(f, buf, "%s = %" PRIu64, name, (uint64_t) ts);
}
return 1;
7 years, 8 months
master - topology: handle reported sizes smaller then sector
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5aade9c402e219...
Commit: 5aade9c402e2195bc1742509300983b0d77f33e8
Parent: a494d85ef6cf00a6a61707e5bc41aa59bb17b7e6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 3 20:53:08 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
topology: handle reported sizes smaller then sector
Recent kernel (4.4) start to report values smaller then sector size
(but in reporting size for SSD which support data zeroing on discard).
For now log warning and assume it really means 1 sector.
Addressing RHBZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1313377
---
lib/device/dev-type.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index a6223dc..689809a 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -853,6 +853,12 @@ static unsigned long _dev_topology_attribute(struct dev_types *dt,
result = value >> SECTOR_SHIFT;
+ if (!result && value) {
+ log_warn("WARNING: Device %s: %s is %lu and is unexpectedly less then sector.",
+ dev_name(dev), attribute, value);
+ result = 1;
+ }
+
out_close:
if (fclose(fp))
log_sys_debug("fclose", path);
7 years, 8 months
master - man: drop extra braces
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a494d85ef6cf00...
Commit: a494d85ef6cf00a6a61707e5bc41aa59bb17b7e6
Parent: 386208e5933ea40792c402bce17f3ff106aa3353
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 4 21:59:04 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
man: drop extra braces
doclifter tool noticed wrong brackets.
---
man/lvreduce.8.in | 5 +++--
man/vgchange.8.in | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/man/lvreduce.8.in b/man/lvreduce.8.in
index 120afb7..5aca24e 100644
--- a/man/lvreduce.8.in
+++ b/man/lvreduce.8.in
@@ -15,8 +15,9 @@ lvreduce \(em reduce the size of a logical volume
.RB [ \-f | \-\-force ]
.RB [ \-\-noudevsync ]
.RB { \-l | \-\-extents
-.RI [ \- ] LogicalExtentsNumber [ % { VG | LV | FREE | ORIGIN "}] |"
-.RB [ \-L | \-\-size
+.RI [ \- ] LogicalExtentsNumber [ % { VG | LV | FREE | ORIGIN }]
+.RB |
+.BR \-L | \-\-size
.RI [ \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]}
.RB [ \-n | \-\-nofsck ]
.RB [ \-r | \-\-resizefs ]
diff --git a/man/vgchange.8.in b/man/vgchange.8.in
index fd7ee9d..6e13f5f 100644
--- a/man/vgchange.8.in
+++ b/man/vgchange.8.in
@@ -44,7 +44,7 @@ vgchange \(em change attributes of a volume group
.IR MaxPhysicalVolumes ]
.RB [ \-\-metadataprofile
.IR ProfileName ]
-.RB [ \-\- [ vg ] metadatacopies ]
+.RB [ \-\- [ vg ] metadatacopies
.IR NumberOfCopies | unmanaged | all ]
.RB [ \-P | \-\-partial ]
.RB [ \-s | \-\-physicalextentsize
7 years, 8 months
master - man: updates
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=386208e5933ea4...
Commit: 386208e5933ea40792c402bce17f3ff106aa3353
Parent: 86a23b2145e4abde3086a22ceb15438515b0053d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 3 20:27:09 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:54 2016 +0100
man: updates
Continuing with lvconvert style updates.
Minimize usage of '\:' as zero-width break space, since html renderers
do not handle this groff sign well (some of them seems to even render
':' there).
But since we do not want see badly rendered man pages itself, prefer
the 'man visual' appearence over html page generation (man2html should
be actually fixed).
Start to use 'user input option' with Capitals more consistently.
---
WHATS_NEW | 1 +
man/lvconvert.8.in | 71 +++++++++++++++++++++++++--------------------------
man/lvcreate.8.in | 26 +++++++++---------
man/lvmconfig.8.in | 25 +++++++++---------
4 files changed, 61 insertions(+), 62 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d348cbc..685cdad 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.146 -
=================================
+ More man page cleanups in lvconvert.
Fix makefile vpath in /udev when generating udev rules files.
Another attempt to improve VG name parsing for lvconvert (2.02.144).
Use new cache status info and skip flushing for failed cache.
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index b889345..12aaea2 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -33,7 +33,7 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-y | \-\-yes ]
.RB [ \-\-version ]
.IR LogicalVolume
-.RI [ PhysicalVolume [ Path ]\:[ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI \%[ PhysicalVolume [ Path ][ \fB: \fIPE \fR[ \fB\- PE ]]...]
.sp
.B lvconvert
.BR \-\-merge
@@ -90,7 +90,7 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.IR MirrorLogicalVolume
.RB [ \-\-commandprofile
.IR ProfileName ]
-.RI [ SplittablePhysicalVolume [ Path ]\:[ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI \%[ SplittablePhysicalVolume [ Path ][ \fB: \fIPE \fR[ \fB\- PE ]]...]
.sp
.B lvconvert
.BR \-\-splitsnapshot
@@ -156,7 +156,7 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
.IR LogicalVolume
-.RI [ PhysicalVolume [ Path ]\:[ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI \%[ PhysicalVolume [ Path ][ \fB: \fIPE \fR[ \fB\- PE ]]...]
.sp
.B lvconvert
.BR \-\-type
@@ -179,7 +179,7 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-\-stripes
.IR Stripes
.RB [ \-I | \-\-stripesize
-.IR StripeSize ]]]
+.IR StripeSize ]]
.RB [ \-\-poolmetadataspare
.RB { y | n }]
.RB [ \-Z | \-\-zero
@@ -189,8 +189,8 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-h | \-? | \-\-help ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [[ ExternalOrigin | ThinPool ] LogicalVolume ]
-.RI [ PhysicalVolume [ Path ]\:[ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI [[ ExternalOrigin | ThinPool ] LogicalVolume
+.RI \%[ PhysicalVolume [ Path ][ \fB: \fIPE \fR[ \fB\- PE ]]...]]
.ad b
.sp
.
@@ -257,14 +257,14 @@ version available in newer kernels.
.
.HP
.BR \-\-cachepool
-.IR CachePoolLV
+.IR CachePoolLogicalVolume { Name | Path }
.br
This argument is necessary when converting a logical volume to a cache LV.
For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(7).
.
.HP
.BR \-\-cachesettings
-.IR Key \fB= Value
+.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.
@@ -337,21 +337,6 @@ be specified on the commandline or a @tag may be used to specify
multiple snapshots be merged to their respective origin.
.
.HP
-.BR \-m ,
-.BR \-\-mirrors
-.IR Mirrors
-.br
-Specifies the degree of the mirror you wish to create.
-For example, "\fB\-m 1\fP" would convert the original logical
-volume to a mirror volume with 2-sides; that is, a
-linear volume plus one copy. There are two implementations of mirroring
-which correspond to the "\fIraid1\fP" and "\fImirror\fP" segment types. The default
-mirroring segment type is "\fIraid1\fP". If the legacy "\fImirror\fP" segment type
-is desired, the \fB\-\-type\fP argument must be used to explicitly
-select the desired type. The \fB\-\-mirrorlog\fP and \fB\-\-corelog\fP
-options below are only relevant to the legacy "\fImirror\fP" segment type.
-.
-.HP
.BR \-\-mirrorlog
.RB { disk | core | mirrored }
.br
@@ -365,6 +350,21 @@ time the device is activated - perhaps, for example, after every reboot.
Using \fBmirrored\fP will create a persistent log that is itself mirrored.
.
.HP
+.BR \-m ,
+.BR \-\-mirrors
+.IR Mirrors
+.br
+Specifies the degree of the mirror you wish to create.
+For example, "\fB\-m 1\fP" would convert the original logical
+volume to a mirror volume with 2-sides; that is, a
+linear volume plus one copy. There are two implementations of mirroring
+which correspond to the \fBraid1\fP and \fBmirror\fP segment types. The default
+mirroring segment type is \fBraid1\fP. If the legacy \fBmirror\fP" segment type
+is desired, the \fB\-\-type\fP argument must be used to explicitly
+select the desired type. The \fB\-\-mirrorlog\fP and \fB\-\-corelog\fP
+options below are only relevant to the legacy \fBmirror\fP segment type.
+.
+.HP
.BR \-n ,
.BR \-\-name
.IR Name
@@ -402,7 +402,7 @@ as it is being used as the external origin.
.
.HP
.BR \-\-poolmetadata
-.IR PoolMetadataLogicalVolume
+.IR PoolMetadataLogicalVolume { Name | Path }
.br
Specifies cache or thin pool metadata logical volume.
The size should be in between 2MiB and 16GiB.
@@ -500,15 +500,6 @@ This option is only available to RAID segment types
etc).
.
.HP
-.BR \-\-splitmirrors
-.IR Images
-.br
-The number of redundant \fIImages\fP of a mirror to be split off and used
-to form a new logical volume. A name must be supplied for the
-newly-split-off logical volume using the \fB\-\-name\fP argument, unless
-the \fB\-\-trackchanges\fP argument is given.
-.
-.HP
.BR \-s ,
.BR \-\-snapshot ,
.BR \-\-type\ snapshot
@@ -536,6 +527,15 @@ See also the option \fB\-\-uncache\fP for uncaching and removing
cache pool with one command.
.
.HP
+.BR \-\-splitmirrors
+.IR Images
+.br
+The number of redundant \fIImages\fP of a mirror to be split off and used
+to form a new logical volume. A name must be supplied for the
+newly-split-off logical volume using the \fB\-\-name\fP argument, unless
+the \fB\-\-trackchanges\fP argument is given.
+.
+.HP
.BR \-\-splitsnapshot
.br
Separates \fISnapshotLogicalVolume\fP from its origin.
@@ -567,8 +567,7 @@ power of 2 but must not exceed the physical extent size.
.HP
.BR \-T ,
.BR \-\-thin ,
-.BR \-\-type
-.BR thin
+.BR \-\-type\ thin
.br
Converts the logical volume into a thin logical volume of the thin pool
specified with \fB\-\-thinpool\fP. The original logical volume
@@ -580,7 +579,7 @@ external origin volume for unprovisioned areas of any thin logical volume.
.
.HP
.BR \-\-thinpool
-.IR ThinPoolLogicalVolume
+.IR ThinPoolLogicalVolume { Name | Path }
.br
Specifies or converts logical volume into a thin pool's data volume.
Content of converted volume is lost.
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 2ce39dd..f6bb14f 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -31,11 +31,11 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-\-cachemode
.RB { passthrough | writeback | writethrough }]
.RB [ \-\-cachepolicy
-.IR policy ]
+.IR Policy ]
.RB \%[ \-\-cachepool
.IR CachePoolLogicalVolume ]
.RB [ \-\-cachesettings
-.IR key \fB= value ]
+.IR Key \fB= Value ]
.RB [ \-c | \-\-chunksize
.IR ChunkSize ]
.RB [ \-\-commandprofile
@@ -60,9 +60,9 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-K | \-\-ignoreactivationskip ]
.RB [ \-\-ignoremonitoring ]
.RB [ \-\-minor
-.IR minor
+.IR Minor
.RB [ \-j | \-\-major
-.IR major ]]
+.IR Major ]]
.RB [ \-\-metadataprofile
.IR Profile\%Name ]
.RB [ \-m | \-\-mirrors
@@ -109,10 +109,10 @@ lvcreate \- create a logical volume in an existing volume group
.RB { y | n }]
.RB [ \-Z | \-\-zero
.RB { y | n }]
-.RI [ VolumeGroup \c
-.RB [ / \c
-.RI { ExternalOrigin | Origin | Pool } LogicalVolumeName
-.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]]
+.RI [ VolumeGroup
+.RI |
+.RI \%{ ExternalOrigin | Origin | Pool } LogicalVolume
+.RI \%[ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]]
.LP
.B lvcreate
.RB [ \-l | \-\-extents
@@ -132,7 +132,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB \%[ \-\-monitor
.RB { y | n }]
.RB [ \-n | \-\-name
-.IR SnapshotLogicalVolume ]
+.IR SnapshotLogicalVolumeName ]
.BR \-s | \-\-snapshot | \-H | \-\-cache
.RI \%{[ VolumeGroup \fB/\fP] OriginalLogicalVolume
.RB \%[ \-V | \-\-virtualsize
@@ -223,7 +223,7 @@ cache pool LV.
.
.HP
.BR \-\-cachepolicy
-.IR policy
+.IR Policy
.br
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
the cache policy. \fBmq\fP is the basic policy name. \fBsmq\fP is more advanced
@@ -238,7 +238,7 @@ is to append name to Volume group name argument.
.
.HP
.BR \-\-cachesettings
-.IB key = value
+.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.
@@ -336,7 +336,7 @@ to be allocated (including extents used by any mirrors, for example).
.
.HP
.BR \-j | \-\-major
-.IR major
+.IR Major
.br
Sets the major number.
Major numbers are not supported with pool volumes.
@@ -356,7 +356,7 @@ See \fBlvm.conf\fP(5) for more information about \fBmetadata profiles\fP.
.
.HP
.BR \-\-minor
-.IR minor
+.IR Minor
.br
Sets the minor number.
Minor numbers are not supported with pool volumes.
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 9a3fcab..257029e 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -6,15 +6,14 @@ lvmconfig, lvm dumpconfig, lvm config \(em Display LVM configuration
.ad l
.B lvmconfig
.RB [ \-f | \-\-file
-.IR filename ]
+.IR Filename ]
.RB [ \-\-type
-.RB { current |\: default |\: diff |\: full | list |\: missing \c
-.RB |\: new |\: profilable |\: profilable-command \c
-.RB |\: profilable-metadata }]
+.RB { current | default | diff | full |\: list | missing | new \c
+.RB | profilable | profilable-command | profilable-metadata }]
.RB [ \-\-atversion
-.IR version ]
+.IR Version ]
.RB [ \-\-sinceversion
-.IR version ]
+.IR Version ]
.RB [ \-\-ignoreadvanced ]
.RB [ \-\-ignoreunsupported ]
.RB [ \-\-ignorelocal ]
@@ -45,7 +44,7 @@ The command was added in release 2.02.119 and has an identical longer form
.SH OPTIONS
.TP
-.BR \-f ", " \-\-file " \fIfilename"
+.BR \-f ", " \-\-file " \fIFilename"
Send output to a file named 'filename'.
.TP
@@ -54,7 +53,7 @@ List configuration settings with summarizing comment. This is the same as using
\fBlvmconfig --type list --withsummary\fP.
.TP
-.BR \-\-type " {" current | default | diff | full | missing | new | profilable | profilable-command | profilable-metadata }
+.BR \-\-type " {" current | default | diff | full | missing | new | profilable |\: profilable-command | profilable-metadata }
Select the type of configuration to display. The configuration settings
displayed have either default values or currently-used values assigned based on
the type selected. If no type is selected, \fB\-\-type current\fP is used
@@ -106,7 +105,7 @@ by \fB\-\-type profilable\fP.
.RE
.TP
-.BI \-\-atversion " version"
+.BI \-\-atversion " Version"
Specify an LVM version in x.y.z format where x is the major version,
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
When configuration is displayed, the configuration settings recognized
@@ -116,7 +115,7 @@ which does not contain any newer settings for which LVM would
issue a warning message when checking the configuration.
.TP
-.BI \-\-sinceversion " version"
+.BI \-\-sinceversion " Version"
Specify an LVM version in x.y.z format where x is the major version,
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
This option is currently applicable only with \fB\-\-type new\fP
@@ -140,13 +139,13 @@ Ignore local section.
.TP
.BI \-\-config " ConfigurationString"
-Use \fBConfigurationString\fP to override existing configuration.
+Use \fIConfigurationString\fP to override existing configuration.
This configuration is then applied for the lvmconfig command itself.
See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
.TP
.BI \-\-commandprofile " ProfileName"
-Use \fBProfileName\fP to override existing configuration.
+Use \fIProfileName\fP to override existing configuration.
This configuration is then applied for the lvmconfig command itself.
See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for
more info about \fBconfig cascade\fP.
@@ -158,7 +157,7 @@ applied for the lvmconfig command itself.
.TP
.BI \-\-metadataprofile " ProfileName"
-Use \fBProfileName\fP to override existing configuration.
+Use \fIProfileName\fP to override existing configuration.
The configuration defined in metadata profile has no effect for
the lvmconfig command itself. lvmconfig displays the configuration only.
See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for more
7 years, 8 months
master - makefiles: avoid using vpath for rules files
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=86a23b2145e4ab...
Commit: 86a23b2145e4abde3086a22ceb15438515b0053d
Parent: 70cbd8f1a5cc6abb418a90529bc12a2813806f13
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 9 17:52:29 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:53 2016 +0100
makefiles: avoid using vpath for rules files
Fixing vpath usage as it has been checking for existance of
generated file also in the $(scrdir) e.g.:
No need to remake target '10-dm.rules.in'; using VPATH name '...'
If the $(srcdir) had been also $(builddir) and contained already
generated rules file, it's been used instead generating new
one.
(See: http://make.mad-scientist.net/papers/how-not-to-use-vpath/)
---
WHATS_NEW | 1 +
udev/Makefile.in | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index eab40b1..d348cbc 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.146 -
=================================
+ Fix makefile vpath in /udev when generating udev rules files.
Another attempt to improve VG name parsing for lvconvert (2.02.144).
Use new cache status info and skip flushing for failed cache.
Support --uncache with missing PVs.
diff --git a/udev/Makefile.in b/udev/Makefile.in
index d23eb7d..cb968df 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -16,7 +16,6 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
include $(top_builddir)/make.tmpl
-vpath %.rules $(srcdir)
DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
LVM_RULES=11-dm-lvm.rules
@@ -52,7 +51,7 @@ else
PVSCAN_RULE=RUN\+\=\"$(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major \$$major --minor \$$minor\", ENV{LVM_SCANNED}=\"1\"
endif
-%.rules: %.rules.in
+%.rules: $(srcdir)/%.rules.in
$(SED) -e "s+(DM_DIR)+$(DM_DIR)+;s+(BLKID_RULE)+$(BLKID_RULE)+;s+(PVSCAN_RULE)+$(PVSCAN_RULE)+;s+(DM_EXEC_RULE)+$(DM_EXEC_RULE)+;s+(DM_EXEC)+$(DM_EXEC)+;s+(LVM_EXEC_RULE)+$(LVM_EXEC_RULE)+;s+(LVM_EXEC)+$(LVM_EXEC)+;" $< >$@
%_install: %.rules
7 years, 8 months
master - lvconvert: improve vg parameter parsing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=70cbd8f1a5cc6a...
Commit: 70cbd8f1a5cc6abb418a90529bc12a2813806f13
Parent: 5c415afd852b6d39021f97f63401a37e6408bf70
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 8 10:13:38 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 10 18:38:53 2016 +0100
lvconvert: improve vg parameter parsing
Commit abd9618dd8b77ca1974074ae76fa6a08f1a687d9 tried to improve
parsing of vg name from logical path - but still missed couple
corner cases.
This patch further improves the logic and reuses
validate_lvname_param() for parsing of lv_name.
Also explicitly checks for LVM_VG_NAME in the right case.
So now also properly parses cases like:
'lvconvert --repairt vg/'
and will provide correct error message.
---
WHATS_NEW | 1 +
tools/lvconvert.c | 25 ++++++++++---------------
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index e5b28bb..eab40b1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.146 -
=================================
+ Another attempt to improve VG name parsing for lvconvert (2.02.144).
Use new cache status info and skip flushing for failed cache.
Support --uncache with missing PVs.
Tidy report field names, headings and widths.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 2b5080f..dc6cb48 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -115,9 +115,6 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
struct cmd_context *cmd,
int *pargc, char ***pargv)
{
- char *ptr;
- const char *vg_name = NULL;
-
if (lp->merge) {
if (!*pargc) {
log_error("Please specify a logical volume path.");
@@ -174,26 +171,24 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
if (!validate_restricted_lvname_param(cmd, &lp->vg_name, &lp->lv_split_name))
return_0;
- if ((vg_name = extract_vgname(cmd, lp->lv_name_full)) &&
- lp->vg_name && strcmp(vg_name, lp->vg_name)) {
- log_error("Please use a single volume group name "
- "(\"%s\" or \"%s\")", vg_name, lp->vg_name);
- return 0;
+ if (!lp->vg_name && !strchr(lp->lv_name_full, '/')) {
+ /* Check for $LVM_VG_NAME */
+ if (!(lp->vg_name = extract_vgname(cmd, NULL))) {
+ log_error("Please specify a logical volume path.");
+ return 0;
+ }
}
- if (!lp->vg_name)
- lp->vg_name = vg_name;
+ if (!validate_lvname_param(cmd, &lp->vg_name, &lp->lv_name_full))
+ return_0;
+
+ lp->lv_name = lp->lv_name_full;
if (!validate_name(lp->vg_name)) {
log_error("Please provide a valid volume group name");
return 0;
}
- if ((ptr = strrchr(lp->lv_name_full, '/')))
- lp->lv_name = ptr + 1;
- else
- lp->lv_name = lp->lv_name_full;
-
if (!lp->merge_mirror &&
!lp->repair &&
!arg_count(cmd, splitmirrors_ARG) &&
7 years, 8 months