mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-19 07:33:14 +03:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b9a16fe73b | ||
|
9ed518f19f | ||
|
5ac230095c | ||
|
a3e8354479 | ||
|
59d54d70e7 | ||
|
1e64386dc6 | ||
|
1f715ab3b2 | ||
|
56704383bf | ||
|
f8034e14e6 | ||
|
3018cdcaa7 | ||
|
1095322901 | ||
|
3503ef23e3 | ||
|
635e7e0c92 | ||
|
3e3f2a53ea | ||
|
dfc083d8d6 | ||
|
6c342abb7f | ||
|
4b121a1f6f | ||
|
61cfe2d55b | ||
|
19e6c338d3 | ||
|
51a31dbd79 | ||
|
f5b0697c05 |
@@ -1 +1 @@
|
||||
1.02.139-git (2017-03-28)
|
||||
1.02.139-git (2017-04-13)
|
||||
|
18
WHATS_NEW
18
WHATS_NEW
@@ -1,5 +1,21 @@
|
||||
Version 2.02.170 -
|
||||
Version 2.02.170 - 13th April 2017
|
||||
==================================
|
||||
Introduce global/fsadm_executable to make fsadm path configurable.
|
||||
Look for limited thin pool metadata size when using 16G metadata.
|
||||
Add lvconvert pool creation rule disallowing options with poolmetadata.
|
||||
Fix lvconvert when the same LV is incorrectly reused in options.
|
||||
Fix lvconvert VG name validation in option values.
|
||||
Fix missing lvmlockd LV locks in lvchange and lvconvert.
|
||||
Fix dmeventd setup for lvchange --poll.
|
||||
Fix use of --poll and --monitor with lvchange and vgchange.
|
||||
Disallow lvconvert of hidden LV to a pool.
|
||||
Ignore --partial option when not used for activation.
|
||||
Allow --activationmode option with lvchange --refresh.
|
||||
Better message on lvconvert --regionsize
|
||||
Allow valid lvconvert --regionsize change
|
||||
Add raid10 alias raid10_near
|
||||
Handle insufficient PVs on lvconvert takeover
|
||||
Fix SIGINT blocking to prevent corrupted metadata
|
||||
Fix systemd unit existence check for lvmconf --services --startstopservices.
|
||||
Check and use PATH_MAX buffers when creating vgrename device paths.
|
||||
|
||||
|
@@ -1,5 +1,10 @@
|
||||
Version 1.02.139 -
|
||||
Version 1.02.139 - 13th April 2017
|
||||
==================================
|
||||
Fix assignment in _target_version() when dm task can't run.
|
||||
Flush stdout on each iteration when using --count or --interval.
|
||||
Show detailed error message when execvp fails while starting dmfilemapd.
|
||||
Fix segmentation fault when dmfilemapd is run with no arguments.
|
||||
Numerous minor dmfilemapd fixes from coverity.
|
||||
|
||||
Version 1.02.138 - 28th March 2017
|
||||
==================================
|
||||
|
@@ -389,6 +389,17 @@ allocation {
|
||||
# Cache pool metadata and data will always use different PVs.
|
||||
cache_pool_metadata_require_separate_pvs = 0
|
||||
|
||||
# Configuration option allocation/cache_metadata_format.
|
||||
# Sets default metadata format for new cache.
|
||||
#
|
||||
# Accepted values:
|
||||
# 0 Automatically detected best available format
|
||||
# 1 Original format
|
||||
# 2 Improved 2nd. generation format
|
||||
#
|
||||
# This configuration option has an automatic default value.
|
||||
# cache_metadata_format = 0
|
||||
|
||||
# Configuration option allocation/cache_mode.
|
||||
# The default cache mode used for new cache.
|
||||
#
|
||||
@@ -403,17 +414,6 @@ allocation {
|
||||
# This configuration option has an automatic default value.
|
||||
# cache_mode = "writethrough"
|
||||
|
||||
# Configuration option allocation/cache_metadata_format.
|
||||
# Sets default metadata format for new cache.
|
||||
#
|
||||
# Accepted values:
|
||||
# 0 Automatically detected best available format
|
||||
# 1 Original format
|
||||
# 2 Improved 2nd. generation format
|
||||
#
|
||||
# This configuration option has an automatic default value.
|
||||
# cache_metadata_format = 0
|
||||
|
||||
# Configuration option allocation/cache_policy.
|
||||
# The default cache policy used for new cache volume.
|
||||
# Since kernel 4.2 the default policy is smq (Stochastic multiqueue),
|
||||
@@ -1069,6 +1069,12 @@ global {
|
||||
# This configuration option has an automatic default value.
|
||||
# cache_repair_options = [ "" ]
|
||||
|
||||
# Configuration option global/fsadm_executable.
|
||||
# The full path to the fsadm command.
|
||||
# LVM uses this command to help with lvresize -r operations.
|
||||
# This configuration option has an automatic default value.
|
||||
# fsadm_executable = "@FSADM_PATH@"
|
||||
|
||||
# Configuration option global/system_id_source.
|
||||
# The method LVM uses to set the local system ID.
|
||||
# Volume Groups can also be given a system ID (by vgcreate, vgchange,
|
||||
|
12
configure
vendored
12
configure
vendored
@@ -699,6 +699,7 @@ HAVE_VALGRIND
|
||||
HAVE_REALTIME
|
||||
HAVE_LIBDL
|
||||
BLKDEACTIVATE
|
||||
FSADM_PATH
|
||||
FSADM
|
||||
ELDFLAGS
|
||||
DM_LIB_PATCHLEVEL
|
||||
@@ -821,8 +822,8 @@ THIN_CHECK_CMD
|
||||
HAVE_FULL_RELRO
|
||||
HAVE_PIE
|
||||
POW_LIB
|
||||
LIBOBJS
|
||||
ALLOCA
|
||||
LIBOBJS
|
||||
SORT
|
||||
WC
|
||||
CHMOD
|
||||
@@ -15319,6 +15320,14 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
FSADM_PATH="$lvm_exec_prefix/sbin/fsadm"
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define FSADM_PATH "$FSADM_PATH"
|
||||
_ACEOF
|
||||
|
||||
|
||||
################################################################################
|
||||
if test "$BUILD_DMEVENTD" = yes; then
|
||||
|
||||
@@ -15659,6 +15668,7 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@@ -1895,6 +1895,10 @@ test "$prefix" != NONE && clvmd_prefix=$prefix
|
||||
CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
|
||||
AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
|
||||
|
||||
|
||||
FSADM_PATH="$lvm_exec_prefix/sbin/fsadm"
|
||||
AC_DEFINE_UNQUOTED(FSADM_PATH, ["$FSADM_PATH"], [Path to fsadm binary.])
|
||||
|
||||
################################################################################
|
||||
dnl -- dmeventd pidfile and executable path
|
||||
if test "$BUILD_DMEVENTD" = yes; then
|
||||
@@ -2071,6 +2075,7 @@ AC_SUBST(DMFILEMAPD)
|
||||
AC_SUBST(DM_LIB_PATCHLEVEL)
|
||||
AC_SUBST(ELDFLAGS)
|
||||
AC_SUBST(FSADM)
|
||||
AC_SUBST(FSADM_PATH)
|
||||
AC_SUBST(BLKDEACTIVATE)
|
||||
AC_SUBST(HAVE_LIBDL)
|
||||
AC_SUBST(HAVE_REALTIME)
|
||||
|
@@ -533,6 +533,7 @@ static void _filemap_monitor_destroy(struct filemap_monitor *fm)
|
||||
_filemap_monitor_close_fd(fm);
|
||||
}
|
||||
dm_free((void *) fm->program_id);
|
||||
dm_free(fm->path);
|
||||
}
|
||||
|
||||
static int _filemap_monitor_check_same_file(int fd1, int fd2)
|
||||
@@ -589,7 +590,7 @@ check_unlinked:
|
||||
log_error("Could not format pid path.");
|
||||
return 0;
|
||||
}
|
||||
if ((len = readlink(path_buf, link_buf, sizeof(link_buf))) < 0) {
|
||||
if ((len = readlink(path_buf, link_buf, sizeof(link_buf) - 1)) < 0) {
|
||||
log_error("readlink failed for " DEFAULT_PROC_DIR "/%d/fd/%d.",
|
||||
getpid(), fm->fd);
|
||||
return 0;
|
||||
@@ -800,8 +801,10 @@ int main(int argc, char **argv)
|
||||
{
|
||||
struct filemap_monitor fm;
|
||||
|
||||
if (!_parse_args(argc, argv, &fm))
|
||||
if (!_parse_args(argc, argv, &fm)) {
|
||||
dm_free(fm.path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
_setup_logging();
|
||||
|
||||
|
@@ -148,6 +148,9 @@
|
||||
/* Library version */
|
||||
#undef DM_LIB_VERSION
|
||||
|
||||
/* Path to fsadm binary. */
|
||||
#undef FSADM_PATH
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
#undef HAVE_ALARM
|
||||
|
||||
|
@@ -260,6 +260,11 @@ static int _info_run(const char *dlid, struct dm_info *dminfo,
|
||||
start *= seg_status->seg->le;
|
||||
length *= _seg_len(seg_status->seg);
|
||||
|
||||
/* Uses max DM_THIN_MAX_METADATA_SIZE sectors for metadata device */
|
||||
if (lv_is_thin_pool_metadata(seg_status->seg->lv) &&
|
||||
(length > DM_THIN_MAX_METADATA_SIZE))
|
||||
length = DM_THIN_MAX_METADATA_SIZE;
|
||||
|
||||
do {
|
||||
target = dm_get_next_target(dmt, target, &target_start,
|
||||
&target_length, &target_name, &target_params);
|
||||
|
@@ -1035,6 +1035,10 @@ cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECT
|
||||
cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
|
||||
"List of options passed to the cache_repair command.\n")
|
||||
|
||||
cfg(global_fsadm_executable_CFG, "fsadm_executable", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_FSADM_PATH, vsn(2, 2, 170), "@FSADM_PATH@", 0, NULL,
|
||||
"The full path to the fsadm command.\n"
|
||||
"LVM uses this command to help with lvresize -r operations.\n")
|
||||
|
||||
cfg(global_system_id_source_CFG, "system_id_source", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_SYSTEM_ID_SOURCE, vsn(2, 2, 117), NULL, 0, NULL,
|
||||
"The method LVM uses to set the local system ID.\n"
|
||||
"Volume Groups can also be given a system ID (by vgcreate, vgchange,\n"
|
||||
|
@@ -135,6 +135,8 @@
|
||||
#define DEFAULT_CACHE_METADATA_FORMAT CACHE_METADATA_FORMAT_UNSELECTED /* Autodetect */
|
||||
#define DEFAULT_CACHE_MODE "writethrough"
|
||||
|
||||
#define DEFAULT_FSADM_PATH FSADM_PATH
|
||||
|
||||
#define DEFAULT_UMASK 0077
|
||||
|
||||
#define DEFAULT_FORMAT "lvm2"
|
||||
|
@@ -4567,13 +4567,13 @@ static int _request_confirmation(const struct logical_volume *lv,
|
||||
}
|
||||
|
||||
enum fsadm_cmd_e { FSADM_CMD_CHECK, FSADM_CMD_RESIZE };
|
||||
#define FSADM_CMD "fsadm"
|
||||
|
||||
#define FSADM_CMD_MAX_ARGS 6
|
||||
#define FSADM_CHECK_FAILS_FOR_MOUNTED 3 /* shell exist status code */
|
||||
|
||||
/*
|
||||
* FSADM_CMD --dry-run --verbose --force check lv_path
|
||||
* FSADM_CMD --dry-run --verbose --force resize lv_path size
|
||||
* fsadm --dry-run --verbose --force check lv_path
|
||||
* fsadm --dry-run --verbose --force resize lv_path size
|
||||
*/
|
||||
static int _fsadm_cmd(enum fsadm_cmd_e fcmd,
|
||||
struct logical_volume *lv,
|
||||
@@ -4588,7 +4588,7 @@ static int _fsadm_cmd(enum fsadm_cmd_e fcmd,
|
||||
const char *argv[FSADM_CMD_MAX_ARGS + 2];
|
||||
unsigned i = 0;
|
||||
|
||||
argv[i++] = FSADM_CMD;
|
||||
argv[i++] = find_config_tree_str(cmd, global_fsadm_executable_CFG, NULL);
|
||||
|
||||
if (test_mode())
|
||||
argv[i++] = "--dry-run";
|
||||
|
@@ -2225,9 +2225,9 @@ static int _raid_reshape(struct logical_volume *lv,
|
||||
log_print_unless_silent("No change in RAID LV %s layout, freeing reshape space.", display_lvname(lv));
|
||||
|
||||
if (where_it_was == alloc_none) {
|
||||
log_print_unless_silent("LV %s does not have reshape space allocated.",
|
||||
display_lvname(lv));
|
||||
return 1;
|
||||
log_error("LV %s does not have reshape space allocated.",
|
||||
display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, 0, NULL, NULL))
|
||||
@@ -5792,9 +5792,10 @@ static int _region_size_change_requested(struct logical_volume *lv, int yes, con
|
||||
return_0;
|
||||
|
||||
if (region_size == seg->region_size) {
|
||||
log_print_unless_silent("Region size wouldn't change on %s LV %s.",
|
||||
lvseg_name(seg), display_lvname(lv));
|
||||
return 1;
|
||||
log_error("Region size is already %s on %s LV %s.",
|
||||
display_size(lv->vg->cmd, region_size),
|
||||
lvseg_name(seg), display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_check_region_size_constraints(lv, seg->segtype, region_size, seg->stripe_size))
|
||||
|
@@ -2400,9 +2400,8 @@ static int _target_version(const char *target_name, uint32_t *maj,
|
||||
if (!dm_task_run(dmt)) {
|
||||
log_debug_activation("Failed to get %s target versions", target_name);
|
||||
/* Assume this was because LIST_VERSIONS isn't supported */
|
||||
maj = min = patchlevel = 0;
|
||||
*maj = *min = *patchlevel = 0;
|
||||
r = 1;
|
||||
|
||||
} else
|
||||
for (target = dm_task_get_versions(dmt);
|
||||
target != last_target;
|
||||
|
@@ -323,6 +323,14 @@ required, after which the others are optional.
|
||||
[ \fB-a\fP|\fB--activate\fP \fBy\fP|\fBn\fP|\fBay\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--monitor\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.RE
|
||||
.br
|
||||
@@ -384,6 +392,14 @@ Activate or deactivate an LV.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--monitor\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--ignorelockingfailure\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -407,9 +423,17 @@ Reactivate an LV using the latest metadata.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--activationmode\fP \fBpartial\fP|\fBdegraded\fP|\fBcomplete\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--monitor\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.RE
|
||||
.br
|
||||
@@ -421,10 +445,6 @@ Start or stop monitoring an LV from dmeventd.
|
||||
\fBlvchange\fP \fB--monitor\fP \fBy\fP|\fBn\fP \fIVG\fP|\fILV\fP|\fITag\fP|\fISelect\fP ...
|
||||
.br
|
||||
.RS 4
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.RE
|
||||
.br
|
||||
@@ -455,6 +475,18 @@ Make the minor device number persistent for an LV.
|
||||
[ \fB-j\fP|\fB--major\fP \fINumber\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-a\fP|\fB--activate\fP \fBy\fP|\fBn\fP|\fBay\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--monitor\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.RE
|
||||
.br
|
||||
@@ -840,10 +872,10 @@ ignore the devices LVM creates.
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
Commands will do their best to activate LVs with missing PV extents.
|
||||
Missing extents may be replaced with error or zero segments
|
||||
according to the lvm.conf missing_stripe_filler setting.
|
||||
Metadata may not be changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
|
@@ -243,6 +243,17 @@ To display the current LV type, run the command:
|
||||
.B lvs -o name,segtype
|
||||
.I LV
|
||||
|
||||
In some cases, an LV is a single device mapper (dm) layer above physical
|
||||
devices. In other cases, hidden LVs (dm devices) are layered between the
|
||||
visible LV and physical devices. LVs in the middle layers are called sub LVs.
|
||||
A command run on a visible LV sometimes operates on a sub LV rather than
|
||||
the specified LV. In other cases, a sub LV must be specified directly on
|
||||
the command line.
|
||||
|
||||
Sub LVs can be displayed with the command:
|
||||
|
||||
.B lvs -a
|
||||
|
||||
The
|
||||
.B linear
|
||||
type is equivalent to the
|
||||
@@ -256,48 +267,44 @@ type is deprecated and the
|
||||
.B raid1
|
||||
type should be used. They are both implementations of mirroring.
|
||||
|
||||
In some cases, an LV is a single device mapper (dm) layer above physical
|
||||
devices. In other cases, hidden LVs (dm devices) are layered between the
|
||||
visible LV and physical devices. LVs in the middle layers are called sub LVs.
|
||||
A command run on a visible LV sometimes operates on a sub LV rather than
|
||||
the specified LV. In other cases, a sub LV must be specified directly on
|
||||
the command line.
|
||||
|
||||
Striped raid types are
|
||||
.B raid0/raid0_meta
|
||||
,
|
||||
.B raid5
|
||||
(an alias for raid5_ls),
|
||||
.B raid6
|
||||
(an alias for raid6_zr) and
|
||||
.B raid10
|
||||
(an alias for raid10_near).
|
||||
\fBraid0/raid0_meta\fP,
|
||||
\fBraid5\fP (an alias for raid5_ls),
|
||||
\fBraid6\fP (an alias for raid6_zr) and
|
||||
\fBraid10\fP (an alias for raid10_near).
|
||||
|
||||
As opposed to mirroring, raid5 and raid6 stripe data and calculate parity
|
||||
blocks. The parity blocks can be used for data block recovery in case devices
|
||||
fail. A maximum number of one device in a raid5 LV may fail and two in case
|
||||
of raid6. Striped raid types typically rotate the parity blocks for performance
|
||||
reasons thus avoiding contention on a single device. Layouts of raid5 rotating
|
||||
parity blocks can be one of left-asymmetric (raid5_la), left-symmetric (raid5_ls
|
||||
with alias raid5), right-asymmetric (raid5_ra), right-symmetric (raid5_rs) and raid5_n,
|
||||
which doesn't rotate parity blocks. Any \"_n\" layouts allow for conversion between
|
||||
raid levels (raid5_n -> raid6 or raid5_n -> striped/raid0/raid0_meta).
|
||||
raid6 layouts are zero-restart (raid6_zr with alias raid6), next-restart (raid6_nr),
|
||||
next-continue (raid6_nc). Additionally, special raid6 layouts for raid level conversions
|
||||
between raid5 and raid6 are raid6_ls_6, raid6_rs_6, raid6_la_6 and raid6_ra_6. Those
|
||||
correspond to their raid5 counterparts (e.g. raid5_rs can be directly converted to raid6_rs_6
|
||||
and vice-versa).
|
||||
raid10 (an alias for raid10_near) is currently limited to one data copy and even number of
|
||||
sub LVs. This is a mirror group layout thus a single sub LV may fail per mirror group
|
||||
without data loss.
|
||||
Striped raid types support converting the layout, their stripesize
|
||||
and their number of stripes.
|
||||
blocks. The parity blocks can be used for data block recovery in case
|
||||
devices fail. A maximum number of one device in a raid5 LV may fail, and
|
||||
two in case of raid6. Striped raid types typically rotate the parity and
|
||||
data blocks for performance reasons, thus avoiding contention on a single
|
||||
device. Specific arrangements of parity and data blocks (layouts) can be
|
||||
used to optimize I/O performance, or to convert between raid levels. See
|
||||
\fBlvmraid\fP(7) for more information.
|
||||
|
||||
The striped raid types combined with raid1 allow for conversion from linear -> striped/raid0/raid0_meta
|
||||
and vice-versa by e.g. linear <-> raid1 <-> raid5_n (then adding stripes) <-> striped/raid0/raid0_meta.
|
||||
Layouts of raid5 rotating parity blocks can be: left-asymmetric
|
||||
(raid5_la), left-symmetric (raid5_ls with alias raid5), right-asymmetric
|
||||
(raid5_ra), right-symmetric (raid5_rs) and raid5_n, which doesn't rotate
|
||||
parity blocks. Layouts of raid6 are: zero-restart (raid6_zr with alias
|
||||
raid6), next-restart (raid6_nr), and next-continue (raid6_nc).
|
||||
|
||||
Sub LVs can be displayed with the command
|
||||
.B lvs -a
|
||||
Layouts including _n allow for conversion between raid levels (raid5_n to
|
||||
raid6 or raid5_n to striped/raid0/raid0_meta). Additionally, special raid6
|
||||
layouts for raid level conversions between raid5 and raid6 are:
|
||||
raid6_ls_6, raid6_rs_6, raid6_la_6 and raid6_ra_6. Those correspond to
|
||||
their raid5 counterparts (e.g. raid5_rs can be directly converted to
|
||||
raid6_rs_6 and vice-versa).
|
||||
|
||||
raid10 (an alias for raid10_near) is currently limited to one data copy
|
||||
and even number of sub LVs. This is a mirror group layout, thus a single
|
||||
sub LV may fail per mirror group without data loss.
|
||||
|
||||
Striped raid types support converting the layout, their stripesize and
|
||||
their number of stripes.
|
||||
|
||||
The striped raid types combined with raid1 allow for conversion from
|
||||
linear -> striped/raid0/raid0_meta and vice-versa by e.g. linear <-> raid1
|
||||
<-> raid5_n (then adding stripes) <-> striped/raid0/raid0_meta.
|
||||
.SH USAGE
|
||||
Convert LV to linear.
|
||||
.br
|
||||
|
@@ -244,9 +244,9 @@ lvcreate - Create a logical volume
|
||||
.SH DESCRIPTION
|
||||
lvcreate creates a new LV in a VG. For standard LVs, this requires
|
||||
allocating logical extents from the VG's free physical extents. If there
|
||||
is not enough free space, then the VG can be extended (see
|
||||
\fBvgextend\fP(8)) with other PVs, or existing LVs can be reduced or
|
||||
removed (see \fBlvremove\fP, \fBlvreduce\fP.)
|
||||
is not enough free space, the VG can be extended with other PVs
|
||||
(\fBvgextend\fP(8)), or existing LVs can be reduced or removed
|
||||
(\fBlvremove\fP(8), \fBlvreduce\fP(8).)
|
||||
|
||||
To control which PVs a new LV will use, specify one or more PVs as
|
||||
position args at the end of the command line. lvcreate will allocate
|
||||
@@ -263,7 +263,7 @@ unique PVs be available in the VG for allocation.
|
||||
Thin pools (for thin provisioning) and cache pools (for caching) are
|
||||
represented by special LVs with types thin-pool and cache-pool (see
|
||||
\fBlvmthin\fP(7) and \fBlvmcache\fP(7)). The pool LVs are not usable as
|
||||
standard block devices, but the LV names act references to the pools.
|
||||
standard block devices, but the LV names act as references to the pools.
|
||||
|
||||
Thin LVs are thinly provisioned from a thin pool, and are created with a
|
||||
virtual size rather than a physical size. A cache LV is the combination of
|
||||
@@ -271,13 +271,12 @@ a standard LV with a cache pool, used to cache active portions of the LV
|
||||
to improve performance.
|
||||
.SS Usage notes
|
||||
In the usage section below, \fB--size\fP \fISize\fP can be replaced
|
||||
with \fB--extents\fP \fINumber\fP. See both descriptions
|
||||
the options section.
|
||||
with \fB--extents\fP \fINumber\fP. See descriptions in the options section.
|
||||
|
||||
In the usage section below, \fB--name\fP is omitted from the required
|
||||
options, even though it is typically used. When the name is not
|
||||
options, even though it is typically used. When the name is not
|
||||
specified, a new LV name is generated with the "lvol" prefix and a unique
|
||||
numeric suffix. Also see the description in the options section.
|
||||
numeric suffix.
|
||||
.SH USAGE
|
||||
Create a linear LV.
|
||||
.br
|
||||
|
@@ -48,10 +48,6 @@ and more, using a more compact and configurable output format.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -343,15 +339,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -29,10 +29,6 @@ if information changes between commands.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -325,15 +321,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -28,10 +28,6 @@ lvs produces formatted output about LVs.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -339,15 +335,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -45,10 +45,6 @@ Common options for command:
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--ignorelockingfailure\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -184,15 +180,6 @@ Display long help text.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -24,10 +24,6 @@ pvs produces formatted output about PVs.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -326,15 +322,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -35,10 +35,6 @@ It may also be useful to regularly back up the files in
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--foreign\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -179,15 +175,6 @@ Display long help text.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -270,6 +270,10 @@ required, after which the others are optional.
|
||||
.RE
|
||||
.br
|
||||
.RS 4
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
[ COMMON_OPTIONS ]
|
||||
.RE
|
||||
.br
|
||||
@@ -379,10 +383,6 @@ Reactivate LVs using the latest metadata.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--monitor\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--poll\fP \fBy\fP|\fBn\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -761,10 +761,10 @@ ignore the devices LVM creates.
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
Commands will do their best to activate LVs with missing PV extents.
|
||||
Missing extents may be replaced with error or zero segments
|
||||
according to the lvm.conf missing_stripe_filler setting.
|
||||
Metadata may not be changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
|
@@ -35,10 +35,6 @@ and more, using a more compact and configurable output format.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -317,15 +313,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -24,10 +24,6 @@ vgs produces formatted output about VGs.
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB-S\fP|\fB--select\fP \fIString\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -321,15 +317,6 @@ See lvmreport(7) for more information about reporting.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -14,10 +14,6 @@ vgscan scans all supported LVM block devices in the system for VGs.
|
||||
.br
|
||||
.RS 4
|
||||
.ad l
|
||||
[ \fB-P\fP|\fB--partial\fP ]
|
||||
.ad b
|
||||
.br
|
||||
.ad l
|
||||
[ \fB--cache\fP ]
|
||||
.ad b
|
||||
.br
|
||||
@@ -165,15 +161,6 @@ notify_dbus config setting is disabled.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB-P\fP|\fB--partial\fP
|
||||
.br
|
||||
When set, the tools will do their best to provide access to VGs
|
||||
that are only partially available (one or more PVs belonging
|
||||
to the VG are missing from the system). Metadata may not be
|
||||
changed with this option.
|
||||
.ad b
|
||||
.HP
|
||||
.ad l
|
||||
\fB--profile\fP \fIString\fP
|
||||
.br
|
||||
An alias for --commandprofile or --metadataprofile, depending
|
||||
|
@@ -1156,6 +1156,7 @@ global/thin_repair_executable = "$LVM_TEST_THIN_REPAIR_CMD"
|
||||
global/use_lvmetad = $LVM_TEST_LVMETAD
|
||||
global/use_lvmpolld = $LVM_TEST_LVMPOLLD
|
||||
global/use_lvmlockd = $LVM_TEST_LVMLOCKD
|
||||
global/fsadm_executable = "$TESTDIR/lib/fsadm"
|
||||
log/activation = 1
|
||||
log/file = "$TESTDIR/debug.log"
|
||||
log/indent = 1
|
||||
|
@@ -33,7 +33,7 @@ lvcreate -L3 -n cow $vg
|
||||
not lvconvert -s cow $vg/$lv1
|
||||
|
||||
# Use cached LV with 'striped' cow volume
|
||||
lvconvert -y -s $vg/$lv1 $vg/cow
|
||||
lvconvert -y -s $vg/$lv1 cow
|
||||
check lv_field $vg/cow segtype linear
|
||||
check lv_field $vg/$lv1 segtype cache
|
||||
|
||||
|
@@ -60,9 +60,13 @@ check lv_field $vg/$lv2 cache_settings "random_threshold=56,sequential_threshold
|
||||
# Check swap of cache pool metadata
|
||||
lvconvert --yes --type cache-pool --poolmetadata $lv4 $vg/$lv3
|
||||
UUID=$(get lv_field $vg/$lv5 uuid)
|
||||
lvconvert --yes --swapmetadata --poolmetadata $lv5 $vg/$lv3
|
||||
lvconvert --yes --cachepool $vg/$lv3 --poolmetadata $lv5
|
||||
check lv_field $vg/${lv3}_cmeta uuid "$UUID"
|
||||
|
||||
# Check swap of cache pool metadata with --swapmetadata
|
||||
# (should swap back to lv5)
|
||||
lvconvert --yes --swapmetadata $vg/$lv3 --poolmetadata $lv5
|
||||
check lv_field $vg/$lv5 uuid "$UUID"
|
||||
|
||||
#fail lvconvert --cachepool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
#lvconvert --yes --type cache-pool --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
@@ -108,30 +112,32 @@ lvcreate -an -Zn -L 8 -n $lv4 $vg
|
||||
invalid lvconvert --type cache --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
|
||||
# Cannot mix with thins
|
||||
not lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
|
||||
not lvconvert --type cache --thin --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
invalid lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
|
||||
invalid lvconvert --type cache --thin --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
|
||||
# Undefined cached volume
|
||||
not lvconvert --type cache --cachepool $vg/$lv1
|
||||
not lvconvert --cache --cachepool $vg/$lv1
|
||||
invalid lvconvert --type cache --cachepool $vg/$lv1
|
||||
invalid lvconvert --cache --cachepool $vg/$lv1
|
||||
|
||||
# FIXME: temporarily we return error code 5
|
||||
INVALID=not
|
||||
# Single vg is required
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
|
||||
not lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
$INVALID lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
|
||||
$INVALID lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
|
||||
$INVALID lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
|
||||
$INVALID lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
|
||||
not lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
$INVALID lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
|
||||
# Invalid syntax, vg is unknown
|
||||
not lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
$INVALID lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
|
||||
# Invalid chunk size is <32KiB >1GiB
|
||||
not lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
not lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
$INVALID lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
$INVALID lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
# Invalid chunk size is bigger then data size, needs to open VG
|
||||
not lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
fail lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
@@ -142,7 +148,7 @@ lvcreate --type cache-pool -an -v -L 2 -n cpool $vg
|
||||
lvcreate -H -L 4 -n corigin --cachepool $vg/cpool
|
||||
|
||||
# unsupported yet
|
||||
not lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
fail lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
#grep "Cannot convert internal LV" out
|
||||
|
||||
lvremove -f $vg
|
||||
@@ -154,13 +160,13 @@ lvcreate --type cache-pool -L10 $vg/$lv1
|
||||
lvcreate --cache -L20 $vg/$lv1
|
||||
lvcreate -L10 -n $lv2 $vg
|
||||
|
||||
not lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
not lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
not lvconvert --yes --type cache-pool $vg/$lv1
|
||||
not lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
fail lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
fail lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
fail lvconvert --yes --type cache-pool $vg/$lv1
|
||||
fail lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
not aux have_raid 1 0 0 || fail lvconvert --yes --type raid1 -m1 $vg/$lv1
|
||||
not lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
not lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
fail lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
fail lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
not aux have_thin 1 0 0 || fail lvconvert --yes -T --thinpool $vg/$lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
@@ -87,7 +87,7 @@ aux delay_dev "$dev2" 0 2000 ${offset}:1
|
||||
lvcreate -aey -l5 -Zn -Wn --type mirror --regionsize 16K -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
|
||||
should not lvconvert -m-1 $vg/$lv1 "$dev1"
|
||||
aux enable_dev "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
lvconvert -m2 $vg/$lv1 "$dev1" "$dev2" "$dev4" "$dev3:0" # If the above "should" failed...
|
||||
|
||||
aux wait_for_sync $vg $lv1
|
||||
@@ -113,7 +113,7 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# Next convert should fail b/c we can't have 2 at once
|
||||
should not lvconvert -m+1 $vg/$lv1 "$dev5"
|
||||
aux enable_dev "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
lvconvert -m2 $vg/$lv1 # In case the above "should" actually failed
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
@@ -156,7 +156,7 @@ lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE
|
||||
lvchange -an $vg/$lv1
|
||||
lvconvert -m+1 $vg/$lv1 "$dev4"
|
||||
lvchange -aey $vg/$lv1
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
lvremove -ff $vg
|
||||
@@ -168,7 +168,7 @@ lvremove -ff $vg
|
||||
lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE"
|
||||
LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
lvconvert -m-1 $vg/$lv1 "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -179,7 +179,7 @@ lvremove -ff $vg
|
||||
lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE"
|
||||
LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+2 -b $vg/$lv1 "$dev4" "$dev5"
|
||||
lvconvert -m-1 $vg/$lv1 "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -192,9 +192,9 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# FIXME: Extra wait here for mirror upconvert synchronization
|
||||
# otherwise we may fail her on parallel upconvert and downconvert
|
||||
# lvconvert-mirror-updown.sh tests this errornous case separately
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
lvconvert -m-1 $vg/$lv1 "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -207,9 +207,24 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# FIXME: Extra wait here for mirror upconvert synchronization
|
||||
# otherwise we may fail her on parallel upconvert and downconvert
|
||||
# lvconvert-mirror-updown.sh tests this errornous case separately
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
lvconvert -m-1 $vg/$lv1 "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
check mirror_legs $vg $lv1 2
|
||||
lvremove -ff $vg
|
||||
|
||||
# Check the same with new --startpool lvconvert command option
|
||||
lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE"
|
||||
LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# FIXME: Extra wait here for mirror upconvert synchronization
|
||||
# otherwise we may fail her on parallel upconvert and downconvert
|
||||
# lvconvert-mirror-updown.sh tests this errornous case separately
|
||||
should lvconvert --startpoll $vg/$lv1
|
||||
lvconvert -m-1 $vg/$lv1 "$dev2"
|
||||
should lvconvert --startpoll $vg/$lv1
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
|
@@ -28,8 +28,11 @@ function _test_regionsize
|
||||
local lv=$5
|
||||
|
||||
lvconvert --type $type --yes -R $regionsize $vg/$lv
|
||||
[ $? -ne 0 ] && return 1
|
||||
check lv_field $vg/$lv regionsize "$regionsize_str"
|
||||
|
||||
not lvconvert --regionsize $regionsize $vg/$lv 2>err
|
||||
grep "is already" err
|
||||
|
||||
fsck -fn "$DM_DEV_DIR/$vg/$lv"
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ lvchange -an $vg/$lv2 $vg/$lv1 $vg/pool $vg/repair
|
||||
|
||||
# Manual repair steps:
|
||||
# Test swapping - swap out thin-pool's metadata with our repair volume
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
|
||||
lvchange -ay $vg/repair
|
||||
|
||||
@@ -74,7 +74,7 @@ not "$LVM_TEST_THIN_DUMP_CMD" "$DM_DEV_DIR/$vg/repair" | tee dump
|
||||
lvchange -an $vg
|
||||
|
||||
# Swap repaired metadata back
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/fixed $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
|
||||
|
||||
# Check pool still preserves its original settings
|
||||
check lv_field $vg/pool chunksize "128.00k"
|
||||
@@ -87,7 +87,7 @@ vgchange -ay $vg
|
||||
vgchange -an $vg
|
||||
|
||||
# Put back 'broken' metadata
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
|
||||
# Check --repair usage
|
||||
lvconvert -v --repair $vg/pool
|
||||
@@ -98,7 +98,7 @@ lvchange -ay $vg/pool
|
||||
vgchange -an $vg
|
||||
|
||||
# Restore damaged metadata
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/pool_meta0 $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/pool_meta0 --thinpool $vg/pool
|
||||
|
||||
# Check lvremove -ff works even with damaged pool
|
||||
lvremove -ff $vg
|
||||
|
@@ -29,9 +29,11 @@ aux wait_for_sync $vg $lv1
|
||||
aux wait_for_sync $vg $lv2
|
||||
lvchange -an $vg/$lv1
|
||||
|
||||
# FIXME: temporarily we return error code 5
|
||||
INVALID=not
|
||||
# conversion fails for internal volumes
|
||||
not lvconvert --thinpool $vg/${lv1}_rimage_0
|
||||
not lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0
|
||||
$INVALID lvconvert --thinpool $vg/${lv1}_rimage_0
|
||||
$INVALID lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0
|
||||
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
|
@@ -57,14 +57,17 @@ lvchange -an $vg/$lv1
|
||||
|
||||
# conversion fails for mirror segment type
|
||||
fail lvconvert --thinpool $vg/$lv1
|
||||
|
||||
# FIXME: temporarily we return error code 5
|
||||
INVALID=not
|
||||
# cannot use same LV
|
||||
not lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2
|
||||
$INVALID lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2
|
||||
|
||||
prepare_lvs
|
||||
|
||||
# conversion fails for internal volumes
|
||||
# can't use --readahead with --poolmetadata
|
||||
not lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512
|
||||
invalid lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
prepare_lvs
|
||||
@@ -81,10 +84,14 @@ grep "Pool zeroing and large" err
|
||||
UUID=$(get lv_field $vg/$lv2 uuid)
|
||||
# Fail is pool is active
|
||||
# TODO maybe detect inactive pool and deactivate
|
||||
fail lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1
|
||||
fail lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2
|
||||
lvchange -an $vg
|
||||
lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2
|
||||
check lv_field $vg/${lv1}_tmeta uuid "$UUID"
|
||||
|
||||
# and swap again with new command --swapmetadata
|
||||
lvconvert --yes --swapmetadata $vg/$lv1 --poolmetadata $lv2
|
||||
check lv_field $vg/$lv2 uuid "$UUID"
|
||||
lvremove -f $vg
|
||||
|
||||
|
||||
@@ -96,20 +103,20 @@ lvcreate -L1M -n $lv3 $vg
|
||||
# chunk size is bigger then size of thin pool data
|
||||
fail lvconvert --yes -c 1G --thinpool $vg/$lv3
|
||||
# stripes can't be used with poolmetadata
|
||||
not lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# too small metadata (<2M)
|
||||
fail lvconvert --yes -c 64 --thinpool $vg/$lv1 --poolmetadata $vg/$lv3
|
||||
# too small chunk size fails
|
||||
not lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
$INVALID lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# too big chunk size fails
|
||||
not lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
$INVALID lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# negative chunk size fails
|
||||
not lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
$INVALID lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# non multiple of 64KiB fails
|
||||
not lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
$INVALID lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
# cannot use same LV for pool and convertion
|
||||
not lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3
|
||||
$INVALID lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3
|
||||
|
||||
# Warning about smaller then suggested
|
||||
lvconvert --yes -c 256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 2>&1 | tee err
|
||||
@@ -129,7 +136,7 @@ if test "$TSIZE" = 64T; then
|
||||
lvcreate -L24T -n $lv1 $vg
|
||||
# Warning about bigger then needed (24T data and 16G -> 128K chunk)
|
||||
lvconvert --yes -c 64 --thinpool $vg/$lv1 2>&1 | tee err
|
||||
grep "too small" err
|
||||
grep "WARNING: Chunk size is too small" err
|
||||
lvremove -f $vg
|
||||
fi
|
||||
|
||||
|
@@ -56,7 +56,8 @@ fail lvcreate -l 1 --cachepool pool8 $vg
|
||||
|
||||
# no size specified
|
||||
invalid lvcreate --cachepool pool $vg 2>&1 | tee err
|
||||
# grep "specify either size or extents" err
|
||||
#grep "specify either size or extents" err
|
||||
grep "Incorrect syntax" err
|
||||
|
||||
# Check nothing has been created yet
|
||||
check vg_field $vg lv_count 0
|
||||
|
@@ -37,6 +37,11 @@ lvcreate -L4M --chunksize 64k --poolmetadatasize 17G -T $vg/pool2 2>out
|
||||
grep "WARNING: Maximum" out
|
||||
check lv_field $vg/pool1_tmeta size "2.00m"
|
||||
check lv_field $vg/pool2_tmeta size "16.00g"
|
||||
|
||||
# Check can start and see thinpool with metadata size above kernel limit
|
||||
lvcreate -L4M --poolmetadatasize 16G -T $vg/poolM
|
||||
check lv_field $vg/poolM data_percent "0.00"
|
||||
|
||||
lvremove -ff $vg
|
||||
|
||||
# Test automatic calculation of pool metadata size
|
||||
|
@@ -38,7 +38,7 @@ lvchange -an $vg
|
||||
|
||||
lvcreate -L2M -n $lv1 $vg
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
# Cannot resize if set to 0%
|
||||
not lvextend --use-policies --config 'activation{thin_pool_autoextend_percent = 0}' $vg/pool 2>&1 | tee err
|
||||
|
@@ -78,7 +78,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
# Not alllowed when thin-pool metadata free space is <75% for 2M meta
|
||||
fail lvcreate -V20 $vg/pool
|
||||
@@ -91,7 +91,7 @@ lvchange -an $vg/pool
|
||||
fake_metadata_ 7400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2"
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv2 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2
|
||||
lvchange -ay $vg/pool
|
||||
# Check generated metadata consume more then 88%
|
||||
test "$(meta_percent_)" -gt "88"
|
||||
@@ -138,7 +138,7 @@ lvchange -an $vg/thin $vg/thin2 $vg/pool
|
||||
# Transaction_id is lower by 1 and there are no messages -> ERROR
|
||||
fake_metadata_ 10 0 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@@ -147,7 +147,7 @@ check inactive $vg pool_tmeta
|
||||
# Transaction_id is higher by 1
|
||||
fake_metadata_ 10 3 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@@ -158,7 +158,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
vgchange -ay $vg
|
||||
|
||||
@@ -173,7 +173,7 @@ fake_metadata_ 350 2 >data
|
||||
lvchange -ay $vg/$lv1
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvchange -ay $vg/pool $vg/$lv1
|
||||
lvs -a $vg
|
||||
|
||||
|
@@ -54,7 +54,7 @@ mkdir test_mnt
|
||||
|
||||
setup_merge_ $vg1 $lv1
|
||||
mount "$(lvdev_ $vg1 $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg1/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg1/$(snap_lv_name_ $lv1)
|
||||
umount test_mnt
|
||||
vgchange -an $vg1
|
||||
|
||||
|
@@ -32,7 +32,7 @@ snap_and_merge() {
|
||||
SLEEP_PID=$(aux hold_device_open $vg $lv1 20)
|
||||
|
||||
# initiate background merge
|
||||
lvconvert -b --mergesnapshot $vg/$lv2
|
||||
lvconvert -b --merge $vg/$lv2
|
||||
|
||||
lvs -a -o+lv_merging,lv_merge_failed $vg
|
||||
get lv_field $vg/$lv1 lv_attr | grep "Owi-ao"
|
||||
|
@@ -51,15 +51,18 @@ mkdir test_mnt
|
||||
# test full merge of a single LV
|
||||
setup_merge_ $vg $lv1
|
||||
|
||||
# make sure lvconvert --mergesnapshot requires explicit LV listing
|
||||
not lvconvert --mergesnapshot
|
||||
# make sure lvconvert --merge requires explicit LV listing
|
||||
not lvconvert --merge
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
setup_merge_ $vg $lv1
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
|
||||
# test that an actively merging snapshot may not be removed
|
||||
setup_merge_ $vg $lv1
|
||||
lvconvert -i+100 --mergesnapshot --background $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert -i+100 --merge --background $vg/$(snap_lv_name_ $lv1)
|
||||
not lvremove -f $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
@@ -67,7 +70,7 @@ lvremove -f $vg/$lv1
|
||||
# "onactivate merge" test
|
||||
setup_merge_ $vg $lv1
|
||||
mount "$(lvdev_ $vg $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
# -- refresh LV while FS is still mounted (merge must not start),
|
||||
# verify 'snapshot-origin' target is still being used
|
||||
lvchange --refresh $vg/$lv1
|
||||
@@ -88,7 +91,7 @@ lvremove -f $vg/$lv1
|
||||
# to make sure preload of origin's metadata is _not_ performed
|
||||
setup_merge_ $vg $lv1
|
||||
mount "$(lvdev_ $vg $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
# -- refresh LV while FS is still mounted (merge must not start),
|
||||
# verify 'snapshot-origin' target is still being used
|
||||
lvchange --refresh $vg/$lv1
|
||||
@@ -99,7 +102,7 @@ lvremove -f $vg/$lv1
|
||||
|
||||
# test multiple snapshot merge; tests copy out that is driven by merge
|
||||
setup_merge_ $vg $lv1 1
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
|
||||
@@ -108,7 +111,7 @@ setup_merge_ $vg $lv1
|
||||
setup_merge_ $vg $lv2
|
||||
lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv1)
|
||||
lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv2)
|
||||
lvconvert --mergesnapshot @this_is_a_test
|
||||
lvconvert --merge @this_is_a_test
|
||||
lvs $vg | tee out
|
||||
not grep $(snap_lv_name_ $lv1) out
|
||||
not grep $(snap_lv_name_ $lv2) out
|
||||
|
@@ -71,7 +71,7 @@ aux prepare_thin_metadata 490 1 | tee data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
lvchange -ay $vg
|
||||
|
||||
|
@@ -44,7 +44,7 @@ touch mntsnap/test_snap
|
||||
|
||||
lvs -o+tags,thin_id $vg
|
||||
|
||||
lvconvert --mergethin $vg/snap
|
||||
lvconvert --merge $vg/snap
|
||||
|
||||
umount mnt
|
||||
|
||||
@@ -102,12 +102,19 @@ lvcreate -s -n snap $vg/$lv1
|
||||
lvcreate -s -L10 -n oldsnapof_${lv1} $vg/$lv1
|
||||
not lvconvert --merge $vg/snap
|
||||
$MKFS "$DM_DEV_DIR/$vg/oldsnapof_${lv1}"
|
||||
lvconvert --mergesnapshot $vg/oldsnapof_${lv1}
|
||||
lvconvert --merge $vg/oldsnapof_${lv1}
|
||||
fsck -n "$DM_DEV_DIR/$vg/$lv1"
|
||||
check lv_not_exists $vg oldsnapof_${lv1}
|
||||
# Add old snapshot to thin snapshot
|
||||
lvcreate -s -L10 -n oldsnapof_snap $vg/snap
|
||||
lvconvert --mergethin $vg/snap
|
||||
lvconvert --merge $vg/snap
|
||||
lvremove -f $vg/oldsnapof_snap
|
||||
check lv_field $vg/$lv1 thin_id "3"
|
||||
|
||||
# Check --mergethin
|
||||
lvcreate -s -n snap $vg/$lv1
|
||||
check lv_field $vg/snap thin_id "4"
|
||||
lvconvert --mergethin $vg/snap
|
||||
check lv_field $vg/$lv1 thin_id "4"
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@@ -34,7 +34,7 @@ mount "$DM_DEV_DIR/$vg/$lv1" mnt
|
||||
lvcreate -s -n snap $vg/$lv1
|
||||
check lv_field $vg/snap thin_id "3"
|
||||
|
||||
lvconvert --mergethin $vg/snap
|
||||
lvconvert --merge $vg/snap
|
||||
|
||||
umount mnt
|
||||
|
||||
|
@@ -23,6 +23,8 @@ lvcreate -l 1 -n lv1 $vg "$dev1"
|
||||
invalid vgextend
|
||||
# --metadatacopies => use --pvmetadatacopies
|
||||
invalid vgextend --metadatacopies 3 $vg "$dev1" 2>&1 | tee out
|
||||
#grep -- "use --pvmetadatacopies" out
|
||||
egrep -- "unrecognized option.*--metadatacopies" out
|
||||
|
||||
# VG name should exist
|
||||
fail vgextend --restoremissing $vg-invalid "$dev1"
|
||||
|
@@ -427,6 +427,7 @@ ID: lvconvert_to_thin_with_external
|
||||
DESC: Convert LV to a thin LV, using the original LV as an external origin.
|
||||
RULE: all and lv_is_visible
|
||||
RULE: all not lv_is_locked
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
# alternate form of lvconvert --type thin
|
||||
lvconvert --thin --thinpool LV LV_linear_striped_raid_cache
|
||||
@@ -437,6 +438,7 @@ DESC: (infers \\-\\-type thin).
|
||||
FLAGS: SECONDARY_SYNTAX
|
||||
RULE: all and lv_is_visible
|
||||
RULE: all not lv_is_locked
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
---
|
||||
|
||||
@@ -445,6 +447,7 @@ OO: --cache, OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT
|
||||
ID: lvconvert_to_cache_vol
|
||||
DESC: Convert LV to type cache.
|
||||
RULE: all and lv_is_visible
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
# alternate form of lvconvert --type cache
|
||||
lvconvert --cache --cachepool LV LV_linear_striped_raid_thinpool
|
||||
@@ -452,6 +455,7 @@ OO: --type cache, OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT
|
||||
ID: lvconvert_to_cache_vol
|
||||
DESC: Convert LV to type cache (infers \\-\\-type cache).
|
||||
RULE: all and lv_is_visible
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
FLAGS: SECONDARY_SYNTAX
|
||||
|
||||
---
|
||||
@@ -464,6 +468,7 @@ ID: lvconvert_to_thinpool
|
||||
DESC: Convert LV to type thin-pool.
|
||||
RULE: all and lv_is_visible
|
||||
RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_virtual
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
# This command syntax has two different meanings depending on
|
||||
# whether the LV pos arg is already a thin pool or not.
|
||||
@@ -496,6 +501,7 @@ DESC: Convert LV to type thin-pool (variant, use \\-\\-type thin-pool).
|
||||
DESC: Swap metadata LV in a thin pool (variant, use \\-\\-swapmetadata).
|
||||
FLAGS: PREVIOUS_SYNTAX
|
||||
RULE: all and lv_is_visible
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
---
|
||||
|
||||
@@ -504,6 +510,7 @@ OO: OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT
|
||||
OP: PV ...
|
||||
ID: lvconvert_to_cachepool
|
||||
DESC: Convert LV to type cache-pool.
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
# This command syntax has two different meanings depending on
|
||||
# whether the LV pos arg is already a cache pool or not.
|
||||
@@ -535,6 +542,7 @@ DESC: Convert LV to type cache-pool (variant, use \\-\\-type cache-pool).
|
||||
DESC: Swap metadata LV in a cache pool (variant, use \\-\\-swapmetadata).
|
||||
FLAGS: PREVIOUS_SYNTAX
|
||||
RULE: all and lv_is_visible
|
||||
RULE: --poolmetadata not --readahead --stripesize --stripes_long
|
||||
|
||||
---
|
||||
|
||||
|
@@ -1506,10 +1506,13 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
|
||||
/* The max number of unused options we keep track of to warn about */
|
||||
#define MAX_UNUSED_COUNT 8
|
||||
|
||||
#define MAX_OPTS_MSG 64
|
||||
|
||||
static struct command *_find_command(struct cmd_context *cmd, const char *path, int *argc, char **argv)
|
||||
{
|
||||
const char *name;
|
||||
char buf[64];
|
||||
char opts_msg[MAX_OPTS_MSG];
|
||||
char check_opts_msg[MAX_OPTS_MSG];
|
||||
int match_required, match_ro, match_rp, match_type, match_unused, mismatch_required;
|
||||
int best_i = 0, best_required = 0, best_type = 0, best_unused = 0;
|
||||
int close_i = 0, close_ro = 0, close_type = 0;
|
||||
@@ -1792,16 +1795,24 @@ out:
|
||||
&opts_match_count, &opts_unmatch_count);
|
||||
|
||||
if (opts_match_count && (rule->rule == RULE_INVALID)) {
|
||||
memset(buf, 0, sizeof(buf));
|
||||
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf));
|
||||
log_error("Invalid options for command: %s", buf);
|
||||
memset(opts_msg, 0, sizeof(opts_msg));
|
||||
memset(check_opts_msg, 0, sizeof(check_opts_msg));
|
||||
|
||||
if (rule->opts_count)
|
||||
opt_array_to_str(cmd, rule->opts, rule->opts_count, opts_msg, sizeof(opts_msg));
|
||||
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, check_opts_msg, sizeof(check_opts_msg));
|
||||
|
||||
if (rule->opts_count)
|
||||
log_error("Invalid option combination: %s with %s", opts_msg, check_opts_msg);
|
||||
else
|
||||
log_error("Invalid options: %s", check_opts_msg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (opts_unmatch_count && (rule->rule == RULE_REQUIRE)) {
|
||||
memset(buf, 0, sizeof(buf));
|
||||
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf));
|
||||
log_error("Required options for command: %s", buf);
|
||||
memset(check_opts_msg, 0, sizeof(check_opts_msg));
|
||||
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, check_opts_msg, sizeof(check_opts_msg));
|
||||
log_error("Required options for command: %s", check_opts_msg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1821,7 +1832,7 @@ static void _short_usage(const char *name)
|
||||
static int _usage(const char *name, int longhelp, int skip_notes)
|
||||
{
|
||||
struct command_name *cname = find_command_name(name);
|
||||
struct command *cmd;
|
||||
struct command *cmd = NULL;
|
||||
int show_full = longhelp;
|
||||
int i;
|
||||
|
||||
@@ -1865,6 +1876,11 @@ static int _usage(const char *name, int longhelp, int skip_notes)
|
||||
}
|
||||
|
||||
/* Common options are printed once for all variants of a command name. */
|
||||
if (!cmd) {
|
||||
log_error(INTERNAL_ERROR "Command %s not found.", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_usage_common_cmd(cname, cmd);
|
||||
print_usage_common_lvm(cname, cmd);
|
||||
|
||||
|
Reference in New Issue
Block a user