Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7783fe3e93b6fee0…
Commit: 7783fe3e93b6fee0e8ea8198917b2d1a3072bdab
Parent: 79ca382b2c24fd01aa25c98c0ab29b97a4358270
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Oct 4 17:06:51 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 6 15:22:24 2014 +0200
man: document -ff for removal
Make it visible in man page that -ff could make removal
process proceed in case of damaged pool.
---
man/lvremove.8.in | 2 ++
man/vgremove.8.in | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/man/lvremove.8.in b/man/lvremove.8.in
index b0bb477..8426cac 100644
--- a/man/lvremove.8.in
+++ b/man/lvremove.8.in
@@ -31,6 +31,8 @@ See \fBlvm\fP(8) for common options.
.TP
.BR \-f ", " \-\-force
Remove active logical volumes without confirmation.
+Tool will try to deactivate \fIunused\fP volume.
+To proceed with damaged pools use \-ff
.TP
.B \-\-noudevsync
Disable udev synchronisation. The
diff --git a/man/vgremove.8.in b/man/vgremove.8.in
index f824a56..10a431f 100644
--- a/man/vgremove.8.in
+++ b/man/vgremove.8.in
@@ -28,6 +28,7 @@ See \fBlvm\fP(8) for common options.
.BR \-f ", " \-\-force
Force the removal of any logical volumes on the volume group
without confirmation.
+To remove also damaged pool volumes use \-ff.
.TP
.BR \-\-noudevsync
Disable udev synchronisation. The
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79ca382b2c24fd01…
Commit: 79ca382b2c24fd01aa25c98c0ab29b97a4358270
Parent: fbf14b12d8710f10b7a7f1a0a23347ac5ad1a826
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Oct 4 17:05:29 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 6 15:22:24 2014 +0200
vg/lvremove: support --yes
Make --yes equivalent to DONT_PROMT (--force).
So user could use 'lvremove --yes vg/lvol1' skipping prompt.
---
WHATS_NEW | 1 +
tools/lvremove.c | 12 ++++++++++--
tools/vgremove.c | 11 ++++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d2b5303..3855bb1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.112 -
=====================================
+ Support --yes like --force in vg/lvremove to skip y|n prompt.
Support --yes with lvconvert --splitsnapshot.
Fix detection of unsupported thin external lvconversions.
Fix detection of unsupported cache and thin pool lvconversions.
diff --git a/tools/lvremove.c b/tools/lvremove.c
index dfc435c..7d2fec1 100644
--- a/tools/lvremove.c
+++ b/tools/lvremove.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -18,7 +18,15 @@
static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
void *handle __attribute__((unused)))
{
- if (!lv_remove_with_dependencies(cmd, lv, (force_t) arg_count(cmd, force_ARG), 0))
+ /*
+ * Single force is equivalent to sinle --yes
+ * Even multiple --yes are equivalent to single --force
+ * When we require -ff it cannot be replaces with -f -y
+ */
+ force_t force = (force_t) arg_count(cmd, force_ARG)
+ ? : (arg_is_set(cmd, yes_ARG) ? DONT_PROMPT : PROMPT);
+
+ if (!lv_remove_with_dependencies(cmd, lv, force, 0))
return_ECMD_FAILED;
return ECMD_PROCESSED;
diff --git a/tools/vgremove.c b/tools/vgremove.c
index 52bdd2b..0bbca76 100644
--- a/tools/vgremove.c
+++ b/tools/vgremove.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -19,15 +19,20 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle __attribute__((unused)))
{
+ /*
+ * Single force is equivalent to sinle --yes
+ * Even multiple --yes are equivalent to single --force
+ * When we require -ff it cannot be replaces with -f -y
+ */
+ force_t force = (force_t) arg_count(cmd, force_ARG)
+ ? : (arg_is_set(cmd, yes_ARG) ? DONT_PROMPT : PROMPT);
unsigned lv_count, missing;
- force_t force;
if (!vg_check_status(vg, EXPORTED_VG))
return_ECMD_FAILED;
lv_count = vg_visible_lvs(vg);
- force = (force_t) arg_count(cmd, force_ARG);
if (lv_count) {
if (force == PROMPT) {
if ((missing = vg_missing_pv_count(vg)))
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fbf14b12d8710f10…
Commit: fbf14b12d8710f10b7a7f1a0a23347ac5ad1a826
Parent: cb49dd4aa4e6fecb80c163f0279803d4036e48c5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 6 14:43:25 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 6 15:22:24 2014 +0200
man: lvconvert new split options
Update man page with info how to split/uncache cached logical
volumes.
lvconvert: splitsnapshot support --yes
Allow to use --yes to skip prompt.
---
man/lvconvert.8.in | 84 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 64 insertions(+), 20 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index b8951e2..b08e420 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -32,6 +32,25 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.IR LogicalVolume [ Path ]
.RI [ PhysicalVolume [ Path ][ :PE [ \-PE ]]...]
.sp
+.B lvconvert
+.BR \-\-split
+.RB [ \-\-commandprofile
+.IR ProfileName ]
+.RB [ \-h | \-? | \-\-help ]
+.RB [ \-\-noudevsync ]
+.RB [ \-v | \-\-verbose ]
+.IR SplitableLogicalVolume { Name | Path }
+.sp
+.B lvconvert
+.BR \-\-splitcache | \-\-uncache
+.RB [ \-\-commandprofile
+.IR ProfileName ]
+.RB [ \-h | \-? | \-\-help ]
+.RB [ \-\-noudevsync ]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-\-version ]
+.IR CacheLogicalVolume { Name | Path }
+.sp
.B lvconvert \-\-splitmirrors \fIImages
.RB [ \-\-name
.IR SplitLogicalVolumeName ]
@@ -122,20 +141,20 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.RB [ \-\-poolmetadataspare
.RI { y | n }]
.RB [ \-Z | \-\-zero \ { \fIy | \fIn }]]
-.RI [[ ExternalOrigin | ThinPool ] LogicalVolume { Name | Path }]
-.RI [ PhysicalVolume [ Path ][ :PE
-.RI [ \-PE ]]...]
.RB [ \-\-commandprofile
.IR ProfileName ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
+.RI [[ ExternalOrigin | ThinPool ] LogicalVolume { Name | Path }]
+.RI [ PhysicalVolume [ Path ][ :PE
+.RI [ \-PE ]]...]
.sp
.B lvconvert
.RB [ \-\-type
-.BR \fIcache [ \fI\-pool ]| \-\-cache ]
+.BR \fIcache [ \fI\-pool ]| \-H | \-\-cache ]
.RB [ \-\-cachepool
-.IR CachePoolLV { Name | Path }]
+.IR CachePoolLogicalVolume { Name | Path }]
.RB [ \-c | \-\-chunksize
.IR ChunkSize [ bBsSkKmMgG ]]
.RB [ \-\-cachemode
@@ -147,13 +166,13 @@ lvconvert \(em convert a logical volume from linear to mirror or snapshot
.IR CachePoolMetadataSize [ bBsSkKmMgG ]}]
.RB [ \-\-poolmetadataspare
.RI { y | n }]
-.IR LogicalVolume { Name | Path }
-.RI [ PhysicalVolume [ Path ][ :PE [ \-PE ]]...]
.RB [ \-\-commandprofile
.IR ProfileName ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
+.IR LogicalVolume { Name | Path }
+.RI [ PhysicalVolume [ Path ][ :PE [ \-PE ]]...]
.sp
.SH DESCRIPTION
@@ -181,18 +200,21 @@ Exactly one of
.BR \-\-mirrors ,
.BR \-\-repair ,
.BR \-\-replace ,
-.BR \-\-splitsnapshot ,
.BR \-\-snapshot ,
+.BR \-\-split ,
+.BR \-\-splitcache ,
+.BR \-\-splitsnapshot ,
.BR \-\-splitmirrors ,
-.BR \-\-thin
-or
+.BR \-\-thin ,
.BR \-\-type
+or
+.BR \-\-uncache
arguments is required.
.TP
.BR \-b ", " \-\-background
Run the daemon in the background.
.TP
-.BR \-\-cache ", " \-\-type\ \fIcache
+.BR \-H ", " \-\-cache ", " \-\-type\ \fIcache
Converts logical volume to a cached LV with the use of cache pool
specified with \fB\-\-cachepool\fP.
For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(8).
@@ -277,6 +299,19 @@ the data changed get resynchronized.
Please note that this feature is only supported with the new md-based mirror
implementation and not with the original device-mapper mirror implementation.
.TP
+.B \-\-split
+Separates \fISplitableLogicalVolume\fP.
+Option is agregating various split commands and tries to detect necessary split
+operation from its arguments.
+.TP
+.BR \-\-splitcache ", " \-\-uncache
+Separates \fICacheLogicalVolume\fP from cache pool.
+Before volume becomes uncached, cache is flushed.
+With \-\-split the cache pool volume is then left unused and
+could be i.e. used for caching other volumes.
+The inverse of \-\-cache is \-\-uncache where the cache pool
+component volumes are automatically removed.
+.TP
.B \-\-splitsnapshot
Separates \fISnapshotLogicalVolume\fP from its origin.
The volume that is split off contains the chunks that differ from the origin
@@ -347,7 +382,7 @@ Without this option a default name of "lvol<n>" will be generated where
This volume will be read-only and cannot be further modified as long,
as it is being used as the external origin.
.TP
-.BR \-\-poolmetadata " " \fIThinPoolMetadataLogicalVolume { \fIName | \fIPath }
+.BR \-\-poolmetadata " " \fIPoolMetadataLogicalVolume { \fIName | \fIPath }
Specifies cache or thin pool metadata logical volume.
The size should be in between 2MiB and 16GiB.
Cache pool is specified with the option
@@ -369,12 +404,12 @@ thin provisioning tools
and
.BR thin_restore (8).
.TP
-.BR \-\-poolmetadatasize " " \fIThinPoolMetadataSize [ \fIbBsSkKmMgG ]
-Sets the size of thin pool's metadata logical volume,
+.BR \-\-poolmetadatasize " " \fIPoolMetadataSize [ \fIbBsSkKmMgG ]
+Sets the size of cache or thin pool's metadata logical volume,
if the pool metadata volume is undefined.
-Thin pool is specified with the option
-\fB\-\-thinpool\fP.
-Supported value is in the range between 2MiB and 16GiB.
+Pool is specified with the option
+\B\-\-cachepool\P or \fB\-\-thinpool\fP.
+For thin pool supported value is in the range between 2MiB and 16GiB.
The default value is estimated with this formula
(Pool_LV_size / Pool_LV_chunk_size * 64b).
Default unit is megabytes.
@@ -554,11 +589,20 @@ given cache metadata LV.
.B lvconvert \-\-type cache-pool \-\-poolmetadata vg00/lvx_meta vg00/lvx_data
.br
.B lvrename vg00/lvx_data vg00/lvx_cachepool
-
+.sp
Convert an existing logical volume to a cache LV using the given
-cache pool LV.
+cache pool LV and chunk size 128KiB.
+.sp
+.B lvconvert \-\-cache \-\-cachepool vg00/lvx_cachepool -c 128 vg00/lvx
+.sp
+Detach cache pool from an existing cached logical volume "vg00/lvol1" and
+leave cache pool unused.
+.sp
+.B lvconvert \-\-splitcache vg00/lvol1
+.sp
+Drop cache pool from an existing cached logical volume "vg00/lvol1".
.sp
-.B lvconvert \-\-cache \-\-cachepool vg00/lvx_cachepool vg00/lvx
+.B lvconvert \-\-uncache vg00/lvol1
.SH SEE ALSO
.BR lvm (8),