mirror of
git://sourceware.org/git/lvm2.git
synced 2025-12-28 04:23:49 +03:00
Compare commits
38 Commits
sourceware
...
dev-dct-cm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
690abbad42 | ||
|
|
b49a93a118 | ||
|
|
977a841f07 | ||
|
|
0ca887d285 | ||
|
|
8b088530cb | ||
|
|
0fe631f34e | ||
|
|
055ed9e721 | ||
|
|
441f28d6d9 | ||
|
|
565b66a052 | ||
|
|
76c5c658b1 | ||
|
|
e5981c33c5 | ||
|
|
014c1bad98 | ||
|
|
baaadc2af4 | ||
|
|
ad99530586 | ||
|
|
e8ef7da538 | ||
|
|
405f3e82e7 | ||
|
|
3ba4d1e73a | ||
|
|
7e00281839 | ||
|
|
1eaadb5261 | ||
|
|
17da7c3c2a | ||
|
|
10053dcf81 | ||
|
|
41d5f37d29 | ||
|
|
9818359c1b | ||
|
|
16794d72e9 | ||
|
|
601801e82d | ||
|
|
2363730c74 | ||
|
|
939965822a | ||
|
|
d8c80c5d41 | ||
|
|
c3d9cfbe11 | ||
|
|
ca20d70953 | ||
|
|
2779de7ef8 | ||
|
|
3f1d78efa6 | ||
|
|
d14774da07 | ||
|
|
3593ce9608 | ||
|
|
ccfa398e06 | ||
|
|
0aa48dd184 | ||
|
|
94af88bdb6 | ||
|
|
ba0537e3f8 |
@@ -59,8 +59,6 @@ liblvm: lib
|
||||
daemons: lib libdaemon tools
|
||||
tools: lib libdaemon device-mapper
|
||||
po: tools daemons
|
||||
man: tools
|
||||
all_man: tools
|
||||
scripts: liblvm libdm
|
||||
|
||||
lib.device-mapper: include.device-mapper
|
||||
|
||||
18
WHATS_NEW
18
WHATS_NEW
@@ -1,23 +1,5 @@
|
||||
Version 2.02.169 -
|
||||
=====================================
|
||||
Reject writemostly/writebehind in lvchange during resynchronization.
|
||||
Deactivate active origin first before removal for improved workflow.
|
||||
Fix regression of accepting options --type and -m with lvresize (2.02.158).
|
||||
Add lvconvert --swapmetadata, new specific way to swap pool metadata LVs.
|
||||
Add lvconvert --startpoll, new specific way to start polling conversions.
|
||||
Add lvconvert --mergethin, new specific way to merge thin snapshots.
|
||||
Add lvconvert --mergemirrors, new specific way to merge split mirrors.
|
||||
Add lvconvert --mergesnapshot, new specific way to combine cow LVs.
|
||||
Split up lvconvert code based on command definitions.
|
||||
Split up lvchange code based on command definitions.
|
||||
Generate help output and man pages from command definitions.
|
||||
Verify all command line items against command definition.
|
||||
Match every command run to one command definition.
|
||||
Specify every allowed command definition/syntax in command-lines.in.
|
||||
Add extra memory page when limiting pthread stack size in clvmd.
|
||||
Support striped/raid0* <-> raid10_near conversions
|
||||
Support shrinking of RaidLvs
|
||||
Support region size changes on existing RaidLVs
|
||||
Avoid parallel usage of cpg_mcast_joined() in clvmd with corosync.
|
||||
Support raid6_{ls,rs,la,ra}_6 segment types and conversions from/to it.
|
||||
Support raid6_n_6 segment type and conversions from/to it.
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
Version 1.02.138 -
|
||||
=====================================
|
||||
Add extra memory page when limiting pthread stack size in dmeventd.
|
||||
Avoids immediate resume when preloaded device is smaller.
|
||||
Do not suppress kernel key description in dmsetup table output.
|
||||
Support configurable command executed from dmeventd thin plugin.
|
||||
Support new R|r human readable units output format.
|
||||
Thin dmeventd plugin reacts faster on lvextend failure path with umount.
|
||||
|
||||
@@ -2054,7 +2054,6 @@ dmeventd {
|
||||
# or metadata volume gets above 50%.
|
||||
# Command which starts with 'lvm ' prefix is internal lvm command.
|
||||
# You can write your own handler to customise behaviour in more details.
|
||||
# User handler is specified with the full path starting with '/'.
|
||||
# This configuration option has an automatic default value.
|
||||
# thin_command = "lvm lvextend --use-policies"
|
||||
|
||||
|
||||
198
configure
vendored
198
configure
vendored
@@ -821,8 +821,6 @@ HAVE_PIE
|
||||
POW_LIB
|
||||
LIBOBJS
|
||||
ALLOCA
|
||||
SORT
|
||||
WC
|
||||
CHMOD
|
||||
CSCOPE_CMD
|
||||
CFLOW_CMD
|
||||
@@ -5236,202 +5234,6 @@ else
|
||||
CHMOD="$ac_cv_path_CHMOD"
|
||||
fi
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}wc", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}wc; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_WC+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $WC in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_WC="$WC" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
WC=$ac_cv_path_WC
|
||||
if test -n "$WC"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WC" >&5
|
||||
$as_echo "$WC" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_path_WC"; then
|
||||
ac_pt_WC=$WC
|
||||
# Extract the first word of "wc", so it can be a program name with args.
|
||||
set dummy wc; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ac_pt_WC+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ac_pt_WC in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ac_pt_WC="$ac_pt_WC" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ac_pt_WC="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_pt_WC=$ac_cv_path_ac_pt_WC
|
||||
if test -n "$ac_pt_WC"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_WC" >&5
|
||||
$as_echo "$ac_pt_WC" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_pt_WC" = x; then
|
||||
WC=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
WC=$ac_pt_WC
|
||||
fi
|
||||
else
|
||||
WC="$ac_cv_path_WC"
|
||||
fi
|
||||
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}sort", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}sort; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_SORT+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $SORT in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_SORT="$SORT" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
SORT=$ac_cv_path_SORT
|
||||
if test -n "$SORT"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5
|
||||
$as_echo "$SORT" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_path_SORT"; then
|
||||
ac_pt_SORT=$SORT
|
||||
# Extract the first word of "sort", so it can be a program name with args.
|
||||
set dummy sort; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ac_pt_SORT+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ac_pt_SORT in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ac_pt_SORT="$ac_pt_SORT" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ac_pt_SORT="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_pt_SORT=$ac_cv_path_ac_pt_SORT
|
||||
if test -n "$ac_pt_SORT"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_SORT" >&5
|
||||
$as_echo "$ac_pt_SORT" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_pt_SORT" = x; then
|
||||
SORT=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
SORT=$ac_pt_SORT
|
||||
fi
|
||||
else
|
||||
SORT="$ac_cv_path_SORT"
|
||||
fi
|
||||
|
||||
|
||||
################################################################################
|
||||
ac_header_dirent=no
|
||||
|
||||
@@ -86,8 +86,6 @@ AC_PROG_RANLIB
|
||||
AC_PATH_TOOL(CFLOW_CMD, cflow)
|
||||
AC_PATH_TOOL(CSCOPE_CMD, cscope)
|
||||
AC_PATH_TOOL(CHMOD, chmod)
|
||||
AC_PATH_TOOL(WC, wc)
|
||||
AC_PATH_TOOL(SORT, sort)
|
||||
|
||||
################################################################################
|
||||
dnl -- Check for header files.
|
||||
|
||||
@@ -517,7 +517,7 @@ int main(int argc, char *argv[])
|
||||
/* Initialise the LVM thread variables */
|
||||
dm_list_init(&lvm_cmd_head);
|
||||
if (pthread_attr_init(&stack_attr) ||
|
||||
pthread_attr_setstacksize(&stack_attr, STACK_SIZE + getpagesize())) {
|
||||
pthread_attr_setstacksize(&stack_attr, STACK_SIZE)) {
|
||||
log_sys_error("pthread_attr_init", "");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ static int _pthread_create_smallstack(pthread_t *t, void *(*fun)(void *), void *
|
||||
/*
|
||||
* We use a smaller stack since it gets preallocated in its entirety
|
||||
*/
|
||||
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE + getpagesize());
|
||||
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE);
|
||||
|
||||
/*
|
||||
* If no-one will be waiting, we need to detach.
|
||||
|
||||
@@ -184,12 +184,16 @@ int register_device(const char *device,
|
||||
goto_bad;
|
||||
|
||||
if (!dmeventd_lvm2_command(state->mem, state->cmd_lvscan, sizeof(state->cmd_lvscan),
|
||||
"lvscan --cache", device))
|
||||
"lvscan --cache", device)) {
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
if (!dmeventd_lvm2_command(state->mem, state->cmd_lvconvert, sizeof(state->cmd_lvconvert),
|
||||
"lvconvert --repair --use-policies", device))
|
||||
"lvconvert --repair --use-policies", device)) {
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
*user = state;
|
||||
|
||||
@@ -199,9 +203,6 @@ int register_device(const char *device,
|
||||
bad:
|
||||
log_error("Failed to monitor mirror %s.", device);
|
||||
|
||||
if (state)
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,8 +140,10 @@ int register_device(const char *device,
|
||||
"lvscan --cache", device) ||
|
||||
!dmeventd_lvm2_command(state->mem, state->cmd_lvconvert, sizeof(state->cmd_lvconvert),
|
||||
"lvconvert --config devices{ignore_suspended_devices=1} "
|
||||
"--repair --use-policies", device))
|
||||
"--repair --use-policies", device)) {
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
*user = state;
|
||||
|
||||
@@ -151,9 +153,6 @@ int register_device(const char *device,
|
||||
bad:
|
||||
log_error("Failed to monitor RAID %s.", device);
|
||||
|
||||
if (state)
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,8 +254,10 @@ int register_device(const char *device,
|
||||
|
||||
if (!dmeventd_lvm2_command(state->mem, state->cmd_lvextend,
|
||||
sizeof(state->cmd_lvextend),
|
||||
"lvextend --use-policies", device))
|
||||
"lvextend --use-policies", device)) {
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
state->percent_check = CHECK_MINIMUM;
|
||||
*user = state;
|
||||
@@ -266,9 +268,6 @@ int register_device(const char *device,
|
||||
bad:
|
||||
log_error("Failed to monitor snapshot %s.", device);
|
||||
|
||||
if (state)
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <sys/wait.h>
|
||||
#include <stdarg.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/* TODO - move this mountinfo code into library to be reusable */
|
||||
#ifdef __linux__
|
||||
@@ -58,8 +59,8 @@ struct dso_state {
|
||||
int restore_sigset;
|
||||
sigset_t old_sigset;
|
||||
pid_t pid;
|
||||
char *argv[3];
|
||||
char *cmd_str;
|
||||
char **argv;
|
||||
char cmd_str[1024];
|
||||
};
|
||||
|
||||
DM_EVENT_LOG_FN("thin")
|
||||
@@ -85,7 +86,7 @@ static int _run_command(struct dso_state *state)
|
||||
} else {
|
||||
/* For an error event it's for a user to check status and decide */
|
||||
env[1] = NULL;
|
||||
log_debug("Error event processing.");
|
||||
log_debug("Error event processing");
|
||||
}
|
||||
|
||||
log_verbose("Executing command: %s", state->cmd_str);
|
||||
@@ -115,7 +116,7 @@ static int _use_policy(struct dm_task *dmt, struct dso_state *state)
|
||||
#if THIN_DEBUG
|
||||
log_debug("dmeventd executes: %s.", state->cmd_str);
|
||||
#endif
|
||||
if (state->argv[0])
|
||||
if (state->argv)
|
||||
return _run_command(state);
|
||||
|
||||
if (!dmeventd_lvm2_run_with_lock(state->cmd_str)) {
|
||||
@@ -352,41 +353,34 @@ int register_device(const char *device,
|
||||
void **user)
|
||||
{
|
||||
struct dso_state *state;
|
||||
int maxcmd;
|
||||
char *str;
|
||||
char cmd_str[PATH_MAX + 128 + 2]; /* cmd ' ' vg/lv \0 */
|
||||
|
||||
if (!dmeventd_lvm2_init_with_pool("thin_pool_state", state))
|
||||
goto_bad;
|
||||
|
||||
if (!dmeventd_lvm2_command(state->mem, cmd_str, sizeof(cmd_str),
|
||||
"_dmeventd_thin_command", device))
|
||||
if (!dmeventd_lvm2_command(state->mem, state->cmd_str,
|
||||
sizeof(state->cmd_str),
|
||||
"_dmeventd_thin_command", device)) {
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
goto_bad;
|
||||
}
|
||||
|
||||
if (strncmp(cmd_str, "lvm ", 4) == 0) {
|
||||
if (!(state->cmd_str = dm_pool_strdup(state->mem, cmd_str + 4))) {
|
||||
log_error("Failed to copy lvm command.");
|
||||
goto bad;
|
||||
}
|
||||
} else if (cmd_str[0] == '/') {
|
||||
if (!(state->cmd_str = dm_pool_strdup(state->mem, cmd_str))) {
|
||||
log_error("Failed to copy thin command.");
|
||||
if (strncmp(state->cmd_str, "lvm ", 4)) {
|
||||
maxcmd = 2; /* space for last NULL element */
|
||||
for (str = state->cmd_str; *str; str++)
|
||||
if (*str == ' ')
|
||||
maxcmd++;
|
||||
if (!(str = dm_pool_strdup(state->mem, state->cmd_str)) ||
|
||||
!(state->argv = dm_pool_zalloc(state->mem, maxcmd * sizeof(char *)))) {
|
||||
log_error("Failed to allocate memory for command.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Find last space before 'vg/lv' */
|
||||
if (!(str = strrchr(state->cmd_str, ' ')))
|
||||
goto inval;
|
||||
|
||||
if (!(state->argv[0] = dm_pool_strndup(state->mem, state->cmd_str,
|
||||
str - state->cmd_str))) {
|
||||
log_error("Failed to copy command.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
state->argv[1] = str + 1; /* 1 argument - vg/lv */
|
||||
dm_split_words(str, maxcmd - 1, 0, state->argv);
|
||||
_init_thread_signals(state);
|
||||
} else /* Unuspported command format */
|
||||
goto inval;
|
||||
} else
|
||||
memmove(state->cmd_str, state->cmd_str + 4, strlen(state->cmd_str + 4) + 1);
|
||||
|
||||
state->pid = -1;
|
||||
*user = state;
|
||||
@@ -394,14 +388,9 @@ int register_device(const char *device,
|
||||
log_info("Monitoring thin pool %s.", device);
|
||||
|
||||
return 1;
|
||||
inval:
|
||||
log_error("Invalid command for monitoring: %s.", cmd_str);
|
||||
bad:
|
||||
log_error("Failed to monitor thin pool %s.", device);
|
||||
|
||||
if (state)
|
||||
dmeventd_lvm2_exit_with_pool(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
|
||||
#define MIN_ARGV_SIZE 8
|
||||
|
||||
static const char *const polling_ops[] = {
|
||||
[PVMOVE] = LVMPD_REQ_PVMOVE,
|
||||
[CONVERT] = LVMPD_REQ_CONVERT,
|
||||
[MERGE] = LVMPD_REQ_MERGE,
|
||||
[MERGE_THIN] = LVMPD_REQ_MERGE_THIN
|
||||
};
|
||||
static const char *const const polling_ops[] = { [PVMOVE] = LVMPD_REQ_PVMOVE,
|
||||
[CONVERT] = LVMPD_REQ_CONVERT,
|
||||
[MERGE] = LVMPD_REQ_MERGE,
|
||||
[MERGE_THIN] = LVMPD_REQ_MERGE_THIN };
|
||||
|
||||
const char *polling_op(enum poll_type type)
|
||||
{
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||
* Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of LVM2.
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU Lesser General Public License v.2.1.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
@@ -1948,13 +1948,16 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
|
||||
|
||||
/* Check [un]monitor results */
|
||||
/* Try a couple times if pending, but not forever... */
|
||||
for (i = 0;; i++) {
|
||||
for (i = 0; i < 40; i++) {
|
||||
pending = 0;
|
||||
monitored = seg->segtype->ops->target_monitored(seg, &pending);
|
||||
if (!pending || i >= 40)
|
||||
if (pending ||
|
||||
(!monitored && monitor) ||
|
||||
(monitored && !monitor))
|
||||
log_very_verbose("%s %smonitoring still pending: waiting...",
|
||||
display_lvname(lv), monitor ? "" : "un");
|
||||
else
|
||||
break;
|
||||
log_very_verbose("%s %smonitoring still pending: waiting...",
|
||||
display_lvname(lv), monitor ? "" : "un");
|
||||
usleep(10000 * i);
|
||||
}
|
||||
|
||||
|
||||
@@ -1221,15 +1221,14 @@ cfg_array(activation_read_only_volume_list_CFG, "read_only_volume_list", activat
|
||||
"read_only_volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
"#\n")
|
||||
|
||||
cfg(activation_mirror_region_size_CFG, "mirror_region_size", activation_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_RAID_REGION_SIZE, vsn(1, 0, 0), NULL, vsn(2, 2, 99),
|
||||
cfg(activation_mirror_region_size_CFG, "mirror_region_size", activation_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_RAID_REGION_SIZE, vsn(1, 0, 0), NULL, vsn(2, 2, 99),
|
||||
"This has been replaced by the activation/raid_region_size setting.\n",
|
||||
"Size in KiB of each raid or mirror synchronization region.\n")
|
||||
"Size in KiB of each copy operation when mirroring.\n")
|
||||
|
||||
cfg(activation_raid_region_size_CFG, "raid_region_size", activation_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_RAID_REGION_SIZE, vsn(2, 2, 99), NULL, 0, NULL,
|
||||
"Size in KiB of each raid or mirror synchronization region.\n"
|
||||
"The clean/dirty state of data is tracked for each region.\n"
|
||||
"The value is rounded down to a power of two if necessary, and\n"
|
||||
"is ignored if it is not a multiple of the machine memory page size.\n")
|
||||
"For raid or mirror segment types, this is the amount of data that is\n"
|
||||
"copied at once when initializing, or moved at once by pvmove.\n")
|
||||
|
||||
cfg(activation_error_when_full_CFG, "error_when_full", activation_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_ERROR_WHEN_FULL, vsn(2, 2, 115), NULL, 0, NULL,
|
||||
"Return errors if a thin pool runs out of space.\n"
|
||||
@@ -1864,9 +1863,7 @@ cfg(dmeventd_thin_command_CFG, "thin_command", dmeventd_CFG_SECTION, CFG_DEFAULT
|
||||
"The plugin runs command with each 5% increment when thin-pool data volume\n"
|
||||
"or metadata volume gets above 50%.\n"
|
||||
"Command which starts with 'lvm ' prefix is internal lvm command.\n"
|
||||
"You can write your own handler to customise behaviour in more details.\n"
|
||||
"User handler is specified with the full path starting with '/'.\n")
|
||||
/* TODO: systemd service handler */
|
||||
"You can write your own handler to customise behaviour in more details.\n")
|
||||
|
||||
cfg(dmeventd_executable_CFG, "executable", dmeventd_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, DEFAULT_DMEVENTD_PATH, vsn(2, 2, 73), "@DMEVENTD_PATH@", 0, NULL,
|
||||
"The full path to the dmeventd binary.\n")
|
||||
|
||||
@@ -712,7 +712,6 @@ static int _round_down_pow2(int r)
|
||||
|
||||
int get_default_region_size(struct cmd_context *cmd)
|
||||
{
|
||||
int pagesize = lvm_getpagesize();
|
||||
int region_size = _get_default_region_size(cmd);
|
||||
|
||||
if (!is_power_of_2(region_size)) {
|
||||
@@ -721,12 +720,6 @@ int get_default_region_size(struct cmd_context *cmd)
|
||||
region_size / 2);
|
||||
}
|
||||
|
||||
if (region_size % (pagesize >> SECTOR_SHIFT)) {
|
||||
region_size = DEFAULT_RAID_REGION_SIZE * 2;
|
||||
log_verbose("Using default region size %u kiB (multiple of page size).",
|
||||
region_size / 2);
|
||||
}
|
||||
|
||||
return region_size;
|
||||
}
|
||||
|
||||
@@ -897,9 +890,8 @@ static uint32_t _round_to_stripe_boundary(struct volume_group *vg, uint32_t exte
|
||||
/* Round up extents to stripe divisible amount */
|
||||
if ((size_rest = extents % stripes)) {
|
||||
new_extents += extend ? stripes - size_rest : -size_rest;
|
||||
log_print_unless_silent("Rounding size %s (%u extents) %s to stripe boundary size %s(%u extents).",
|
||||
log_print_unless_silent("Rounding size %s (%u extents) up to stripe boundary size %s (%u extents).",
|
||||
display_size(vg->cmd, (uint64_t) extents * vg->extent_size), extents,
|
||||
new_extents < extents ? "down" : "up",
|
||||
display_size(vg->cmd, (uint64_t) new_extents * vg->extent_size), new_extents);
|
||||
}
|
||||
|
||||
@@ -974,37 +966,6 @@ struct lv_segment *alloc_lv_segment(const struct segment_type *segtype,
|
||||
return seg;
|
||||
}
|
||||
|
||||
/*
|
||||
* Temporary helper to return number of data copies for
|
||||
* RAID segment @seg until seg->data_copies got added
|
||||
*/
|
||||
static uint32_t _raid_data_copies(struct lv_segment *seg)
|
||||
{
|
||||
/*
|
||||
* FIXME: needs to change once more than 2 are supported.
|
||||
* I.e. use seg->data_copies then
|
||||
*/
|
||||
if (seg_is_raid10(seg))
|
||||
return 2;
|
||||
else if (seg_is_raid1(seg))
|
||||
return seg->area_count;
|
||||
|
||||
return seg->segtype->parity_devs + 1;
|
||||
}
|
||||
|
||||
/* Data image count for RAID segment @seg */
|
||||
static uint32_t _raid_stripes_count(struct lv_segment *seg)
|
||||
{
|
||||
/*
|
||||
* FIXME: raid10 needs to change once more than
|
||||
* 2 data_copies and odd # of legs supported.
|
||||
*/
|
||||
if (seg_is_raid10(seg))
|
||||
return seg->area_count / _raid_data_copies(seg);
|
||||
|
||||
return seg->area_count - seg->segtype->parity_devs;
|
||||
}
|
||||
|
||||
static int _release_and_discard_lv_segment_area(struct lv_segment *seg, uint32_t s,
|
||||
uint32_t area_reduction, int with_discard)
|
||||
{
|
||||
@@ -1045,40 +1006,32 @@ static int _release_and_discard_lv_segment_area(struct lv_segment *seg, uint32_t
|
||||
}
|
||||
|
||||
if (lv_is_raid_image(lv)) {
|
||||
/* Calculate the amount of extents to reduce per rmate/rimage LV */
|
||||
uint32_t rimage_extents;
|
||||
|
||||
/* FIXME: avoid extra seg_is_*() conditonals */
|
||||
area_reduction =_round_to_stripe_boundary(lv->vg, area_reduction,
|
||||
(seg_is_raid1(seg) || seg_is_any_raid0(seg)) ? 0 : _raid_stripes_count(seg), 0);
|
||||
rimage_extents = raid_rimage_extents(seg->segtype, area_reduction, seg_is_any_raid0(seg) ? 0 : _raid_stripes_count(seg),
|
||||
seg_is_raid10(seg) ? 1 :_raid_data_copies(seg));
|
||||
if (!rimage_extents)
|
||||
/*
|
||||
* FIXME: Use lv_reduce not lv_remove
|
||||
* We use lv_remove for now, because I haven't figured out
|
||||
* why lv_reduce won't remove the LV.
|
||||
lv_reduce(lv, area_reduction);
|
||||
*/
|
||||
if (area_reduction != seg->area_len) {
|
||||
log_error("Unable to reduce RAID LV - operation not implemented.");
|
||||
return 0;
|
||||
|
||||
if (seg->meta_areas) {
|
||||
uint32_t meta_area_reduction;
|
||||
struct logical_volume *mlv;
|
||||
struct volume_group *vg = lv->vg;
|
||||
|
||||
if (seg_metatype(seg, s) != AREA_LV ||
|
||||
!(mlv = seg_metalv(seg, s)))
|
||||
} else {
|
||||
if (!lv_remove(lv)) {
|
||||
log_error("Failed to remove RAID image %s.",
|
||||
display_lvname(lv));
|
||||
return 0;
|
||||
|
||||
meta_area_reduction = raid_rmeta_extents_delta(vg->cmd, lv->le_count, lv->le_count - rimage_extents,
|
||||
seg->region_size, vg->extent_size);
|
||||
/* Limit for raid0_meta not having region size set */
|
||||
if (meta_area_reduction > mlv->le_count ||
|
||||
!(lv->le_count - rimage_extents))
|
||||
meta_area_reduction = mlv->le_count;
|
||||
|
||||
if (meta_area_reduction &&
|
||||
!lv_reduce(mlv, meta_area_reduction))
|
||||
return_0; /* FIXME: any upper level reporting */
|
||||
}
|
||||
}
|
||||
|
||||
if (!lv_reduce(lv, rimage_extents))
|
||||
return_0; /* FIXME: any upper level reporting */
|
||||
/* Remove metadata area if image has been removed */
|
||||
if (seg->meta_areas && seg_metalv(seg, s) && (area_reduction == seg->area_len)) {
|
||||
if (!lv_reduce(seg_metalv(seg, s),
|
||||
seg_metalv(seg, s)->le_count)) {
|
||||
log_error("Failed to remove RAID meta-device %s.",
|
||||
display_lvname(seg_metalv(seg, s)));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1485,13 +1438,6 @@ int lv_refresh_suspend_resume(const struct logical_volume *lv)
|
||||
*/
|
||||
int lv_reduce(struct logical_volume *lv, uint32_t extents)
|
||||
{
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
|
||||
/* Ensure stipe boundary extents on RAID LVs */
|
||||
if (lv_is_raid(lv) && extents != lv->le_count)
|
||||
extents =_round_to_stripe_boundary(lv->vg, extents,
|
||||
seg_is_raid1(seg) ? 0 : _raid_stripes_count(seg), 0);
|
||||
|
||||
return _lv_reduce(lv, extents, 1);
|
||||
}
|
||||
|
||||
@@ -3355,24 +3301,19 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
|
||||
|
||||
if (segtype_is_raid(segtype)) {
|
||||
if (metadata_area_count) {
|
||||
uint32_t cur_rimage_extents, new_rimage_extents;
|
||||
|
||||
if (metadata_area_count != area_count)
|
||||
log_error(INTERNAL_ERROR
|
||||
"Bad metadata_area_count");
|
||||
ah->metadata_area_count = area_count;
|
||||
ah->alloc_and_split_meta = 1;
|
||||
|
||||
ah->log_len = RAID_METADATA_AREA_LEN;
|
||||
|
||||
/* Calculate log_len (i.e. length of each rmeta device) for RAID */
|
||||
cur_rimage_extents = raid_rimage_extents(segtype, existing_extents, stripes, mirrors);
|
||||
new_rimage_extents = raid_rimage_extents(segtype, existing_extents + new_extents, stripes, mirrors),
|
||||
ah->log_len = raid_rmeta_extents_delta(cmd, cur_rimage_extents, new_rimage_extents,
|
||||
region_size, extent_size);
|
||||
ah->metadata_area_count = metadata_area_count;
|
||||
ah->alloc_and_split_meta = !!ah->log_len;
|
||||
/*
|
||||
* We need 'log_len' extents for each
|
||||
* RAID device's metadata_area
|
||||
*/
|
||||
total_extents += ah->log_len * (segtype_is_raid1(segtype) ? 1 : ah->area_multiple);
|
||||
total_extents += (ah->log_len * ah->area_multiple);
|
||||
} else {
|
||||
ah->log_area_count = 0;
|
||||
ah->log_len = 0;
|
||||
@@ -4069,6 +4010,19 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
|
||||
if (!_setup_lv_size(lv, lv->le_count + extents))
|
||||
return_0;
|
||||
|
||||
/*
|
||||
* The MD bitmap is limited to being able to track 2^21 regions.
|
||||
* The region_size must be adjusted to meet that criteria
|
||||
* unless raid0/raid0_meta, which doesn't have a bitmap.
|
||||
*/
|
||||
if (seg_is_raid(seg) && !seg_is_any_raid0(seg))
|
||||
while (seg->region_size < (lv->size / (1 << 21))) {
|
||||
seg->region_size *= 2;
|
||||
log_very_verbose("Adjusting RAID region_size from %uS to %uS"
|
||||
" to support large LV size",
|
||||
seg->region_size/2, seg->region_size);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4095,7 +4049,6 @@ int lv_extend(struct logical_volume *lv,
|
||||
uint32_t sub_lv_count;
|
||||
uint32_t old_extents;
|
||||
uint32_t new_extents; /* Total logical size after extension. */
|
||||
uint64_t raid_size;
|
||||
|
||||
log_very_verbose("Adding segment of type %s to LV %s.", segtype->name, lv->name);
|
||||
|
||||
@@ -4117,22 +4070,6 @@ int lv_extend(struct logical_volume *lv,
|
||||
}
|
||||
/* FIXME log_count should be 1 for mirrors */
|
||||
|
||||
if (segtype_is_raid(segtype) && !segtype_is_any_raid0(segtype)) {
|
||||
raid_size = ((uint64_t) lv->le_count + extents) * lv->vg->extent_size;
|
||||
|
||||
/*
|
||||
* The MD bitmap is limited to being able to track 2^21 regions.
|
||||
* The region_size must be adjusted to meet that criteria
|
||||
* unless raid0/raid0_meta, which doesn't have a bitmap.
|
||||
*/
|
||||
|
||||
region_size = raid_ensure_min_region_size(lv, raid_size, region_size);
|
||||
|
||||
if (first_seg(lv))
|
||||
first_seg(lv)->region_size = region_size;
|
||||
|
||||
}
|
||||
|
||||
if (!(ah = allocate_extents(lv->vg, lv, segtype, stripes, mirrors,
|
||||
log_count, region_size, extents,
|
||||
allocatable_pvs, alloc, approx_alloc, NULL)))
|
||||
@@ -4713,11 +4650,6 @@ static uint32_t lvseg_get_stripes(struct lv_segment *seg, uint32_t *stripesize)
|
||||
return seg->area_count;
|
||||
}
|
||||
|
||||
if (seg_is_raid(seg)) {
|
||||
*stripesize = seg->stripe_size;
|
||||
return _raid_stripes_count(seg);
|
||||
}
|
||||
|
||||
*stripesize = 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -5383,7 +5315,6 @@ int lv_resize(struct logical_volume *lv,
|
||||
struct logical_volume *lock_lv = (struct logical_volume*) lv_lock_holder(lv);
|
||||
struct logical_volume *aux_lv = NULL; /* Note: aux_lv never resizes fs */
|
||||
struct lvresize_params aux_lp;
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
int activated = 0;
|
||||
int ret = 0;
|
||||
int status;
|
||||
@@ -5425,11 +5356,6 @@ int lv_resize(struct logical_volume *lv,
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure stripe boundary extents! */
|
||||
if (!lp->percent && lv_is_raid(lv))
|
||||
lp->extents =_round_to_stripe_boundary(lv->vg, lp->extents,
|
||||
seg_is_raid1(seg) ? 0 : _raid_stripes_count(seg),
|
||||
lp->resize == LV_REDUCE ? 0 : 1);
|
||||
if (aux_lv && !_lvresize_prepare(&aux_lv, &aux_lp, pvh))
|
||||
return_0;
|
||||
|
||||
@@ -6229,21 +6155,12 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
|
||||
/* Remove snapshot LVs first */
|
||||
if ((force == PROMPT) &&
|
||||
/* Active snapshot already needs to confirm each active LV */
|
||||
(yes_no_prompt("Do you really want to remove%s "
|
||||
"%sorigin logical volume %s with %u snapshot(s)? [y/n]: ",
|
||||
lv_is_active(lv) ? " active" : "",
|
||||
vg_is_clustered(lv->vg) ? "clustered " : "",
|
||||
display_lvname(lv),
|
||||
lv->origin_count) == 'n'))
|
||||
!lv_is_active(lv) &&
|
||||
yes_no_prompt("Removing origin %s will also remove %u "
|
||||
"snapshots(s). Proceed? [y/n]: ",
|
||||
lv->name, lv->origin_count) == 'n')
|
||||
goto no_remove;
|
||||
|
||||
if (!deactivate_lv(cmd, lv)) {
|
||||
stack;
|
||||
goto no_remove;
|
||||
}
|
||||
log_verbose("Removing origin logical volume %s with %u snapshots(s).",
|
||||
display_lvname(lv), lv->origin_count);
|
||||
|
||||
dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
|
||||
if (!lv_remove_with_dependencies(cmd, dm_list_struct_base(snh, struct lv_segment,
|
||||
origin_list)->cow,
|
||||
|
||||
@@ -148,14 +148,7 @@ static void _check_raid1_seg(struct lv_segment *seg, int *error_count)
|
||||
static void _check_raid45610_seg(struct lv_segment *seg, int *error_count)
|
||||
{
|
||||
/* Checks applying to any raid4/5/6/10 */
|
||||
/*
|
||||
* Allow raid4 + raid5_n to get activated w/o metadata.
|
||||
*
|
||||
* This is mandatory during conversion between them,
|
||||
* because switching the dedicated parity SubLVs
|
||||
* beginning <-> end changes the roles of all SubLVs
|
||||
* which the kernel would reject.
|
||||
*/
|
||||
/* Allow raid4 + raid5_n to get activated w/o metadata (mandatory during conversion between them) */
|
||||
if (!(seg_is_raid4(seg) || seg_is_raid5_n(seg)) && !seg->meta_areas)
|
||||
raid_seg_error("no meta areas");
|
||||
if (!seg->stripe_size)
|
||||
|
||||
@@ -1224,15 +1224,6 @@ int lv_raid_replace(struct logical_volume *lv, int force,
|
||||
struct dm_list *remove_pvs, struct dm_list *allocate_pvs);
|
||||
int lv_raid_remove_missing(struct logical_volume *lv);
|
||||
int partial_raid_lv_supports_degraded_activation(const struct logical_volume *lv);
|
||||
uint32_t raid_rmeta_extents_delta(struct cmd_context *cmd,
|
||||
uint32_t rimage_extents_cur, uint32_t rimage_extents_new,
|
||||
uint32_t region_size, uint32_t extent_size);
|
||||
uint32_t raid_rimage_extents(const struct segment_type *segtype,
|
||||
uint32_t extents, uint32_t stripes, uint32_t data_copies);
|
||||
uint32_t raid_ensure_min_region_size(const struct logical_volume *lv, uint64_t raid_size, uint32_t region_size);
|
||||
int lv_raid_change_region_size(struct logical_volume *lv,
|
||||
int yes, int force, uint32_t new_region_size);
|
||||
int lv_raid_in_sync(const struct logical_volume *lv);
|
||||
/* -- metadata/raid_manip.c */
|
||||
|
||||
/* ++ metadata/cache_manip.c */
|
||||
|
||||
@@ -1256,7 +1256,7 @@ uint32_t extents_from_percent_size(struct volume_group *vg, const struct dm_list
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* fall through to use all PVs in VG like %FREE */
|
||||
/* Fall back to use all PVs in VG like %FREE */
|
||||
case PERCENT_FREE:
|
||||
if (!(extents = vg->free_count)) {
|
||||
log_error("No free extents in Volume group %s.", vg->name);
|
||||
@@ -6388,7 +6388,7 @@ int vg_strip_outdated_historical_lvs(struct volume_group *vg) {
|
||||
* Removal time in the future? Not likely,
|
||||
* but skip this item in any case.
|
||||
*/
|
||||
if (current_time < (time_t) glvl->glv->historical->timestamp_removed)
|
||||
if ((current_time) < glvl->glv->historical->timestamp_removed)
|
||||
continue;
|
||||
|
||||
if ((current_time - glvl->glv->historical->timestamp_removed) > threshold) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "activate.h"
|
||||
#include "lv_alloc.h"
|
||||
#include "lvm-string.h"
|
||||
#include "lvm-signal.h"
|
||||
|
||||
static int _check_restriping(uint32_t new_stripes, struct logical_volume *lv)
|
||||
{
|
||||
@@ -49,26 +50,24 @@ static int _check_num_areas_in_lv_segments(struct logical_volume *lv, unsigned n
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure region size exceeds the minimum for @lv because
|
||||
* MD's bitmap is limited to tracking 2^21 regions.
|
||||
*
|
||||
* Pass in @lv_size, because funcion can be called with an empty @lv.
|
||||
*/
|
||||
uint32_t raid_ensure_min_region_size(const struct logical_volume *lv, uint64_t raid_size, uint32_t region_size)
|
||||
/* Ensure region size exceeds the minimum for lv */
|
||||
static void _ensure_min_region_size(const struct logical_volume *lv)
|
||||
{
|
||||
uint32_t min_region_size = raid_size / (1 << 21);
|
||||
uint32_t region_size_sav = region_size;
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
uint32_t min_region_size, region_size;
|
||||
|
||||
/* MD's bitmap is limited to tracking 2^21 regions */
|
||||
min_region_size = lv->size / (1 << 21);
|
||||
region_size = seg->region_size;
|
||||
|
||||
while (region_size < min_region_size)
|
||||
region_size *= 2;
|
||||
|
||||
if (region_size != region_size_sav)
|
||||
log_very_verbose("Adjusting region_size from %s to %s for %s.",
|
||||
display_size(lv->vg->cmd, region_size_sav),
|
||||
display_size(lv->vg->cmd, region_size),
|
||||
display_lvname(lv));
|
||||
return region_size;
|
||||
if (seg->region_size != region_size) {
|
||||
log_very_verbose("Setting region_size to %u for %s.",
|
||||
seg->region_size, display_lvname(lv));
|
||||
seg->region_size = region_size;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -107,7 +106,8 @@ static void _check_and_adjust_region_size(const struct logical_volume *lv)
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
|
||||
seg->region_size = seg->region_size ? : get_default_region_size(lv->vg->cmd);
|
||||
seg->region_size = raid_ensure_min_region_size(lv, lv->size, seg->region_size);
|
||||
|
||||
return _ensure_min_region_size(lv);
|
||||
}
|
||||
|
||||
/* Strip any raid suffix off LV name */
|
||||
@@ -238,7 +238,7 @@ static int _deactivate_and_remove_lvs(struct volume_group *vg, struct dm_list *r
|
||||
* Returns: 1 if in-sync, 0 otherwise.
|
||||
*/
|
||||
#define _RAID_IN_SYNC_RETRIES 6
|
||||
static int _raid_in_sync(const struct logical_volume *lv)
|
||||
static int _raid_in_sync(struct logical_volume *lv)
|
||||
{
|
||||
int retries = _RAID_IN_SYNC_RETRIES;
|
||||
dm_percent_t sync_percent;
|
||||
@@ -269,12 +269,6 @@ static int _raid_in_sync(const struct logical_volume *lv)
|
||||
return (sync_percent == DM_PERCENT_100) ? 1 : 0;
|
||||
}
|
||||
|
||||
/* External interface to raid in-sync check */
|
||||
int lv_raid_in_sync(const struct logical_volume *lv)
|
||||
{
|
||||
return _raid_in_sync(lv);
|
||||
}
|
||||
|
||||
/* Check if RaidLV @lv is synced or any raid legs of @lv are not synced */
|
||||
static int _raid_devs_sync_healthy(struct logical_volume *lv)
|
||||
{
|
||||
@@ -486,161 +480,6 @@ out:
|
||||
return r;
|
||||
}
|
||||
|
||||
/* raid0* <-> raid10_near area reorder helper: swap 2 LV segment areas @a1 and @a2 */
|
||||
static void _swap_areas(struct lv_segment_area *a1, struct lv_segment_area *a2)
|
||||
{
|
||||
struct lv_segment_area tmp;
|
||||
|
||||
tmp = *a1;
|
||||
*a1 = *a2;
|
||||
*a2 = tmp;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reorder the areas in the first segment of @seg to suit raid10_{near,far}/raid0 layout.
|
||||
*
|
||||
* raid10_{near,far} can only be reordered to raid0 if !mod(#total_devs, #mirrors)
|
||||
*
|
||||
* Examples with 6 disks indexed 0..5 with 3 stripes:
|
||||
* raid0 (012345) -> raid10_{near,far} (031425) order
|
||||
* idx 024135
|
||||
* raid10_{near,far} (012345) -> raid0 (024135/135024) order depending on mirror leg selection (TBD)
|
||||
* idx 031425
|
||||
* _or_ (variations possible)
|
||||
* idx 304152
|
||||
*
|
||||
* Examples 3 stripes with 9 disks indexed 0..8 to create a 3 striped raid0 with 3 data_copies per leg:
|
||||
* vvv
|
||||
* raid0 (012345678) -> raid10 (034156278) order
|
||||
* v v v
|
||||
* raid10 (012345678) -> raid0 (036124578) order depending on mirror leg selection (TBD)
|
||||
*
|
||||
*/
|
||||
enum raid0_raid10_conversion { reorder_to_raid10_near, reorder_from_raid10_near };
|
||||
static int _reorder_raid10_near_seg_areas(struct lv_segment *seg, enum raid0_raid10_conversion conv)
|
||||
{
|
||||
unsigned dc, idx1, idx1_sav, idx2, s, ss, str, xchg;
|
||||
uint32_t data_copies = 2; /* seg->data_copies */
|
||||
uint32_t *idx, stripes = seg->area_count;
|
||||
unsigned i = 0;
|
||||
|
||||
/* Internal sanity checks... */
|
||||
if (!(conv == reorder_to_raid10_near || conv == reorder_from_raid10_near))
|
||||
return_0;
|
||||
if ((conv == reorder_to_raid10_near && !(seg_is_striped(seg) || seg_is_any_raid0(seg))) ||
|
||||
(conv == reorder_from_raid10_near && !seg_is_raid10_near(seg)))
|
||||
return_0;
|
||||
|
||||
/* FIXME: once more data copies supported with raid10 */
|
||||
if (seg_is_raid10_near(seg) && (stripes % data_copies)) {
|
||||
log_error("Can't convert %s LV %s with number of stripes not divisable by number of data copies",
|
||||
lvseg_name(seg), display_lvname(seg->lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: once more data copies supported with raid10 */
|
||||
stripes /= data_copies;
|
||||
|
||||
if (!(idx = dm_pool_zalloc(seg_lv(seg, 0)->vg->vgmem, seg->area_count * sizeof(*idx))))
|
||||
return 0;
|
||||
|
||||
/* Set up positional index array */
|
||||
switch (conv) {
|
||||
case reorder_to_raid10_near:
|
||||
/*
|
||||
* raid0 (012 345) with 3 stripes/2 data copies -> raid10 (031425)
|
||||
*
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[0]=0
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[1]=2
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[2]=4
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[3]=1
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[4]=3
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[5]=5
|
||||
*
|
||||
* raid0 (012 345 678) with 3 stripes/3 data copies -> raid10 (036147258)
|
||||
*
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[0]=0
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[1]=3
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[2]=6
|
||||
*
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[3]=1
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[4]=4
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[5]=7
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[6]=2
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[7]=5
|
||||
* _reorder_raid10_near_seg_areas 2137 idx[8]=8
|
||||
*/
|
||||
/* idx[from] = to */
|
||||
for (s = ss = 0; s < seg->area_count; s++)
|
||||
if (s < stripes)
|
||||
idx[s] = s * data_copies;
|
||||
|
||||
else {
|
||||
uint32_t factor = s % stripes;
|
||||
|
||||
if (!factor)
|
||||
ss++;
|
||||
|
||||
idx[s] = ss + factor * data_copies;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case reorder_from_raid10_near:
|
||||
/*
|
||||
* Order depending on mirror leg selection (TBD)
|
||||
*
|
||||
* raid10 (012345) with 3 stripes/2 data copies -> raid0 (024135/135024)
|
||||
* raid10 (012345678) with 3 stripes/3 data copies -> raid0 (036147258/147036258/...)
|
||||
*/
|
||||
/* idx[from] = to */
|
||||
for (s = 0; s < seg->area_count; s++)
|
||||
idx[s] = -1; /* = unused */
|
||||
|
||||
idx1 = 0;
|
||||
idx2 = stripes;
|
||||
for (str = 0; str < stripes; str++) {
|
||||
idx1_sav = idx1;
|
||||
for (dc = 0; dc < data_copies; dc++) {
|
||||
struct logical_volume *slv;
|
||||
s = str * data_copies + dc;
|
||||
slv = seg_lv(seg, s);
|
||||
idx[s] = ((slv->status & PARTIAL_LV) || idx1 != idx1_sav) ? idx2++ : idx1++;
|
||||
}
|
||||
|
||||
if (idx1 == idx1_sav) {
|
||||
log_error("Failed to find a valid mirror in stripe %u!", str);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sort areas */
|
||||
do {
|
||||
xchg = seg->area_count;
|
||||
|
||||
for (s = 0; s < seg->area_count ; s++)
|
||||
if (idx[s] == s)
|
||||
xchg--;
|
||||
|
||||
else {
|
||||
_swap_areas(seg->areas + s, seg->areas + idx[s]);
|
||||
_swap_areas(seg->meta_areas + s, seg->meta_areas + idx[s]);
|
||||
ss = idx[idx[s]];
|
||||
idx[idx[s]] = idx[s];
|
||||
idx[s] = ss;
|
||||
}
|
||||
i++;
|
||||
} while (xchg);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* _shift_and_rename_image_components
|
||||
* @seg: Top-level RAID segment
|
||||
@@ -833,7 +672,7 @@ static int _alloc_image_components(struct logical_volume *lv,
|
||||
return_0;
|
||||
|
||||
if (seg_is_linear(seg))
|
||||
region_size = seg->region_size ? : get_default_region_size(lv->vg->cmd);
|
||||
region_size = get_default_region_size(lv->vg->cmd);
|
||||
else
|
||||
region_size = seg->region_size;
|
||||
|
||||
@@ -906,74 +745,6 @@ static int _alloc_image_components(struct logical_volume *lv,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* HM Helper:
|
||||
*
|
||||
* Calculate absolute amount of metadata device extents based
|
||||
* on @rimage_extents, @region_size and @extent_size.
|
||||
*/
|
||||
static uint32_t _raid_rmeta_extents(struct cmd_context *cmd, uint32_t rimage_extents,
|
||||
uint32_t region_size, uint32_t extent_size)
|
||||
{
|
||||
uint64_t bytes, regions, sectors;
|
||||
|
||||
region_size = region_size ?: get_default_region_size(cmd);
|
||||
regions = ((uint64_t) rimage_extents) * extent_size / region_size;
|
||||
|
||||
/* raid and bitmap superblocks + region bytes */
|
||||
bytes = 2 * 4096 + dm_div_up(regions, 8);
|
||||
sectors = dm_div_up(bytes, 512);
|
||||
|
||||
return dm_div_up(sectors, extent_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns raid metadata device size _change_ in extents, algorithm from dm-raid ("raid" target) kernel code.
|
||||
*/
|
||||
uint32_t raid_rmeta_extents_delta(struct cmd_context *cmd,
|
||||
uint32_t rimage_extents_cur, uint32_t rimage_extents_new,
|
||||
uint32_t region_size, uint32_t extent_size)
|
||||
{
|
||||
uint32_t rmeta_extents_cur = _raid_rmeta_extents(cmd, rimage_extents_cur, region_size, extent_size);
|
||||
uint32_t rmeta_extents_new = _raid_rmeta_extents(cmd, rimage_extents_new, region_size, extent_size);
|
||||
|
||||
/* Need minimum size on LV creation */
|
||||
if (!rimage_extents_cur)
|
||||
return rmeta_extents_new;
|
||||
|
||||
/* Need current size on LV deletion */
|
||||
if (!rimage_extents_new)
|
||||
return rmeta_extents_cur;
|
||||
|
||||
if (rmeta_extents_new == rmeta_extents_cur)
|
||||
return 0;
|
||||
|
||||
/* Extending/reducing... */
|
||||
return rmeta_extents_new > rmeta_extents_cur ?
|
||||
rmeta_extents_new - rmeta_extents_cur :
|
||||
rmeta_extents_cur - rmeta_extents_new;
|
||||
}
|
||||
|
||||
/* Calculate raid rimage extents required based on total @extents for @segtype, @stripes and @data_copies */
|
||||
uint32_t raid_rimage_extents(const struct segment_type *segtype,
|
||||
uint32_t extents, uint32_t stripes, uint32_t data_copies)
|
||||
{
|
||||
uint64_t r;
|
||||
|
||||
if (!extents ||
|
||||
segtype_is_mirror(segtype) ||
|
||||
segtype_is_raid1(segtype))
|
||||
return extents;
|
||||
|
||||
r = extents;
|
||||
if (segtype_is_any_raid10(segtype))
|
||||
r *= (data_copies ?: 1); /* Caller should ensure data_copies > 0 */
|
||||
|
||||
r = dm_div_up(r, stripes ?: 1); /* Caller should ensure stripes > 0 */
|
||||
|
||||
return r > UINT_MAX ? 0 : (uint32_t) r;
|
||||
}
|
||||
|
||||
/*
|
||||
* _alloc_rmeta_for_lv
|
||||
* @lv
|
||||
@@ -1014,8 +785,7 @@ static int _alloc_rmeta_for_lv(struct logical_volume *data_lv,
|
||||
|
||||
if (!(ah = allocate_extents(data_lv->vg, NULL, seg->segtype, 0, 1, 0,
|
||||
seg->region_size,
|
||||
raid_rmeta_extents_delta(data_lv->vg->cmd, 0, data_lv->le_count,
|
||||
seg->region_size, data_lv->vg->extent_size),
|
||||
1 /*RAID_METADATA_AREA_LEN*/,
|
||||
allocate_pvs, data_lv->alloc, 0, NULL)))
|
||||
return_0;
|
||||
|
||||
@@ -1075,11 +845,6 @@ static int _raid_add_images_without_commit(struct logical_volume *lv,
|
||||
/* A complete resync will be done, no need to mark each sub-lv */
|
||||
status_mask = ~(LV_REBUILD);
|
||||
|
||||
/* FIXME: allow setting region size on upconvert from linear */
|
||||
seg->region_size = get_default_region_size(lv->vg->cmd);
|
||||
/* MD's bitmap is limited to tracking 2^21 regions */
|
||||
seg->region_size = raid_ensure_min_region_size(lv, lv->size, seg->region_size);
|
||||
|
||||
if (!(lvl = dm_pool_alloc(lv->vg->vgmem, sizeof(*lvl)))) {
|
||||
log_error("Memory allocation failed.");
|
||||
return 0;
|
||||
@@ -1126,9 +891,7 @@ static int _raid_add_images_without_commit(struct logical_volume *lv,
|
||||
goto fail;
|
||||
|
||||
if (seg_is_linear(seg)) {
|
||||
uint32_t region_size = seg->region_size;
|
||||
|
||||
seg->status |= RAID_IMAGE;
|
||||
first_seg(lv)->status |= RAID_IMAGE;
|
||||
if (!insert_layer_for_lv(lv->vg->cmd, lv,
|
||||
RAID | LVM_READ | LVM_WRITE,
|
||||
"_rimage_0"))
|
||||
@@ -1136,8 +899,15 @@ static int _raid_add_images_without_commit(struct logical_volume *lv,
|
||||
|
||||
lv->status |= RAID;
|
||||
seg = first_seg(lv);
|
||||
seg->region_size = region_size;
|
||||
seg_lv(seg, 0)->status |= RAID_IMAGE | LVM_READ | LVM_WRITE;
|
||||
seg->region_size = get_default_region_size(lv->vg->cmd);
|
||||
|
||||
/* MD's bitmap is limited to tracking 2^21 regions */
|
||||
while (seg->region_size < (lv->size / (1 << 21))) {
|
||||
seg->region_size *= 2;
|
||||
log_very_verbose("Setting RAID1 region_size to %uS.",
|
||||
seg->region_size);
|
||||
}
|
||||
if (!(seg->segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID1)))
|
||||
return_0;
|
||||
}
|
||||
@@ -2405,6 +2175,7 @@ static int _convert_mirror_to_raid1(struct logical_volume *lv,
|
||||
lv->status &= ~MIRROR;
|
||||
lv->status &= ~MIRRORED;
|
||||
lv->status |= RAID;
|
||||
seg->status |= RAID;
|
||||
|
||||
if (!lv_update_and_reload(lv))
|
||||
return_0;
|
||||
@@ -2768,7 +2539,6 @@ static struct lv_segment *_convert_striped_to_raid0(struct logical_volume *lv,
|
||||
#define ALLOW_NONE 0x0
|
||||
#define ALLOW_STRIPES 0x2
|
||||
#define ALLOW_STRIPE_SIZE 0x4
|
||||
#define ALLOW_REGION_SIZE 0x8
|
||||
|
||||
struct possible_takeover_reshape_type {
|
||||
/* First 2 have to stay... */
|
||||
@@ -2785,77 +2555,58 @@ struct possible_type {
|
||||
};
|
||||
|
||||
static struct possible_takeover_reshape_type _possible_takeover_reshape_types[] = {
|
||||
/* striped -> raid1 */
|
||||
/* striped -> */
|
||||
{ .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */
|
||||
.possible_types = SEG_RAID1,
|
||||
.current_areas = 1,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
{ .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */
|
||||
.possible_types = SEG_RAID0|SEG_RAID0_META,
|
||||
.current_areas = 1,
|
||||
.options = ALLOW_STRIPE_SIZE },
|
||||
|
||||
/* raid0* -> raid1 */
|
||||
/* raid0* -> */
|
||||
{ .current_types = SEG_RAID0|SEG_RAID0_META, /* seg->area_count = 1 */
|
||||
.possible_types = SEG_RAID1,
|
||||
.current_areas = 1,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* striped,raid0* <-> striped,raid0* */
|
||||
{ .current_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
|
||||
.possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
|
||||
/* striped,raid0*,raid4,raid5_n,raid6_n_6 <-> striped,raid0*,raid4,raid5_n,raid6_n_6 */
|
||||
{ .current_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META|SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6,
|
||||
.possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META|SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_NONE },
|
||||
|
||||
/* striped,raid0* -> raid4,raid5_n,raid6_n_6,raid10_near */
|
||||
{ .current_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
|
||||
.possible_types = SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6|SEG_RAID10_NEAR,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
|
||||
/* raid4,raid5_n,raid6_n_6,raid10_near -> striped/raid0* */
|
||||
{ .current_types = SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6|SEG_RAID10_NEAR,
|
||||
.possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_NONE },
|
||||
|
||||
/* raid4,raid5_n,raid6_n_6 <-> raid4,raid5_n,raid6_n_6 */
|
||||
{ .current_types = SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6,
|
||||
.possible_types = SEG_RAID4|SEG_RAID5_N|SEG_RAID6_N_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* raid5_ls <-> raid6_ls_6 */
|
||||
{ .current_types = SEG_RAID5_LS|SEG_RAID6_LS_6,
|
||||
.possible_types = SEG_RAID5_LS|SEG_RAID6_LS_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* raid5_rs -> raid6_rs_6 */
|
||||
{ .current_types = SEG_RAID5_RS|SEG_RAID6_RS_6,
|
||||
.possible_types = SEG_RAID5_RS|SEG_RAID6_RS_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* raid5_ls -> raid6_la_6 */
|
||||
{ .current_types = SEG_RAID5_LA|SEG_RAID6_LA_6,
|
||||
.possible_types = SEG_RAID5_LA|SEG_RAID6_LA_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* raid5_ls -> raid6_ra_6 */
|
||||
{ .current_types = SEG_RAID5_RA|SEG_RAID6_RA_6,
|
||||
.possible_types = SEG_RAID5_RA|SEG_RAID6_RA_6,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
|
||||
/* mirror <-> raid1 with arbitrary number of legs */
|
||||
{ .current_types = SEG_MIRROR|SEG_RAID1,
|
||||
.possible_types = SEG_MIRROR|SEG_RAID1,
|
||||
.current_areas = ~0U,
|
||||
.options = ALLOW_REGION_SIZE },
|
||||
.options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
|
||||
|
||||
/* END */
|
||||
{ .current_types = 0 }
|
||||
@@ -3142,6 +2893,8 @@ static int _raid1_to_mirrored_wrapper(TAKEOVER_FN_ARGS)
|
||||
display_lvname(lv), SEG_TYPE_NAME_MIRROR);
|
||||
return 0;
|
||||
}
|
||||
if (sigint_caught())
|
||||
return_0;
|
||||
|
||||
/* Archive metadata */
|
||||
if (!archive(lv->vg))
|
||||
@@ -3331,7 +3084,7 @@ static int _shift_parity_dev(struct lv_segment *seg)
|
||||
|
||||
/* raid456 -> raid0* / striped */
|
||||
static int _raid45_to_raid54_wrapper(TAKEOVER_FN_ARGS);
|
||||
static int _raid45610_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
int rename_sublvs = 0;
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
@@ -3340,12 +3093,9 @@ static int _raid45610_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
|
||||
dm_list_init(&removal_lvs);
|
||||
|
||||
/* Necessary when converting to raid0/striped w/o redundancy. */
|
||||
if (!_raid_in_sync(lv)) {
|
||||
log_error("Unable to convert %s while it is not in-sync.",
|
||||
display_lvname(lv));
|
||||
/* Necessary when convering to raid0/striped w/o redundancy? */
|
||||
if (!_raid_in_sync(lv))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!yes && yes_no_prompt("Are you sure you want to convert \"%s\" LV %s to \"%s\" "
|
||||
"type losing %s resilience? [y/n]: ",
|
||||
@@ -3355,6 +3105,8 @@ static int _raid45610_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
display_lvname(lv), new_segtype->name);
|
||||
return 0;
|
||||
}
|
||||
if (sigint_caught())
|
||||
return_0;
|
||||
|
||||
/* Archive metadata */
|
||||
if (!archive(lv->vg))
|
||||
@@ -3376,10 +3128,6 @@ static int _raid45610_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
log_error("Failed to rename %s LV %s MetaLVs.", lvseg_name(seg), display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
} else if (seg_is_raid10_near(seg)) {
|
||||
log_debug_metadata("Reordering areas for raid10 -> raid0 takeover");
|
||||
if (!_reorder_raid10_near_seg_areas(seg, reorder_from_raid10_near))
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Remove meta and data LVs requested */
|
||||
@@ -3408,7 +3156,7 @@ static int _raid45610_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
} else
|
||||
seg->segtype = new_segtype;
|
||||
|
||||
seg->region_size = new_region_size ?: region_size;
|
||||
seg->region_size = region_size;
|
||||
|
||||
if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs))
|
||||
return_0;
|
||||
@@ -3455,7 +3203,7 @@ static int _raid45_to_raid54_wrapper(TAKEOVER_FN_ARGS)
|
||||
}
|
||||
|
||||
|
||||
/* Necessary when convering to raid0/striped w/o redundancy. */
|
||||
/* Necessary when convering to raid0/striped w/o redundancy? */
|
||||
if (!_raid_in_sync(lv)) {
|
||||
log_error("Unable to convert %s while it is not in-sync.",
|
||||
display_lvname(lv));
|
||||
@@ -3532,6 +3280,9 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
|
||||
|
||||
dm_list_init(&removal_lvs);
|
||||
|
||||
if (seg_is_raid10(seg))
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
|
||||
if (new_data_copies > new_image_count) {
|
||||
log_error("N number of data_copies \"--mirrors N-1\" may not be larger than number of stripes.");
|
||||
return 0;
|
||||
@@ -3590,10 +3341,6 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
|
||||
!_rename_area_lvs(lv, "_"))) {
|
||||
log_error("Can't convert %s to %s.", display_lvname(lv), new_segtype->name);
|
||||
return 0;
|
||||
} else if (segtype_is_raid10_near(new_segtype)) {
|
||||
log_debug_metadata("Reordering areas for raid0 -> raid10 takeover");
|
||||
if (!_reorder_raid10_near_seg_areas(seg, reorder_to_raid10_near))
|
||||
return 0;
|
||||
}
|
||||
|
||||
seg->segtype = new_segtype;
|
||||
@@ -3659,8 +3406,6 @@ static int _takeover_from_mirrored_to_raid0_meta(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_mirrored_to_raid1(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
first_seg(lv)->region_size = new_region_size;
|
||||
|
||||
return _convert_mirror_to_raid1(lv, new_segtype);
|
||||
}
|
||||
|
||||
@@ -3699,9 +3444,7 @@ static int _takeover_from_raid0_to_raid1(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid0_to_raid10(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _striped_or_raid0_to_raid45610_wrapper(lv, new_segtype, yes, force,
|
||||
first_seg(lv)->area_count * 2 /* new_image_count */,
|
||||
2 /* data_copies */, 0, 0, new_region_size, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid0_to_raid45(TAKEOVER_FN_ARGS)
|
||||
@@ -3751,9 +3494,7 @@ static int _takeover_from_raid0_meta_to_raid1(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid0_meta_to_raid10(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _striped_or_raid0_to_raid45610_wrapper(lv, new_segtype, yes, force,
|
||||
first_seg(lv)->area_count * 2 /* new_image_count */,
|
||||
2 /* data_copies */, 0, 0, new_region_size, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid0_meta_to_raid45(TAKEOVER_FN_ARGS)
|
||||
@@ -3830,12 +3571,12 @@ static int _takeover_from_raid45_to_mirrored(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid45_to_raid0(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid45_to_raid0_meta(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid45_to_raid1(TAKEOVER_FN_ARGS)
|
||||
@@ -3845,8 +3586,7 @@ static int _takeover_from_raid45_to_raid1(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid45_to_raid54(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45_to_raid54_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count,
|
||||
2 /* data_copies */, 0, 0, new_region_size, allocate_pvs);
|
||||
return _raid45_to_raid54_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count, 2 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid45_to_raid6(TAKEOVER_FN_ARGS)
|
||||
@@ -3866,30 +3606,30 @@ static int _takeover_from_raid45_to_raid6(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid45_to_striped(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1, 1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid6_to_raid0(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid6_to_raid0_meta(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid6_to_raid45(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1,
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 1,
|
||||
2 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid6_to_striped(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
return _raid456_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count - 2,
|
||||
2 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
}
|
||||
|
||||
@@ -3916,9 +3656,7 @@ static int _takeover_from_striped_to_raid0_meta(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_striped_to_raid10(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _striped_or_raid0_to_raid45610_wrapper(lv, new_segtype, yes, force,
|
||||
first_seg(lv)->area_count * 2 /* new_image_count */,
|
||||
2 /* data_copies */, 0, 0, new_region_size, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
static int _takeover_from_striped_to_raid45(TAKEOVER_FN_ARGS)
|
||||
@@ -3935,8 +3673,6 @@ static int _takeover_from_striped_to_raid6(TAKEOVER_FN_ARGS)
|
||||
}
|
||||
|
||||
/*
|
||||
* Only if we decide to support raid01 at all.
|
||||
|
||||
static int _takeover_from_raid01_to_raid01(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
@@ -3951,7 +3687,6 @@ static int _takeover_from_raid01_to_striped(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
*/
|
||||
|
||||
static int _takeover_from_raid10_to_linear(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
@@ -3965,22 +3700,17 @@ static int _takeover_from_raid10_to_mirrored(TAKEOVER_FN_ARGS)
|
||||
|
||||
static int _takeover_from_raid10_to_raid0(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count / 2,
|
||||
1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only if we decide to support raid01 at all.
|
||||
static int _takeover_from_raid10_to_raid01(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
*/
|
||||
|
||||
static int _takeover_from_raid10_to_raid0_meta(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count / 2,
|
||||
1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid10_to_raid1(TAKEOVER_FN_ARGS)
|
||||
@@ -3988,20 +3718,16 @@ static int _takeover_from_raid10_to_raid1(TAKEOVER_FN_ARGS)
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
|
||||
/*
|
||||
* This'd be a reshape, not a takeover.
|
||||
*
|
||||
static int _takeover_from_raid10_to_raid10(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
*/
|
||||
|
||||
static int _takeover_from_raid10_to_striped(TAKEOVER_FN_ARGS)
|
||||
{
|
||||
return _raid45610_to_raid0_or_striped_wrapper(lv, new_segtype, yes, force, first_seg(lv)->area_count / 2,
|
||||
1 /* data_copies */, 0, 0, 0, allocate_pvs);
|
||||
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Import takeover matrix.
|
||||
@@ -4121,90 +3847,11 @@ replaced:
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* HM Helper:
|
||||
*
|
||||
* Change region size on raid @lv to @region_size if
|
||||
* different from current region_size and adjusted region size
|
||||
*/
|
||||
static int _region_size_change_requested(struct logical_volume *lv, int yes, const uint32_t region_size)
|
||||
{
|
||||
uint32_t old_region_size;
|
||||
const char *seg_region_size_str;
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
|
||||
/* Caller should ensure this */
|
||||
if (!region_size)
|
||||
return_0;
|
||||
|
||||
/* CLI validation provides the check but be caucious... */
|
||||
if (seg_is_any_raid0(seg))
|
||||
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;
|
||||
}
|
||||
|
||||
if (region_size * 8 > lv->size) {
|
||||
log_error("Requested region size too large for LV %s size %s.",
|
||||
display_lvname(lv), display_size(lv->vg->cmd, lv->size));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (region_size < seg->stripe_size) {
|
||||
log_error("Requested region size for LV %s is smaller than stripe size.",
|
||||
display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_raid_in_sync(lv)) {
|
||||
log_error("Unable to change region size on %s LV %s while it is not in-sync.",
|
||||
lvseg_name(seg), display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
old_region_size = seg->region_size;
|
||||
seg_region_size_str = display_size(lv->vg->cmd, region_size);
|
||||
|
||||
if (!yes && yes_no_prompt("Do you really want to change the region_size %s of LV %s to %s? [y/n]: ",
|
||||
display_size(lv->vg->cmd, old_region_size),
|
||||
display_lvname(lv), seg_region_size_str) == 'n') {
|
||||
log_error("Logical volume %s NOT converted", display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
seg->region_size = region_size;
|
||||
_check_and_adjust_region_size(lv);
|
||||
|
||||
if (seg->region_size == old_region_size) {
|
||||
log_warn("Region size on %s did not change due to adjustment.",
|
||||
display_lvname(lv));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check for new region size causing bitmap to still fit metadata image LV */
|
||||
if (seg->meta_areas && seg_metatype(seg, 0) == AREA_LV && seg_metalv(seg, 0)->le_count <
|
||||
_raid_rmeta_extents(lv->vg->cmd, lv->le_count, seg->region_size, lv->vg->extent_size)) {
|
||||
log_error("Region size %s on %s is too small for metadata LV size.",
|
||||
seg_region_size_str, display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!lv_update_and_reload_origin(lv))
|
||||
return_0;
|
||||
|
||||
log_warn("Changed region size on RAID LV %s to %s.",
|
||||
display_lvname(lv), seg_region_size_str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check allowed conversion from seg_from to *segtype_to */
|
||||
static int _conversion_options_allowed(const struct lv_segment *seg_from,
|
||||
const struct segment_type **segtype_to,
|
||||
uint32_t new_image_count,
|
||||
int new_data_copies, int new_region_size,
|
||||
int new_data_copies, int region_size,
|
||||
int stripes, unsigned new_stripe_size_supplied)
|
||||
{
|
||||
int r = 1;
|
||||
@@ -4231,12 +3878,6 @@ static int _conversion_options_allowed(const struct lv_segment *seg_from,
|
||||
r = 0;
|
||||
}
|
||||
|
||||
if (new_region_size && !(opts & ALLOW_REGION_SIZE)) {
|
||||
if (!_log_prohibited_option(seg_from, *segtype_to, "-R/--regionsize"))
|
||||
stack;
|
||||
r = 0;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -4263,7 +3904,6 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
uint32_t stripes, stripe_size;
|
||||
uint32_t new_image_count = seg->area_count;
|
||||
uint32_t region_size = new_region_size;
|
||||
takeover_fn_t takeover_fn;
|
||||
|
||||
if (!new_segtype) {
|
||||
@@ -4283,20 +3923,6 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
if (segtype_is_raid(new_segtype) && !_check_max_raid_devices(new_image_count))
|
||||
return_0;
|
||||
|
||||
/* Change RAID region size */
|
||||
/*
|
||||
* FIXME: workaround with new_region_size until the
|
||||
* cli validation patches got merged when we'll change
|
||||
* the API to have new_region_size_supplied to check for.
|
||||
*/
|
||||
if (new_region_size) {
|
||||
if (new_segtype == seg->segtype &&
|
||||
new_region_size != seg->region_size &&
|
||||
seg_is_raid(seg) && !seg_is_any_raid0(seg))
|
||||
return _region_size_change_requested(lv, yes, new_region_size);
|
||||
} else
|
||||
region_size = seg->region_size ? : get_default_region_size(lv->vg->cmd);
|
||||
|
||||
/*
|
||||
* Check acceptible options mirrors, region_size,
|
||||
* stripes and/or stripe_size have been provided.
|
||||
@@ -4310,7 +3936,7 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
/* Exit without doing activation checks if the combination isn't possible */
|
||||
if (_takeover_not_possible(takeover_fn))
|
||||
return takeover_fn(lv, new_segtype, yes, force, new_image_count, 0, new_stripes, stripe_size,
|
||||
region_size, allocate_pvs);
|
||||
new_region_size, allocate_pvs);
|
||||
|
||||
log_verbose("Converting %s from %s to %s.",
|
||||
display_lvname(lv), lvseg_name(first_seg(lv)),
|
||||
@@ -4341,13 +3967,7 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
}
|
||||
|
||||
return takeover_fn(lv, new_segtype, yes, force, new_image_count, 0, new_stripes, stripe_size,
|
||||
region_size, allocate_pvs);
|
||||
}
|
||||
|
||||
int lv_raid_change_region_size(struct logical_volume *lv,
|
||||
int yes, int force, uint32_t new_region_size)
|
||||
{
|
||||
return _region_size_change_requested(lv, yes, new_region_size);
|
||||
new_region_size, allocate_pvs);
|
||||
}
|
||||
|
||||
static int _remove_partial_multi_segment_image(struct logical_volume *lv,
|
||||
|
||||
@@ -50,8 +50,7 @@ struct dev_manager;
|
||||
#define SEG_RAID0 0x0000000000040000ULL
|
||||
#define SEG_RAID0_META 0x0000000000080000ULL
|
||||
#define SEG_RAID1 0x0000000000100000ULL
|
||||
#define SEG_RAID10_NEAR 0x0000000000200000ULL
|
||||
#define SEG_RAID10 SEG_RAID10_NEAR
|
||||
#define SEG_RAID10 0x0000000000200000ULL
|
||||
#define SEG_RAID4 0x0000000000400000ULL
|
||||
#define SEG_RAID5_N 0x0000000000800000ULL
|
||||
#define SEG_RAID5_LA 0x0000000001000000ULL
|
||||
|
||||
@@ -112,7 +112,7 @@ static takeover_fn_t _takeover_fns[][11] = {
|
||||
/* raid1 */ { r1__lin, r1__str, r1__mir, r1__r0, r1__r0m, r1__r1, r1__r45, X , r1__r10, X , X },
|
||||
/* raid4/5 */ { r45_lin, r45_str, r45_mir, r45_r0, r45_r0m, r45_r1, r45_r54, r45_r6, X , X , X },
|
||||
/* raid6 */ { X , r6__str, X , r6__r0, r6__r0m, X , r6__r45, X , X , X , X },
|
||||
/* raid10 */ { r10_lin, r10_str, r10_mir, r10_r0, r10_r0m, r10_r1, X , X , X , X , X },
|
||||
/* raid10 */ // { r10_lin, r10_str, r10_mir, r10_r0, r10_r0m, r10_r1, X , X , r10_r10, r10_r01, X },
|
||||
/* raid01 */ // { X , r01_str, X , X , X , X , X , X , r01_r10, r01_r01, X },
|
||||
/* other */ { X , X , X , X , X , X , X , X , X , X , X },
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "lib.h"
|
||||
#include "config.h"
|
||||
#include "lvm-file.h"
|
||||
#include "lvm-flock.h"
|
||||
#include "lvm-signal.h"
|
||||
#include "locking.h"
|
||||
|
||||
@@ -42,7 +42,7 @@ static int _pthread_create(pthread_t *t, void *(*fun)(void *), void *arg, int st
|
||||
/*
|
||||
* We use a smaller stack since it gets preallocated in its entirety
|
||||
*/
|
||||
pthread_attr_setstacksize(&attr, stacksize + getpagesize());
|
||||
pthread_attr_setstacksize(&attr, stacksize);
|
||||
return pthread_create(t, &attr, fun, arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2874,8 +2874,8 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||
else if (child->props.size_changed < 0)
|
||||
dnode->props.size_changed = -1;
|
||||
|
||||
/* No resume for a device without parents or with unchanged or smaller size */
|
||||
if (!dm_tree_node_num_children(child, 1) || (child->props.size_changed <= 0))
|
||||
/* Resume device immediately if it has parents and its size changed */
|
||||
if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed)
|
||||
continue;
|
||||
|
||||
if (!node_created && (dm_list_size(&child->props.segs) == 1)) {
|
||||
|
||||
@@ -3062,31 +3062,26 @@ static void _get_final_time(time_range_t range, struct tm *tm,
|
||||
tm_up.tm_sec += 1;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case RANGE_MINUTE:
|
||||
if (tm_up.tm_min < 59) {
|
||||
tm_up.tm_min += 1;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case RANGE_HOUR:
|
||||
if (tm_up.tm_hour < 23) {
|
||||
tm_up.tm_hour += 1;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case RANGE_DAY:
|
||||
if (tm_up.tm_mday < _get_days_in_month(tm_up.tm_mon, tm_up.tm_year)) {
|
||||
tm_up.tm_mday += 1;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case RANGE_MONTH:
|
||||
if (tm_up.tm_mon < 11) {
|
||||
tm_up.tm_mon += 1;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
case RANGE_YEAR:
|
||||
tm_up.tm_year += 1;
|
||||
break;
|
||||
@@ -4209,7 +4204,7 @@ static void _recalculate_fields(struct dm_report *rh)
|
||||
{
|
||||
struct row *row;
|
||||
struct dm_report_field *field;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
dm_list_iterate_items(row, &rh->rows) {
|
||||
dm_list_iterate_items(field, &row->fields) {
|
||||
|
||||
@@ -402,7 +402,7 @@ static int _stats_bound(const struct dm_stats *dms)
|
||||
if (dms->bind_major > 0 || dms->bind_name || dms->bind_uuid)
|
||||
return 1;
|
||||
/* %p format specifier expects a void pointer. */
|
||||
log_debug("Stats handle at %p is not bound.", dms);
|
||||
log_debug("Stats handle at %p is not bound.", (void *) dms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3294,7 +3294,7 @@ static void _sum_histogram_bins(const struct dm_stats *dms,
|
||||
struct dm_stats_region *region;
|
||||
struct dm_histogram_bin *bins;
|
||||
struct dm_histogram *dmh_cur;
|
||||
int bin;
|
||||
uint64_t bin;
|
||||
|
||||
region = &dms->regions[region_id];
|
||||
dmh_cur = region->counters[area_id].histogram;
|
||||
@@ -3857,9 +3857,9 @@ struct _extent {
|
||||
*/
|
||||
static int _extent_start_compare(const void *p1, const void *p2)
|
||||
{
|
||||
const struct _extent *r1, *r2;
|
||||
r1 = (const struct _extent *) p1;
|
||||
r2 = (const struct _extent *) p2;
|
||||
struct _extent *r1, *r2;
|
||||
r1 = (struct _extent *) p1;
|
||||
r2 = (struct _extent *) p2;
|
||||
|
||||
if (r1->start < r2->start)
|
||||
return -1;
|
||||
@@ -3868,6 +3868,37 @@ static int _extent_start_compare(const void *p1, const void *p2)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resize the group bitmap corresponding to group_id so that it can
|
||||
* contain at least num_regions members.
|
||||
*/
|
||||
static int _stats_resize_group(struct dm_stats_group *group, int num_regions)
|
||||
{
|
||||
int last_bit = dm_bit_get_last(group->regions);
|
||||
dm_bitset_t new, old;
|
||||
|
||||
if (last_bit >= num_regions) {
|
||||
log_error("Cannot resize group bitmap to %d with bit %d set.",
|
||||
num_regions, last_bit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_very_verbose("Resizing group bitmap from %d to %d (last_bit: %d).",
|
||||
group->regions[0], num_regions, last_bit);
|
||||
|
||||
new = dm_bitset_create(NULL, num_regions);
|
||||
if (!new) {
|
||||
log_error("Could not allocate memory for new group bitmap.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
old = group->regions;
|
||||
dm_bit_copy(new, old);
|
||||
group->regions = new;
|
||||
dm_bitset_destroy(old);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _stats_create_group(struct dm_stats *dms, dm_bitset_t regions,
|
||||
const char *alias, uint64_t *group_id)
|
||||
{
|
||||
@@ -3972,7 +4003,7 @@ merge:
|
||||
static void _stats_copy_histogram_bounds(struct dm_histogram *to,
|
||||
struct dm_histogram *from)
|
||||
{
|
||||
int i;
|
||||
uint64_t i;
|
||||
|
||||
to->nr_bins = from->nr_bins;
|
||||
|
||||
@@ -3988,7 +4019,7 @@ static void _stats_copy_histogram_bounds(struct dm_histogram *to,
|
||||
static int _stats_check_histogram_bounds(struct dm_histogram *h1,
|
||||
struct dm_histogram *h2)
|
||||
{
|
||||
int i;
|
||||
uint64_t i;
|
||||
|
||||
if (!h1 || !h2)
|
||||
return 0;
|
||||
@@ -4171,37 +4202,6 @@ int dm_stats_get_group_descriptor(const struct dm_stats *dms,
|
||||
}
|
||||
|
||||
#ifdef HAVE_LINUX_FIEMAP_H
|
||||
/*
|
||||
* Resize the group bitmap corresponding to group_id so that it can
|
||||
* contain at least num_regions members.
|
||||
*/
|
||||
static int _stats_resize_group(struct dm_stats_group *group, int num_regions)
|
||||
{
|
||||
int last_bit = dm_bit_get_last(group->regions);
|
||||
dm_bitset_t new, old;
|
||||
|
||||
if (last_bit >= num_regions) {
|
||||
log_error("Cannot resize group bitmap to %d with bit %d set.",
|
||||
num_regions, last_bit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_very_verbose("Resizing group bitmap from %d to %d (last_bit: %d).",
|
||||
group->regions[0], num_regions, last_bit);
|
||||
|
||||
new = dm_bitset_create(NULL, num_regions);
|
||||
if (!new) {
|
||||
log_error("Could not allocate memory for new group bitmap.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
old = group->regions;
|
||||
dm_bit_copy(new, old);
|
||||
group->regions = new;
|
||||
dm_bitset_destroy(old);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Group a table of region_ids corresponding to the extents of a file.
|
||||
*/
|
||||
@@ -4557,7 +4557,7 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
log_error("Could not finalize region extent table.");
|
||||
goto out;
|
||||
}
|
||||
log_very_verbose("Kept " FMTi64 " of " FMTi64 " old extents",
|
||||
log_very_verbose("Kept %ld of %ld old extents",
|
||||
nr_kept, nr_old);
|
||||
log_very_verbose("Found " FMTu64 " new extents",
|
||||
*count - nr_kept);
|
||||
@@ -4725,7 +4725,7 @@ static uint64_t *_stats_map_file_regions(struct dm_stats *dms, int fd,
|
||||
|
||||
dm_pool_free(extent_mem, extents);
|
||||
dm_pool_destroy(extent_mem);
|
||||
|
||||
dm_free(hist_arg);
|
||||
return regions;
|
||||
|
||||
out_remove:
|
||||
@@ -4842,7 +4842,7 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
if (!bounds) {
|
||||
log_error("Could not allocate memory for group "
|
||||
"histogram bounds.");
|
||||
goto out;
|
||||
return NULL;
|
||||
}
|
||||
_stats_copy_histogram_bounds(bounds,
|
||||
dms->regions[group_id].bounds);
|
||||
@@ -4869,8 +4869,6 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
bad:
|
||||
_stats_cleanup_region_ids(dms, regions, count);
|
||||
dm_free(bounds);
|
||||
dm_free(regions);
|
||||
out:
|
||||
dm_free((char *) alias);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ uint64_t dm_units_to_factor(const char *units, char *unit_type,
|
||||
uint64_t multiplier;
|
||||
|
||||
if (endptr)
|
||||
*endptr = units;
|
||||
*endptr = (char *) units;
|
||||
|
||||
if (isdigit(*units)) {
|
||||
custom_value = strtod(units, &ptr);
|
||||
@@ -709,7 +709,7 @@ uint64_t dm_units_to_factor(const char *units, char *unit_type,
|
||||
}
|
||||
|
||||
if (endptr)
|
||||
*endptr = units + 1;
|
||||
*endptr = (char *) units + 1;
|
||||
|
||||
if (_close_enough(custom_value, 0.))
|
||||
return v * multiplier; /* Use integer arithmetic */
|
||||
|
||||
@@ -40,11 +40,6 @@ SED = @SED@
|
||||
CFLOW_CMD = @CFLOW_CMD@
|
||||
AWK = @AWK@
|
||||
CHMOD = @CHMOD@
|
||||
EGREP = @EGREP@
|
||||
GREP = @GREP@
|
||||
SORT = @SORT@
|
||||
WC = @WC@
|
||||
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
PYCOMPILE = $(top_srcdir)/autoconf/py-compile
|
||||
@@ -517,9 +512,9 @@ ifeq (,$(firstword $(EXPORTED_SYMBOLS)))
|
||||
) > $@
|
||||
else
|
||||
set -e;\
|
||||
R=$$($(SORT) $^ | uniq -u);\
|
||||
R=$$(sort $^ | uniq -u);\
|
||||
test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\
|
||||
( for i in $$(echo $(EXPORTED_SYMBOLS) | tr ' ' '\n' | $(SORT) -rnt_ -k5 ); do\
|
||||
( for i in $$(echo $(EXPORTED_SYMBOLS) | tr ' ' '\n' | sort -rnt_ -k5 ); do\
|
||||
echo "$${i##*.} {"; echo " global:";\
|
||||
$(SED) "s/^/ /;s/$$/;/" $$i;\
|
||||
echo "};";\
|
||||
|
||||
@@ -46,6 +46,8 @@ MAN8GEN=lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 lvm-lvpoll.8 \
|
||||
vgrename.8 vgs.8 vgscan.8 vgsplit.8 \
|
||||
lvmsar.8 lvmsadc.8 lvmdiskscan.8 lvmchange.8
|
||||
|
||||
MAN8+=$(MAN8GEN)
|
||||
|
||||
ifeq ($(MAKECMDGOALS),all_man)
|
||||
MAN_ALL="yes"
|
||||
endif
|
||||
@@ -115,8 +117,8 @@ MAN8DIR=$(mandir)/man8
|
||||
|
||||
include $(top_builddir)/make.tmpl
|
||||
|
||||
CLEAN_TARGETS+=$(MAN5) $(MAN7) $(MAN8) $(MAN8GEN) $(MAN8CLUSTER) \
|
||||
$(MAN8SYSTEMD_GENERATORS) $(MAN8DM) *.gen man-generator
|
||||
CLEAN_TARGETS+=$(MAN5) $(MAN7) $(MAN8) $(MAN8CLUSTER) \
|
||||
$(MAN8SYSTEMD_GENERATORS) $(MAN8DM)
|
||||
DISTCLEAN_TARGETS+=$(FSADMMAN) $(BLKDEACTIVATEMAN) $(DMEVENTDMAN) \
|
||||
$(LVMETADMAN) $(LVMPOLLDMAN) $(LVMLOCKDMAN) $(CLVMDMAN) $(CMIRRORDMAN) \
|
||||
$(LVMCACHEMAN) $(LVMTHINMAN) $(LVMDBUSDMAN) $(LVMRAIDMAN)
|
||||
@@ -127,11 +129,11 @@ all: man device-mapper
|
||||
|
||||
device-mapper: $(MAN8DM)
|
||||
|
||||
man: $(MAN5) $(MAN7) $(MAN8) $(MAN8GEN) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS)
|
||||
man: $(MAN5) $(MAN7) $(MAN8) $(MAN8CLUSTER) $(MAN8SYSTEMD_GENERATORS)
|
||||
|
||||
all_man: man
|
||||
|
||||
$(MAN5) $(MAN7) $(MAN8) $(MAN8GEN) $(MAN8DM) $(MAN8CLUSTER): Makefile
|
||||
$(MAN5) $(MAN7) $(MAN8) $(MAN8DM) $(MAN8CLUSTER): Makefile
|
||||
|
||||
Makefile: Makefile.in
|
||||
@:
|
||||
@@ -142,17 +144,14 @@ Makefile: Makefile.in
|
||||
*) echo "Creating $@" ; $(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+@CLVMD_PATH@+;s+#LVM_PATH#+@LVM_PATH@+;s+#DEFAULT_RUN_DIR#+@DEFAULT_RUN_DIR@+;s+#DEFAULT_PID_DIR#+@DEFAULT_PID_DIR@+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;s+#DEFAULT_MANGLING#+$(DEFAULT_MANGLING)+;" $< > $@ ;; \
|
||||
esac
|
||||
|
||||
man-generator:
|
||||
$(CC) -DMAN_PAGE_GENERATOR -I$(top_builddir)/tools $(CFLAGS) $(top_srcdir)/tools/command.c -o $@
|
||||
- ./man-generator lvmconfig > test.gen
|
||||
if [ ! -s test.gen ] ; then cp genfiles/*.gen $(top_builddir)/man; fi;
|
||||
generator:
|
||||
$(CC) -DMAN_PAGE_GENERATOR $(top_builddir)/tools/command.c -o man-generator
|
||||
|
||||
$(MAN8GEN): man-generator
|
||||
$(MAN8GEN): generator
|
||||
echo "Generating $@" ;
|
||||
if [ ! -e $@.gen ]; then ./man-generator $(basename $@) $(top_srcdir)/man/$@.des > $@.gen; fi
|
||||
if [ -f $(top_srcdir)/man/$@.end ]; then cat $(top_srcdir)/man/$@.end >> $@.gen; fi;
|
||||
cat $(top_srcdir)/man/see_also.end >> $@.gen
|
||||
$(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+@CLVMD_PATH@+;s+#LVM_PATH#+@LVM_PATH@+;s+#DEFAULT_RUN_DIR#+@DEFAULT_RUN_DIR@+;s+#DEFAULT_PID_DIR#+@DEFAULT_PID_DIR@+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;s+#DEFAULT_MANGLING#+$(DEFAULT_MANGLING)+;" $@.gen > $@
|
||||
./man-generator `basename -s .8 $@` > $@.in
|
||||
if [ -f $@.notes ]; then cat $@.notes >> $@.in; fi;
|
||||
$(SED) -e "s+#VERSION#+$(LVM_VERSION)+;s+#DEFAULT_SYS_DIR#+$(DEFAULT_SYS_DIR)+;s+#DEFAULT_ARCHIVE_DIR#+$(DEFAULT_ARCHIVE_DIR)+;s+#DEFAULT_BACKUP_DIR#+$(DEFAULT_BACKUP_DIR)+;s+#DEFAULT_PROFILE_DIR#+$(DEFAULT_PROFILE_DIR)+;s+#DEFAULT_CACHE_DIR#+$(DEFAULT_CACHE_DIR)+;s+#DEFAULT_LOCK_DIR#+$(DEFAULT_LOCK_DIR)+;s+#CLVMD_PATH#+@CLVMD_PATH@+;s+#LVM_PATH#+@LVM_PATH@+;s+#DEFAULT_RUN_DIR#+@DEFAULT_RUN_DIR@+;s+#DEFAULT_PID_DIR#+@DEFAULT_PID_DIR@+;s+#SYSTEMD_GENERATOR_DIR#+$(SYSTEMD_GENERATOR_DIR)+;s+#DEFAULT_MANGLING#+$(DEFAULT_MANGLING)+;" $@.in > $@
|
||||
|
||||
install_man5: $(MAN5)
|
||||
$(INSTALL) -d $(MAN5DIR)
|
||||
@@ -165,7 +164,6 @@ install_man7: $(MAN7)
|
||||
install_man8: $(MAN8) $(MAN8GEN)
|
||||
$(INSTALL) -d $(MAN8DIR)
|
||||
$(INSTALL_DATA) $(MAN8) $(MAN8DIR)/
|
||||
$(INSTALL_DATA) $(MAN8GEN) $(MAN8DIR)/
|
||||
|
||||
install_lvm2: install_man5 install_man7 install_man8
|
||||
|
||||
|
||||
@@ -23,6 +23,40 @@ dmeventd is the event monitoring daemon for device-mapper devices.
|
||||
Library plugins can register and carry out actions triggered when
|
||||
particular events occur.
|
||||
.
|
||||
.SH LVM PLUGINS
|
||||
.
|
||||
.HP
|
||||
.IR Mirror
|
||||
.br
|
||||
Attempts to handle device failure automatically. See
|
||||
.BR lvm.conf (5).
|
||||
.
|
||||
.HP
|
||||
.IR Raid
|
||||
.br
|
||||
Attempts to handle device failure automatically. See
|
||||
.BR lvm.conf (5).
|
||||
.
|
||||
.HP
|
||||
.IR Snapshot
|
||||
.br
|
||||
Monitors how full a snapshot is becoming and emits a warning to
|
||||
syslog when it exceeds 80% full.
|
||||
The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
|
||||
See
|
||||
.BR lvm.conf (5).
|
||||
Snapshot which runs out of space gets invalid and when it is mounted,
|
||||
it gets umounted if possible.
|
||||
.
|
||||
.HP
|
||||
.IR Thin
|
||||
.br
|
||||
Monitors how full a thin pool data and metadata is becoming and emits
|
||||
a warning to syslog when it exceeds 80% full.
|
||||
The warning is repeated when 85%, 90% and 95% of the thin pool is filled.
|
||||
See
|
||||
.BR lvm.conf (5).
|
||||
If the thin-pool runs out of space, thin volumes are umounted if possible.
|
||||
.
|
||||
.SH OPTIONS
|
||||
.
|
||||
@@ -70,80 +104,6 @@ events to monitor from the currently running daemon.
|
||||
.br
|
||||
Show version of dmeventd.
|
||||
.
|
||||
.SH LVM PLUGINS
|
||||
.
|
||||
.HP
|
||||
.BR Mirror
|
||||
.br
|
||||
Attempts to handle device failure automatically. See
|
||||
.BR lvm.conf (5).
|
||||
.
|
||||
.HP
|
||||
.BR Raid
|
||||
.br
|
||||
Attempts to handle device failure automatically. See
|
||||
.BR lvm.conf (5).
|
||||
.
|
||||
.HP
|
||||
.BR Snapshot
|
||||
.br
|
||||
Monitors how full a snapshot is becoming and emits a warning to
|
||||
syslog when it exceeds 80% full.
|
||||
The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
|
||||
See
|
||||
.BR lvm.conf (5).
|
||||
Snapshot which runs out of space gets invalid and when it is mounted,
|
||||
it gets umounted if possible.
|
||||
.
|
||||
.HP
|
||||
.BR Thin
|
||||
.br
|
||||
Monitors how full a thin pool data and metadata is becoming and emits
|
||||
a warning to syslog when it exceeds 80% full.
|
||||
The warning is repeated when more then 85%, 90% and 95%
|
||||
of the thin pool is filled. See
|
||||
.BR lvm.conf (5).
|
||||
When a thin pool fills over 50% (data or metadata) thin plugin calls
|
||||
configured \fIdmeventd/thin_command\fP with every 5% increase.
|
||||
With default setting it calls internal
|
||||
\fBlvm lvextend --use-policies\fP to resize thin pool
|
||||
when it's been filled above configured threshold
|
||||
\fIactivation/thin_pool_autoextend_threshold\fP.
|
||||
If the command fails, dmeventd thin plugin will keep
|
||||
retrying execution with increasing time delay between
|
||||
retries upto 42 minutes.
|
||||
User may also configure external command to support more advanced
|
||||
maintenance operations of a thin pool.
|
||||
Such external command can e.g. remove some unneeded snapshots,
|
||||
use \fBfstrim\fP(8) to free recover space in a thin pool,
|
||||
but also can use \fBlvextend --use-policies\fP if other actions
|
||||
have not released enough space.
|
||||
Command is executed with environmental variable
|
||||
\fBLVM_RUN_BY_DMEVENTD=1\fP so any lvm2 command executed
|
||||
in this environment will not try to interact with dmeventd.
|
||||
To see the fullness of a thin pool command may check these
|
||||
two environmental variables
|
||||
\fBDMEVENTD_THIN_POOL_DATA\fP and \fBDMEVENTD_THIN_POOL_DATA\fP.
|
||||
Command can also read status with tools like \fBlvs\fP(8).
|
||||
.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.
|
||||
.TP
|
||||
.B DMEVENTD_THIN_POOL_DATA
|
||||
Variable is set by thin plugin and is available to executed program. Value present
|
||||
actual usage of thin pool data volume. Variable is not set when error event
|
||||
is processed.
|
||||
.TP
|
||||
.B DMEVENTD_THIN_POOL_DATA
|
||||
Variable is set by thin plugin and is available to executed program. Value present
|
||||
actual usage of thin pool metadata volume. Variable is not set when error event
|
||||
is processed.
|
||||
.TP
|
||||
.B LVM_RUN_BY_DMEVENTD
|
||||
Variable is set by thin plugin to prohibit recursive interation
|
||||
with dmeventd by any executed lvm2 command from
|
||||
a thin_command environment.
|
||||
.
|
||||
.SH SEE ALSO
|
||||
.
|
||||
.BR lvm (8),
|
||||
|
||||
@@ -27,9 +27,9 @@ dmsetup \(em low level logical volume management
|
||||
. IR uuid ]
|
||||
. RB \%[ \-\-addnodeoncreate | \-\-addnodeonresume ]
|
||||
. RB \%[ \-n | \-\-notable | \-\-table
|
||||
. IR \%table | table_file ]
|
||||
. RI \%{ table | table_file }]
|
||||
. RB [ \-\-readahead
|
||||
. RB \%[ + ] \fIsectors | auto | none ]
|
||||
. RB \%{[ + ] \fIsectors | auto | none }]
|
||||
. ad b
|
||||
..
|
||||
.CMD_CREATE
|
||||
@@ -41,7 +41,7 @@ dmsetup \(em low level logical volume management
|
||||
. BR deps
|
||||
. RB [ \-o
|
||||
. IR options ]
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
. ad b
|
||||
..
|
||||
.CMD_DEPS
|
||||
@@ -58,7 +58,7 @@ dmsetup \(em low level logical volume management
|
||||
.B dmsetup
|
||||
.de CMD_INFO
|
||||
. BR info
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
..
|
||||
.CMD_INFO
|
||||
.
|
||||
@@ -92,7 +92,7 @@ dmsetup \(em low level logical volume management
|
||||
. BR load
|
||||
. IR device_name
|
||||
. RB [ \-\-table
|
||||
. IR table | table_file ]
|
||||
. RI { table | table_file }]
|
||||
. ad b
|
||||
..
|
||||
.CMD_LOAD
|
||||
@@ -117,7 +117,7 @@ dmsetup \(em low level logical volume management
|
||||
.B dmsetup
|
||||
.de CMD_MANGLE
|
||||
. BR mangle
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
..
|
||||
.CMD_MANGLE
|
||||
.
|
||||
@@ -135,7 +135,7 @@ dmsetup \(em low level logical volume management
|
||||
.B dmsetup
|
||||
.de CMD_MKNODES
|
||||
. BR mknodes
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
..
|
||||
.CMD_MKNODES
|
||||
.
|
||||
@@ -146,7 +146,7 @@ dmsetup \(em low level logical volume management
|
||||
. BR reload
|
||||
. IR device_name
|
||||
. RB [ \-\-table
|
||||
. IR table | table_file ]
|
||||
. RI { table | table_file }]
|
||||
. ad b
|
||||
..
|
||||
.CMD_RELOAD
|
||||
@@ -159,7 +159,7 @@ dmsetup \(em low level logical volume management
|
||||
. RB [ \-f | \-\-force ]
|
||||
. RB [ \-\-retry ]
|
||||
. RB [ \-\-deferred ]
|
||||
. IR device_name ...
|
||||
. IR device_name
|
||||
. ad b
|
||||
..
|
||||
.CMD_REMOVE
|
||||
@@ -197,12 +197,12 @@ dmsetup \(em low level logical volume management
|
||||
.de CMD_RESUME
|
||||
. ad l
|
||||
. BR resume
|
||||
. IR device_name ...
|
||||
. IR device_name
|
||||
. RB [ \-\-addnodeoncreate | \-\-addnodeonresume ]
|
||||
. RB [ \-\-noflush ]
|
||||
. RB [ \-\-nolockfs ]
|
||||
. RB \%[ \-\-readahead
|
||||
. RB \%[ + ] \fIsectors | auto | none ]
|
||||
. RB \%{[ + ] \fIsectors | auto | none }]
|
||||
. ad b
|
||||
..
|
||||
.CMD_RESUME
|
||||
@@ -247,7 +247,7 @@ dmsetup \(em low level logical volume management
|
||||
. RB [ \-\-target
|
||||
. IR target_type ]
|
||||
. RB [ \-\-noflush ]
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
. ad b
|
||||
..
|
||||
.CMD_STATUS
|
||||
@@ -259,7 +259,7 @@ dmsetup \(em low level logical volume management
|
||||
. BR suspend
|
||||
. RB [ \-\-nolockfs ]
|
||||
. RB [ \-\-noflush ]
|
||||
. IR device_name ...
|
||||
. IR device_name
|
||||
. ad b
|
||||
..
|
||||
.CMD_SUSPEND
|
||||
@@ -272,7 +272,7 @@ dmsetup \(em low level logical volume management
|
||||
. RB [ \-\-target
|
||||
. IR target_type ]
|
||||
. RB [ \-\-showkeys ]
|
||||
. RI [ device_name ...]
|
||||
. RI [ device_name ]
|
||||
. ad b
|
||||
..
|
||||
.CMD_TABLE
|
||||
@@ -354,7 +354,7 @@ dmsetup \(em low level logical volume management
|
||||
.de CMD_WIPE_TABLE
|
||||
. ad l
|
||||
. BR wipe_table
|
||||
. IR device_name ...
|
||||
. IR device_name
|
||||
. RB [ \-f | \-\-force ]
|
||||
. RB [ \-\-noflush ]
|
||||
. RB [ \-\-nolockfs ]
|
||||
@@ -447,7 +447,7 @@ The default interval is one second.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-manglename
|
||||
.BR auto | hex | none
|
||||
.RB { auto | hex | none }
|
||||
.br
|
||||
Mangle any character not on a whitelist using mangling_mode when
|
||||
processing device-mapper device names and UUIDs. The names and UUIDs
|
||||
@@ -529,7 +529,7 @@ Specify which fields to display.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-readahead
|
||||
.RB [ + ] \fIsectors | auto | none
|
||||
.RB {[ + ] \fIsectors | auto | none }
|
||||
.br
|
||||
Specify read ahead size in units of sectors.
|
||||
The default value is \fBauto\fP which allows the kernel to choose
|
||||
@@ -820,10 +820,8 @@ Outputs the current table for the device in a format that can be fed
|
||||
back in using the create or load commands.
|
||||
With \fB\-\-target\fP, only information relating to the specified target type
|
||||
is displayed.
|
||||
Real encryption keys are suppressed in the table output for the crypt
|
||||
target unless the \fB\-\-showkeys\fP parameter is supplied. Kernel key
|
||||
references prefixed with \fB:\fP are not affected by the parameter and get
|
||||
displayed always.
|
||||
Encryption keys are suppressed in the table output for the crypt
|
||||
target unless the \fB\-\-showkeys\fP parameter is supplied.
|
||||
.
|
||||
.HP
|
||||
.CMD_TARGETS
|
||||
|
||||
@@ -44,7 +44,7 @@ dmstats \(em device-mapper statistics management
|
||||
.B dmsetup
|
||||
.B stats
|
||||
.I command
|
||||
[OPTIONS]
|
||||
.RB [ options ]
|
||||
.sp
|
||||
.
|
||||
.PD 0
|
||||
@@ -53,13 +53,13 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_COMMAND
|
||||
. ad l
|
||||
. IR command
|
||||
. IR device_name " |"
|
||||
. BR \-\-major
|
||||
. RI [ device_name |
|
||||
. RB [ \-u | \-\-uuid
|
||||
. IR uuid ]
|
||||
. RB | [ \-\-major
|
||||
. IR major
|
||||
. BR \-\-minor
|
||||
. IR minor " |"
|
||||
. BR \-u | \-\-uuid
|
||||
. IR uuid
|
||||
. IR minor ]
|
||||
. RB \%[ \-v | \-\-verbose]
|
||||
. ad b
|
||||
..
|
||||
@@ -82,7 +82,9 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_CREATE
|
||||
. ad l
|
||||
. BR create
|
||||
. IR device_name... | file_path... | \fB\-\-alldevices
|
||||
. RB [ device_name...
|
||||
. RB | file_path...
|
||||
. RB | [ \-\-alldevices ]]
|
||||
. RB [ \-\-areas
|
||||
. IR nr_areas | \fB\-\-areasize
|
||||
. IR area_size ]
|
||||
@@ -108,7 +110,8 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_DELETE
|
||||
. ad l
|
||||
. BR delete
|
||||
. IR device_name | \fB\-\-alldevices
|
||||
. RI [ device_name ]
|
||||
. RB [ \-\-alldevices ]
|
||||
. OPT_PROGRAMS
|
||||
. OPT_REGIONS
|
||||
. ad b
|
||||
@@ -120,9 +123,10 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_GROUP
|
||||
. ad l
|
||||
. BR group
|
||||
. RI [ device_name | \fB\-\-alldevices ]
|
||||
. RI [ device_name ]
|
||||
. RB [ \-\-alias
|
||||
. IR name ]
|
||||
. RB [ \-\-alldevices ]
|
||||
. RB [ \-\-regions
|
||||
. IR regions ]
|
||||
. ad b
|
||||
@@ -201,7 +205,8 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_UNGROUP
|
||||
. ad l
|
||||
. BR ungroup
|
||||
. RI [ device_name | \fB\-\-alldevices ]
|
||||
. RI [ device_name ]
|
||||
. RB [ \-\-alldevices ]
|
||||
. RB [ \-\-groupid
|
||||
. IR id ]
|
||||
. ad b
|
||||
@@ -212,7 +217,7 @@ dmstats \(em device-mapper statistics management
|
||||
.de CMD_UPDATE_FILEMAP
|
||||
. ad l
|
||||
. BR update_filemap
|
||||
. IR file_path
|
||||
. RI file_path
|
||||
. RB [ \-\-groupid
|
||||
. IR id ]
|
||||
. ad b
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
lvchange changes LV attributes in the VG, changes LV activation in the
|
||||
kernel, and includes other utilities for LV maintenance.
|
||||
@@ -1,6 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Change LV permission to read-only:
|
||||
.sp
|
||||
.B lvchange \-pr vg00/lvol1
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
lvconvert changes the LV type and includes utilities for LV data
|
||||
maintenance. The LV type controls data layout and redundancy.
|
||||
The LV type is also called the segment type or segtype.
|
||||
|
||||
To display the current LV type, run the command:
|
||||
|
||||
.B lvs \-o name,segtype
|
||||
.I LV
|
||||
|
||||
The
|
||||
.B linear
|
||||
type is equivalent to the
|
||||
.B striped
|
||||
type when one stripe exists.
|
||||
In that case, the types can sometimes be used interchangably.
|
||||
|
||||
In most cases, the
|
||||
.B mirror
|
||||
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.
|
||||
|
||||
Sub LVs can be displayed with the command
|
||||
.B lvs -a
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
.SH NOTES
|
||||
|
||||
This previous command syntax would perform two different operations:
|
||||
.br
|
||||
\fBlvconvert --thinpool\fP \fILV1\fP \fB--poolmetadata\fP \fILV2\fP
|
||||
.br
|
||||
If LV1 was not a thin pool, the command would convert LV1 to
|
||||
a thin pool, optionally using a specified LV for metadata.
|
||||
But, if LV1 was already a thin pool, the command would swap
|
||||
the current metadata LV with LV2 (for repair purposes.)
|
||||
|
||||
In the same way, this previous command syntax would perform two different
|
||||
operations:
|
||||
.br
|
||||
\fBlvconvert --cachepool\fP \fILV1\fP \fB--poolmetadata\fP \fILV2\fP
|
||||
.br
|
||||
If LV1 was not a cache pool, the command would convert LV1 to
|
||||
a cache pool, optionally using a specified LV for metadata.
|
||||
But, if LV1 was already a cache pool, the command would swap
|
||||
the current metadata LV with LV2 (for repair purposes.)
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Convert a linear LV to a two-way mirror LV.
|
||||
.br
|
||||
.B lvconvert \-\-type mirror \-\-mirrors 1 vg/lvol1
|
||||
|
||||
Convert a linear LV to a two-way RAID1 LV.
|
||||
.br
|
||||
.B lvconvert \-\-type raid1 \-\-mirrors 1 vg/lvol1
|
||||
|
||||
Convert a mirror LV to use an in\-memory log.
|
||||
.br
|
||||
.B lvconvert \-\-mirrorlog core vg/lvol1
|
||||
|
||||
Convert a mirror LV to use a disk log.
|
||||
.br
|
||||
.B lvconvert \-\-mirrorlog disk vg/lvol1
|
||||
|
||||
Convert a mirror or raid1 LV to a linear LV.
|
||||
.br
|
||||
.B lvconvert --type linear vg/lvol1
|
||||
|
||||
Convert a mirror LV to a raid1 LV with the same number of images.
|
||||
.br
|
||||
.B lvconvert \-\-type raid1 vg/lvol1
|
||||
|
||||
Convert a linear LV to a two-way mirror LV, allocating new extents from specific
|
||||
PV ranges.
|
||||
.br
|
||||
.B lvconvert \-\-mirrors 1 vg/lvol1 /dev/sda:0\-15 /dev/sdb:0\-15
|
||||
|
||||
Convert a mirror LV to a linear LV, freeing physical extents from a specific PV.
|
||||
.br
|
||||
.B lvconvert \-\-type linear vg/lvol1 /dev/sda
|
||||
|
||||
Split one image from a mirror or raid1 LV, making it a new LV.
|
||||
.br
|
||||
.B lvconvert \-\-splitmirrors 1 \-\-name lv_split vg/lvol1
|
||||
|
||||
Split one image from a raid1 LV, and track changes made to the raid1 LV
|
||||
while the split image remains detached.
|
||||
.br
|
||||
.B lvconvert \-\-splitmirrors 1 \-\-trackchanges vg/lvol1
|
||||
|
||||
Merge an image (that was previously created with \-\-splitmirrors and
|
||||
\-\-trackchanges) back into the original raid1 LV.
|
||||
.br
|
||||
.B lvconvert \-\-mergemirrors vg/lvol1_rimage_1
|
||||
|
||||
Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV.
|
||||
.br
|
||||
.B lvconvert \-\-replace /dev/sdb1 vg/lvol1 /dev/sdf1
|
||||
|
||||
Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV.
|
||||
.br
|
||||
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 \-\-replace /dev/sdd1
|
||||
.RS
|
||||
.B vg/lvol1 /dev/sd[fgh]1
|
||||
.RE
|
||||
|
||||
Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a raid6 LV.
|
||||
.br
|
||||
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
|
||||
|
||||
Convert an LV into a thin LV in the specified thin pool. The existing LV
|
||||
is used as an external read\-only origin for the new thin LV.
|
||||
.br
|
||||
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1 vg/lvol1
|
||||
|
||||
Convert an LV into a thin LV in the specified thin pool. The existing LV
|
||||
is used as an external read\-only origin for the new thin LV, and is
|
||||
renamed "external".
|
||||
.br
|
||||
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1
|
||||
.RS
|
||||
.B \-\-originname external vg/lvol1
|
||||
.RE
|
||||
|
||||
Convert an LV to a cache pool LV using another specified LV for cache pool
|
||||
metadata.
|
||||
.br
|
||||
.B lvconvert \-\-type cache-pool \-\-poolmetadata vg/poolmeta1 vg/lvol1
|
||||
|
||||
Convert an LV to a cache LV using the specified cache pool and chunk size.
|
||||
.br
|
||||
.B lvconvert \-\-type cache \-\-cachepool vg/cpool1 \-c 128 vg/lvol1
|
||||
|
||||
Detach and keep the cache pool from a cache LV.
|
||||
.br
|
||||
.B lvconvert \-\-splitcache vg/lvol1
|
||||
|
||||
Detach and remove the cache pool from a cache LV.
|
||||
.br
|
||||
.B lvconvert \-\-uncache vg/lvol1
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
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.)
|
||||
|
||||
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
|
||||
physical extents only from the specified PVs.
|
||||
|
||||
lvcreate can also create snapshots of existing LVs, e.g. for backup
|
||||
purposes. The data in a new snapshot LV represents the content of the
|
||||
original LV from the time the snapshot was created.
|
||||
|
||||
RAID LVs can be created by specifying an LV type when creating the LV (see
|
||||
\fBlvmraid\fP(7)). Different RAID levels require different numbers of
|
||||
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.
|
||||
|
||||
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
|
||||
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 \fINumber\fP can be replaced
|
||||
in each case with \fB--extents\fP \fINumberExtents\fP. Also see both
|
||||
descriptions 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
|
||||
specified, a new LV name is generated with the "lvol" prefix and a unique
|
||||
numeric suffix. Also see the description in the options section.
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Create a striped LV with 3 stripes, a stripe size of 8KiB and a size of 100MiB.
|
||||
The LV name is chosen by lvcreate.
|
||||
.br
|
||||
.B lvcreate \-i 3 \-I 8 \-L 100m vg00
|
||||
|
||||
Create a raid1 LV with two images, and a useable size of 500 MiB. This
|
||||
operation requires two devices, one for each mirror image. RAID metadata
|
||||
(superblock and bitmap) is also included on the two devices.
|
||||
.br
|
||||
.B lvcreate \-\-type raid1 \-m1 \-L 500m \-n mylv vg00
|
||||
|
||||
Create a mirror LV with two images, and a useable size of 500 MiB.
|
||||
This operation requires three devices: two for mirror images and
|
||||
one for a disk log.
|
||||
.br
|
||||
.B lvcreate \-\-type mirror \-m1 \-L 500m \-n mylv vg00
|
||||
|
||||
Create a mirror LV with 2 images, and a useable size of 500 MiB.
|
||||
This operation requires 2 devices because the log is in memory.
|
||||
.br
|
||||
.B lvcreate \-\-type mirror \-m1 \-\-mirrorlog core \-L 500m \-n mylv vg00
|
||||
|
||||
Create a copy\-on\-write snapshot of an LV:
|
||||
.br
|
||||
.B lvcreate \-\-snapshot \-\-size 100m \-\-name mysnap vg00/mylv
|
||||
|
||||
Create a copy\-on\-write snapshot with a size sufficient
|
||||
for overwriting 20% of the size of the original LV.
|
||||
.br
|
||||
.B lvcreate \-s \-l 20%ORIGIN \-n mysnap vg00/mylv
|
||||
|
||||
Create a sparse LV with 1TiB of virtual space, and actual space just under
|
||||
100MiB.
|
||||
.br
|
||||
.B lvcreate \-\-snapshot \-\-virtualsize 1t \-\-size 100m \-\-name mylv vg00
|
||||
|
||||
Create a linear LV with a usable size of 64MiB on specific physical extents.
|
||||
.br
|
||||
.B lvcreate \-L 64m \-n mylv vg00 /dev/sda:0\-7 /dev/sdb:0\-7
|
||||
|
||||
Create a RAID5 LV with a usable size of 5GiB, 3 stripes, a stripe size of
|
||||
64KiB, using a total of 4 devices (including one for parity).
|
||||
.br
|
||||
.B lvcreate \-\-type raid5 \-L 5G \-i 3 \-I 64 \-n mylv vg00
|
||||
|
||||
Create a RAID5 LV using all of the free space in the VG and spanning all the
|
||||
PVs in the VG (note that the command will fail if there are more than 8 PVs in
|
||||
the VG, in which case \fB\-i 7\fP must be used to get to the current maximum of
|
||||
8 devices including parity for RaidLVs).
|
||||
.br
|
||||
.B lvcreate \-\-config allocation/raid_stripe_all_devices=1
|
||||
.RS
|
||||
.B \-\-type raid5 \-l 100%FREE \-n mylv vg00
|
||||
.RE
|
||||
|
||||
Create RAID10 LV with a usable size of 5GiB, using 2 stripes, each on
|
||||
a two-image mirror. (Note that the \fB-i\fP and \fB-m\fP arguments behave
|
||||
differently:
|
||||
\fB-i\fP specifies the total number of stripes,
|
||||
but \fB-m\fP specifies the number of images in addition
|
||||
to the first image).
|
||||
.br
|
||||
.B lvcreate \-\-type raid10 \-L 5G \-i 2 \-m 1 \-n mylv vg00
|
||||
|
||||
Create a 1TiB thin LV, first creating a new thin pool for it, where
|
||||
the thin pool has 100MiB of space, uses 2 stripes, has a 64KiB stripe
|
||||
size, and 256KiB chunk size.
|
||||
.br
|
||||
.B lvcreate \-\-type thin \-\-name mylv \-\-thinpool mypool
|
||||
.RS
|
||||
.B \-V 1t \-L 100m \-i 2 \-I 64 \-c 256 vg00
|
||||
.RE
|
||||
|
||||
Create a thin snapshot of a thin LV (the size option must not be
|
||||
used, otherwise a copy-on-write snapshot would be created).
|
||||
.br
|
||||
.B lvcreate \-\-snapshot \-\-name mysnap vg00/thinvol
|
||||
|
||||
Create a thin snapshot of the read-only inactive LV named "origin"
|
||||
which becomes an external origin for the thin snapshot LV.
|
||||
.br
|
||||
.B lvcreate \-\-snapshot \-\-name mysnap \-\-thinpool mypool vg00/origin
|
||||
|
||||
Create a cache pool from a fast physical device. The cache pool can
|
||||
then be used to cache an LV.
|
||||
.br
|
||||
.B lvcreate \-\-type cache-pool \-L 1G \-n my_cpool vg00 /dev/fast1
|
||||
|
||||
Create a cache LV, first creating a new origin LV on a slow physical device,
|
||||
then combining the new origin LV with an existing cache pool.
|
||||
.br
|
||||
.B lvcreate \-\-type cache \-\-cachepool my_cpool
|
||||
.RS
|
||||
.B \-L 100G \-n mylv vg00 /dev/slow1
|
||||
.RE
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
lvdisplay shows the attributes of LVs, like size, read/write status,
|
||||
snapshot information, etc.
|
||||
|
||||
\fBlvs\fP(8) is a preferred alternative that shows the same information
|
||||
and more, using a more compact and configurable output format.
|
||||
@@ -1,5 +0,0 @@
|
||||
lvextend extends the size of an LV. This requires allocating logical
|
||||
extents from the VG's free physical extents. A copy\-on\-write snapshot LV
|
||||
can also be extended to provide more space to hold COW blocks. Use
|
||||
\fBlvconvert\fP(8) to change the number of data images in a RAID or
|
||||
mirrored LV.
|
||||
@@ -1,16 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Extend the size of an LV by 54MiB, using a specific PV.
|
||||
.br
|
||||
.B lvextend \-L +54 vg01/lvol10 /dev/sdk3
|
||||
|
||||
Extend the size of an LV by the amount of free
|
||||
space on PV /dev/sdk3. This is equivalent to specifying
|
||||
"\-l +100%PVS" on the command line.
|
||||
.br
|
||||
.B lvextend vg01/lvol01 /dev/sdk3
|
||||
|
||||
Extend an LV by 16MiB using specific physical extents.
|
||||
.br
|
||||
.B lvextend \-L+16m vg01/lvol01 /dev/sda:8\-9 /dev/sdb:8\-9
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
This command is the same as \fBlvmconfig\fP(8).
|
||||
|
||||
lvm config produces formatted output from the LVM configuration tree. The
|
||||
sources of the configuration data include \fBlvm.conf\fP(5) and command
|
||||
line settings from \-\-config.
|
||||
@@ -1,5 +0,0 @@
|
||||
This command is the same as \fBlvmconfig\fP(8).
|
||||
|
||||
lvm dumpconfig produces formatted output from the LVM configuration tree. The
|
||||
sources of the configuration data include \fBlvm.conf\fP(5) and command
|
||||
line settings from \-\-config.
|
||||
@@ -1,6 +0,0 @@
|
||||
lvm fullreport produces formatted output about PVs, PV segments, VGs, LVs
|
||||
and LV segments. The information is all gathered together for each VG
|
||||
(under a per-VG lock) so it is consistent. Information gathered from
|
||||
separate calls to \fBvgs\fP, \fBpvs\fP, and \fBlvs\fP can be inconsistent
|
||||
if information changes between commands.
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
lvm lvpoll is an internal command used by \fBlvmpolld\fP(8) to monitor and
|
||||
complete \fBlvconvert\fP(8) and \fBpvmove\fP(8) operations. lvpoll itself
|
||||
does not initiate these operations and should not normally need to be run
|
||||
directly.
|
||||
@@ -1,33 +0,0 @@
|
||||
.SH NOTES
|
||||
|
||||
To find the name of the pvmove LV that was created by an original
|
||||
\fBpvmove /dev/name\fP command, use the command:
|
||||
.br
|
||||
\fBlvs -a -S move_pv=/dev/name\fP.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Continue polling a pvmove operation.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation pvmove vg00/pvmove0
|
||||
|
||||
Abort a pvmove operation.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation pvmove --abort vg00/pvmove0
|
||||
|
||||
Continue polling a mirror conversion.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation convert vg00/lvmirror
|
||||
|
||||
Continue mirror repair.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation convert vg/damaged_mirror --handlemissingpvs
|
||||
|
||||
Continue snapshot merge.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation merge vg/snapshot_old
|
||||
|
||||
Continue thin snapshot merge.
|
||||
.br
|
||||
.B lvm lvpoll --polloperation merge_thin vg/thin_snapshot
|
||||
|
||||
108
man/lvm.8.in
108
man/lvm.8.in
@@ -484,70 +484,48 @@ directly.
|
||||
.SH SEE ALSO
|
||||
.
|
||||
.nh
|
||||
.BR lvm (8)
|
||||
.BR lvm.conf (5)
|
||||
.BR lvmconfig (8)
|
||||
|
||||
.BR pvchange (8)
|
||||
.BR pvck (8)
|
||||
.BR pvcreate (8)
|
||||
.BR pvdisplay (8)
|
||||
.BR pvmove (8)
|
||||
.BR pvremove (8)
|
||||
.BR pvresize (8)
|
||||
.BR pvs (8)
|
||||
.BR pvscan (8)
|
||||
|
||||
.BR vgcfgbackup (8)
|
||||
.BR vgcfgrestore (8)
|
||||
.BR vgchange (8)
|
||||
.BR vgck (8)
|
||||
.BR vgcreate (8)
|
||||
.BR vgconvert (8)
|
||||
.BR vgdisplay (8)
|
||||
.BR vgexport (8)
|
||||
.BR vgextend (8)
|
||||
.BR vgimport (8)
|
||||
.BR vgimportclone (8)
|
||||
.BR vgmerge (8)
|
||||
.BR vgmknodes (8)
|
||||
.BR vgreduce (8)
|
||||
.BR vgremove (8)
|
||||
.BR vgrename (8)
|
||||
.BR vgs (8)
|
||||
.BR vgscan (8)
|
||||
.BR vgsplit (8)
|
||||
|
||||
.BR lvcreate (8)
|
||||
.BR lvchange (8)
|
||||
.BR lvconvert (8)
|
||||
.BR lvdisplay (8)
|
||||
.BR lvextend (8)
|
||||
.BR lvreduce (8)
|
||||
.BR lvremove (8)
|
||||
.BR lvrename (8)
|
||||
.BR lvresize (8)
|
||||
.BR lvs (8)
|
||||
.BR lvscan (8)
|
||||
|
||||
.BR lvm2-activation-generator (8)
|
||||
.BR blkdeactivate (8)
|
||||
.BR lvmdump (8)
|
||||
|
||||
.BR dmeventd (8)
|
||||
.BR lvmetad (8)
|
||||
.BR lvmpolld (8)
|
||||
.BR lvmlockd (8)
|
||||
.BR lvmlockctl (8)
|
||||
.BR clvmd (8)
|
||||
.BR cmirrord (8)
|
||||
.BR lvmdbusd (8)
|
||||
|
||||
.BR lvmsystemid (7)
|
||||
.BR lvmreport (7)
|
||||
.BR lvmraid (7)
|
||||
.BR lvmthin (7)
|
||||
.BR lvmcache (7)
|
||||
|
||||
.BR lvm.conf (5),
|
||||
.BR lvmcache (7),
|
||||
.BR lvmreport(7),
|
||||
.BR lvmthin (7),
|
||||
.BR clvmd (8),
|
||||
.BR dmsetup (8),
|
||||
.BR lvchange (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvdisplay (8),
|
||||
.BR lvextend (8),
|
||||
.BR lvmchange (8),
|
||||
.BR lvmconfig (8),
|
||||
.BR lvmdiskscan (8),
|
||||
.BR lvreduce (8),
|
||||
.BR lvremove (8),
|
||||
.BR lvrename (8),
|
||||
.BR lvresize (8),
|
||||
.BR lvs (8),
|
||||
.BR lvscan (8),
|
||||
.BR pvchange (8),
|
||||
.BR pvck (8),
|
||||
.BR pvcreate (8),
|
||||
.BR pvdisplay (8),
|
||||
.BR pvmove (8),
|
||||
.BR pvremove (8),
|
||||
.BR pvs (8),
|
||||
.BR pvscan (8),
|
||||
.BR vgcfgbackup (8),
|
||||
.BR vgchange (8),
|
||||
.BR vgck (8),
|
||||
.BR vgconvert (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgdisplay (8),
|
||||
.BR vgextend (8),
|
||||
.BR vgimport (8),
|
||||
.BR vgimportclone (8),
|
||||
.BR vgmerge (8),
|
||||
.BR vgmknodes (8),
|
||||
.BR vgreduce (8),
|
||||
.BR vgremove (8),
|
||||
.BR vgrename (8),
|
||||
.BR vgs (8),
|
||||
.BR vgscan (8),
|
||||
.BR vgsplit (8),
|
||||
.BR readline (3)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
lvmconfig produces formatted output from the LVM configuration tree. The
|
||||
sources of the configuration data include \fBlvm.conf\fP(5) and command
|
||||
line settings from \-\-config.
|
||||
@@ -1,7 +0,0 @@
|
||||
lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of
|
||||
other block devices in the system looking for LVM PVs. The size reported
|
||||
is the real device size. Define a filter in \fBlvm.conf\fP(5) to restrict
|
||||
the scan to avoid a CD ROM, for example.
|
||||
|
||||
This command is deprecated, use \fBpvs\fP instead.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
lvmsadc is not currently supported in LVM. The device-mapper statistics
|
||||
facility provides similar performance metrics using the \fBdmstats(8)\fP
|
||||
command.
|
||||
@@ -1,3 +0,0 @@
|
||||
lvmsar is not currently supported in LVM. The device-mapper statistics
|
||||
facility provides similar performance metrics using the \fBdmstats(8)\fP
|
||||
command.
|
||||
@@ -278,6 +278,22 @@ or vgchange to activate thin snapshots with the "k" attribute.
|
||||
|
||||
\&
|
||||
|
||||
.SS Alternate syntax for specifying type thin\-pool
|
||||
|
||||
\&
|
||||
|
||||
The fully specified syntax for creating a thin pool LV shown above is:
|
||||
|
||||
.B lvconvert \-\-type thin-pool \-\-poolmetadata VG/ThinMetaLV VG/ThinDataLV
|
||||
|
||||
An alternate syntax may be used for the same operation:
|
||||
|
||||
.B lvconvert \-\-thinpool VG/ThinDataLV \-\-poolmetadata VG/ThinMetaLV
|
||||
|
||||
The thin-pool type is inferred by lvm; the \-\-thinpool option is not an
|
||||
alias for \-\-type thin\-pool.
|
||||
|
||||
|
||||
.SS Automatic pool metadata LV
|
||||
|
||||
\&
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
lvreduce reduces the size of an LV. The freed logical extents are returned
|
||||
to the VG to be used by other LVs. A copy\-on\-write snapshot LV can also
|
||||
be reduced if less space is needed to hold COW blocks. Use
|
||||
\fBlvconvert\fP(8) to change the number of data images in a RAID or
|
||||
mirrored LV.
|
||||
|
||||
Be careful when reducing an LV's size, because data in the reduced area is
|
||||
lost. Ensure that any file system on the LV is resized \fBbefore\fP
|
||||
running lvreduce so that the removed extents are not in use by the file
|
||||
system.
|
||||
|
||||
Sizes will be rounded if necessary. For example, the LV size must be an
|
||||
exact number of extents, and the size of a striped segment must be a
|
||||
multiple of the number of stripes.
|
||||
@@ -1,5 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Reduce the size of an LV by 3 logical extents:
|
||||
.br
|
||||
.B lvreduce \-l \-3 vg00/lvol1
|
||||
@@ -1,27 +0,0 @@
|
||||
lvremove removes one or more LVs. For standard LVs, this returns the
|
||||
logical extents that were used by the LV to the VG for use by other LVs.
|
||||
|
||||
Confirmation will be requested before deactivating any active LV prior to
|
||||
removal. LVs cannot be deactivated or removed while they are open (e.g.
|
||||
if they contain a mounted filesystem). Removing an origin LV will also
|
||||
remove all dependent snapshots.
|
||||
|
||||
When a single force option is used, LVs are removed without confirmation,
|
||||
and the command will try to deactivate unused LVs.
|
||||
|
||||
To remove damaged LVs, two force options may be required (\fB-ff\fP).
|
||||
|
||||
\fBHistorical LVs\fP
|
||||
|
||||
If the configuration setting \fBmetadata/record_lvs_history\fP is enabled
|
||||
and the LV being removed forms part of the history of at least one LV that
|
||||
is still present, then a simplified representation of the LV will be
|
||||
retained. This includes the time of removal (\fBlv_time_removed\fP
|
||||
reporting field), creation time (\fBlv_time\fP), name (\fBlv_name\fP), LV
|
||||
uuid (\fBlv_uuid\fP) and VG name (\fBvg_name\fP). This allows later
|
||||
reporting to see the ancestry chain of thin snapshot volumes, even after
|
||||
some intermediate LVs have been removed. The names of such historical LVs
|
||||
acquire a hyphen as a prefix (e.g. '-lvol1') and cannot be reactivated.
|
||||
Use lvremove a second time, with the hyphen, to remove the record of the
|
||||
former LV completely.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Remove an active LV without asking for confirmation.
|
||||
.br
|
||||
.B lvremove \-f vg00/lvol1
|
||||
|
||||
Remove all LVs the specified VG.
|
||||
.br
|
||||
.B lvremove vg00
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
lvrename renames an existing LV or a historical LV (see \fBlvremove\fP for
|
||||
historical LV information.)
|
||||
@@ -1,10 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Rename "lvold" to "lvnew":
|
||||
.br
|
||||
.B lvrename /dev/vg02/lvold vg02/lvnew
|
||||
|
||||
An alternate syntax to rename "lvold" to "lvnew":
|
||||
.br
|
||||
.B lvrename vg02 lvold lvnew
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
lvresize resizes an LV in the same way as lvextend and lvreduce. See
|
||||
\fBlvextend\fP(8) and \fBlvreduce\fP(8) for more information.
|
||||
@@ -1,6 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Extend an LV by 16MB using specific physical extents:
|
||||
.br
|
||||
.B lvresize \-L+16M vg1/lv1 /dev/sda:0\-1 /dev/sdb:0\-1
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
lvs produces formatted output about LVs.
|
||||
@@ -1,5 +0,0 @@
|
||||
lvscan scans all VGs or all supported LVM block devices in the system for
|
||||
LVs. The output consists of one line for each LV indicating whether or not
|
||||
it is active, a snapshot or origin, the size of the device and its
|
||||
allocation policy. Use \fBlvs\fP(8) or \fBlvdisplay\fP(8) to obtain more
|
||||
comprehensive information about LVs.
|
||||
@@ -1 +0,0 @@
|
||||
pvchange changes PV attributes in the VG.
|
||||
@@ -1,6 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Disallow the allocation of physical extents on a PV (e.g. because of
|
||||
disk errors, or because it will be removed after freeing it).
|
||||
.br
|
||||
.B pvchange \-x n /dev/sdk1
|
||||
@@ -1 +0,0 @@
|
||||
pvck checks the LVM metadata for consistency on PVs.
|
||||
@@ -1,8 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
If the partition table is corrupted or lost on /dev/sda, and you suspect
|
||||
there was an LVM partition at approximately 100 MiB, then this
|
||||
area of the disk can be scanned using the \fB\-\-labelsector\fP
|
||||
parameter with a value of 204800 (100 * 1024 * 1024 / 512 = 204800).
|
||||
.br
|
||||
.B pvck \-\-labelsector 204800 /dev/sda
|
||||
@@ -1,21 +0,0 @@
|
||||
pvcreate initializes a PV so that it is recognized as belonging to LVM,
|
||||
and allows the PV to be used in a VG. A PV can be a disk partition, whole
|
||||
disk, meta device, or loopback file.
|
||||
|
||||
For DOS disk partitions, the partition id should be set to 0x8e using
|
||||
.BR fdisk (8),
|
||||
.BR cfdisk (8),
|
||||
or a equivalent. For GUID Partition Table (GPT), the id is
|
||||
E6D6D379-F507-44C2-A23C-238F2A3DF928. For
|
||||
whole disk devices only
|
||||
the partition table must be erased, which will effectively destroy all
|
||||
data on that disk. This can be done by zeroing the first sector with:
|
||||
|
||||
.BI "dd if=/dev/zero of=" PhysicalVolume " bs=512 count=1"
|
||||
|
||||
Use \fBvgcreate\fP(8) to create a new VG on the PV, or \fBvgextend\fP(8)
|
||||
to add the PV to existing VG.
|
||||
|
||||
The force option will create a PV without confirmation. Repeating the
|
||||
force option (\fB-ff\fP) will forcibly create a PV, overriding checks that
|
||||
normally prevent it, e.g. if the PV is already in a VG.
|
||||
@@ -1,13 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Initialize a partition and a full device.
|
||||
.br
|
||||
.B pvcreate /dev/sdc4 /dev/sde
|
||||
|
||||
If a device is a 4KiB sector drive that compensates for windows
|
||||
partitioning (sector 7 is the lowest aligned logical block, the 4KiB
|
||||
sectors start at LBA -1, and consequently sector 63 is aligned on a 4KiB
|
||||
boundary) manually account for this when initializing for use by LVM.
|
||||
.br
|
||||
.B pvcreate \-\-dataalignmentoffset 7s /dev/sdb
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
pvdisplay shows the attributes of PVs, like size, physical extent size,
|
||||
space used for the VG descriptor area, etc.
|
||||
|
||||
\fBpvs\fP(8) is a preferred alternative that shows the same information
|
||||
and more, using a more compact and configurable output format.
|
||||
@@ -1,16 +0,0 @@
|
||||
pvmove moves the allocated physical extents (PEs) on a source PV to one or
|
||||
more destination PVs. You can optionally specify a source LV in which
|
||||
case only extents used by that LV will be moved to free (or specified)
|
||||
extents on the destination PV. If no destination PV is specified, the
|
||||
normal allocation rules for the VG are used.
|
||||
|
||||
If pvmove is interrupted for any reason (e.g. the machine crashes) then
|
||||
run pvmove again without any PV arguments to restart any operations that
|
||||
were in progress from the last checkpoint. Alternatively, use the abort
|
||||
option at any time to abort the operation. The resulting location of LVs
|
||||
after an abort depends on whether the atomic option was used.
|
||||
|
||||
More than one pvmove can run concurrently if they are moving data from
|
||||
different source PVs, but additional pvmoves will ignore any LVs already
|
||||
in the process of being changed, so some data might not get moved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.SH NOTES
|
||||
|
||||
pvmove works as follows:
|
||||
.
|
||||
\fBpvmove\fP works as follows:
|
||||
|
||||
1. A temporary 'pvmove' LV is created to store details of all the data
|
||||
movements required.
|
||||
@@ -9,7 +9,7 @@ movements required.
|
||||
according to the command line arguments.
|
||||
For each piece of data found, a new segment is added to the end of the
|
||||
pvmove LV.
|
||||
This segment takes the form of a temporary mirror to copy the data
|
||||
This segment takes the form of a temporary mirror to copy the data
|
||||
from the original location to a newly allocated location.
|
||||
The original LV is updated to use the new temporary mirror segment
|
||||
in the pvmove LV instead of accessing the data directly.
|
||||
@@ -45,49 +45,3 @@ LVs are removed, leaving behind the segments on the destination PV. If an
|
||||
abort is issued during the move, all LVs being moved will remain on the
|
||||
source PV.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Move all physical extents that are used by simple LVs on the specified PV to
|
||||
free physical extents elsewhere in the VG.
|
||||
.br
|
||||
.B pvmove /dev/sdb1
|
||||
|
||||
Use a specific destination PV when moving physical extents.
|
||||
.br
|
||||
.B pvmove /dev/sdb1 /dev/sdc1
|
||||
|
||||
Move extents belonging to a single LV.
|
||||
.br
|
||||
.B pvmove \-n lvol1 /dev/sdb1 /dev/sdc1
|
||||
|
||||
Rather than moving the contents of an entire device, it is possible to
|
||||
move a range of physical extents, for example numbers 1000 to 1999
|
||||
inclusive on the specified PV.
|
||||
.br
|
||||
.B pvmove /dev/sdb1:1000\-1999
|
||||
|
||||
A range of physical extents to move can be specified as start+length. For
|
||||
example, starting from PE 1000. (Counting starts from 0, so this refers to the
|
||||
1001st to the 2000th PE inclusive.)
|
||||
.br
|
||||
.B pvmove /dev/sdb1:1000+1000
|
||||
|
||||
Move a range of physical extents to a specific PV (which must have
|
||||
sufficient free extents).
|
||||
.br
|
||||
.B pvmove /dev/sdb1:1000\-1999 /dev/sdc1
|
||||
|
||||
Move a range of physical extents to specific new extents on a new PV.
|
||||
.br
|
||||
.B pvmove /dev/sdb1:1000\-1999 /dev/sdc1:0\-999
|
||||
|
||||
If the source and destination are on the same disk, the
|
||||
\fBanywhere\fP allocation policy is needed.
|
||||
.br
|
||||
.B pvmove \-\-alloc anywhere /dev/sdb1:1000\-1999 /dev/sdb1:0\-999
|
||||
|
||||
The part of a specific LV present within in a range of physical
|
||||
extents can also be picked out and moved.
|
||||
.br
|
||||
.B pvmove \-n lvol1 /dev/sdb1:1000\-1999 /dev/sdc1
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
pvremove wipes the label on a device so that LVM will no longer recognise
|
||||
it as a PV.
|
||||
|
||||
A PV cannot be removed from a VG while it is used by an active LV.
|
||||
|
||||
Repeat the force option (\fB-ff\fP) to forcibly remove a PV belonging to
|
||||
an existing VG. Normally, \fBvgreduce\fP(8) should be used instead.
|
||||
@@ -1,2 +0,0 @@
|
||||
pvresize resizes a PV. The PV may already be in a VG and may have active
|
||||
LVs allocated on it.
|
||||
@@ -1,16 +0,0 @@
|
||||
.SH NOTES
|
||||
|
||||
pvresize will refuse to shrink a PV if it has allocated extents beyond the
|
||||
new end.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Expand a PV after enlarging the partition.
|
||||
.br
|
||||
.B pvresize /dev/sda1
|
||||
|
||||
Shrink a PV prior to shrinking the partition (ensure that the PV size is
|
||||
appropriate for the intended new partition size).
|
||||
.br
|
||||
.B pvresize \-\-setphysicalvolumesize 40G /dev/sda1
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
pvs produces formatted output about PVs.
|
||||
@@ -1,6 +1,6 @@
|
||||
pvscan scans all supported LVM block devices in the system for PVs.
|
||||
.SH NOTES
|
||||
|
||||
\fBScanning with lvmetad\fP
|
||||
.SS Scanning with lvmetad
|
||||
|
||||
pvscan operates differently when used with the
|
||||
.BR lvmetad (8)
|
||||
@@ -64,9 +64,7 @@ be temporarily disabled if they are seen.
|
||||
To notify lvmetad about a device that is no longer present, the major and
|
||||
minor numbers must be given, not the path.
|
||||
|
||||
.P
|
||||
|
||||
\fBAutomatic activation\fP
|
||||
.SS Automatic activation
|
||||
|
||||
When event-driven system services detect a new LVM device, the first step
|
||||
is to automatically scan and cache the metadata from the device. This is
|
||||
@@ -1,67 +0,0 @@
|
||||
.SH SEE ALSO
|
||||
|
||||
.BR lvm (8)
|
||||
.BR lvm.conf (5)
|
||||
.BR lvmconfig (8)
|
||||
|
||||
.BR pvchange (8)
|
||||
.BR pvck (8)
|
||||
.BR pvcreate (8)
|
||||
.BR pvdisplay (8)
|
||||
.BR pvmove (8)
|
||||
.BR pvremove (8)
|
||||
.BR pvresize (8)
|
||||
.BR pvs (8)
|
||||
.BR pvscan (8)
|
||||
|
||||
.BR vgcfgbackup (8)
|
||||
.BR vgcfgrestore (8)
|
||||
.BR vgchange (8)
|
||||
.BR vgck (8)
|
||||
.BR vgcreate (8)
|
||||
.BR vgconvert (8)
|
||||
.BR vgdisplay (8)
|
||||
.BR vgexport (8)
|
||||
.BR vgextend (8)
|
||||
.BR vgimport (8)
|
||||
.BR vgimportclone (8)
|
||||
.BR vgmerge (8)
|
||||
.BR vgmknodes (8)
|
||||
.BR vgreduce (8)
|
||||
.BR vgremove (8)
|
||||
.BR vgrename (8)
|
||||
.BR vgs (8)
|
||||
.BR vgscan (8)
|
||||
.BR vgsplit (8)
|
||||
|
||||
.BR lvcreate (8)
|
||||
.BR lvchange (8)
|
||||
.BR lvconvert (8)
|
||||
.BR lvdisplay (8)
|
||||
.BR lvextend (8)
|
||||
.BR lvreduce (8)
|
||||
.BR lvremove (8)
|
||||
.BR lvrename (8)
|
||||
.BR lvresize (8)
|
||||
.BR lvs (8)
|
||||
.BR lvscan (8)
|
||||
|
||||
.BR lvm2-activation-generator (8)
|
||||
.BR blkdeactivate (8)
|
||||
.BR lvmdump (8)
|
||||
|
||||
.BR dmeventd (8)
|
||||
.BR lvmetad (8)
|
||||
.BR lvmpolld (8)
|
||||
.BR lvmlockd (8)
|
||||
.BR lvmlockctl (8)
|
||||
.BR clvmd (8)
|
||||
.BR cmirrord (8)
|
||||
.BR lvmdbusd (8)
|
||||
|
||||
.BR lvmsystemid (7)
|
||||
.BR lvmreport (7)
|
||||
.BR lvmraid (7)
|
||||
.BR lvmthin (7)
|
||||
.BR lvmcache (7)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
vgcfgbackup creates back up files containing metadata of VGs.
|
||||
If no VGs are named, back up files are created for all VGs.
|
||||
See \fBvgcfgrestore\fP for information on using the back up
|
||||
files.
|
||||
|
||||
In a default installation, each VG is backed up into a separate file
|
||||
bearing the name of the VG in the directory \fI#DEFAULT_BACKUP_DIR#\fP.
|
||||
|
||||
To use an alternative back up file, use \fB\-f\fP. In this case, when
|
||||
backing up multiple VGs, the file name is treated as a template, with %s
|
||||
replaced by the VG name.
|
||||
|
||||
NB. This DOES NOT back up the data content of LVs.
|
||||
|
||||
It may also be useful to regularly back up the files in
|
||||
\fI#DEFAULT_SYS_DIR#\fP.
|
||||
@@ -1,11 +0,0 @@
|
||||
vgcfgrestore restores the metadata of a VG from a text back up file
|
||||
produced by \fBvgcfgbackup\fP. This writes VG metadata onto the devices
|
||||
specifed in back up file.
|
||||
|
||||
A back up file can be specified with \fB\-\-file\fP. If no backup file is
|
||||
specified, the most recent one is used. Use \fB\-\-list\fP for a list of
|
||||
the available back up and archive files of a VG.
|
||||
|
||||
WARNING: When a VG contains thin pools, changes to thin metadata cannot be
|
||||
reverted, and data loss may occur if thin metadata has changed. The force
|
||||
option is required to restore in this case.
|
||||
@@ -1,9 +0,0 @@
|
||||
.SH NOTES
|
||||
|
||||
To replace PVs, \fBvgdisplay \-\-partial \-\-verbose\fP will show the
|
||||
UUIDs and sizes of any PVs that are no longer present. If a PV in the VG
|
||||
is lost and you wish to substitute another of the same size, use
|
||||
\fBpvcreate \-\-restorefile filename \-\-uuid uuid\fP (plus additional
|
||||
arguments as appropriate) to initialise it with the same UUID as the
|
||||
missing PV. Repeat for all other missing PVs in the VG. Then use
|
||||
\fBvgcfgrestore \-\-file filename\fP to restore the VG's metadata.
|
||||
@@ -1,2 +0,0 @@
|
||||
vgchange changes VG attributes, changes LV activation in the kernel, and
|
||||
includes other utilities for VG maintenance.
|
||||
@@ -1,16 +0,0 @@
|
||||
.SH NOTES
|
||||
|
||||
If vgchange recognizes COW snapshot LVs that were dropped because they ran
|
||||
out of space, it displays a message informing the administrator that the
|
||||
snapshots should be removed.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Activate all LVs in all VGs on all existing devices.
|
||||
.br
|
||||
.B vgchange \-a y
|
||||
|
||||
Change the maximum number of LVs for an inactive VG.
|
||||
.br
|
||||
.B vgchange \-l 128 vg00
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
vgck checks LVM metadata for consistency.
|
||||
@@ -1,7 +0,0 @@
|
||||
vgconvert converts VG metadata from one format to another. The new
|
||||
metadata format must be able to fit into the space provided by the old
|
||||
format.
|
||||
|
||||
Because the LVM1 format should no longer be used, this command is no
|
||||
longer needed in general.
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
vgcreate creates a new VG on block devices. If the devices were not
|
||||
previously intialized as PVs with \fBpvcreate\fP(8), vgcreate will
|
||||
inititialize them, making them PVs. The pvcreate options for initializing
|
||||
devices are also available with vgcreate.
|
||||
@@ -1,6 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Create a VG with two PVs, using the default physical extent size.
|
||||
.br
|
||||
.B vgcreate myvg /dev/sdk1 /dev/sdl1
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
vgdisplay shows the attributes of VGs, and the associated PVs and LVs.
|
||||
|
||||
\fBvgs\fP(8) is a preferred alternative that shows the same information
|
||||
and more, using a more compact and configurable output format.
|
||||
@@ -1,8 +1,14 @@
|
||||
vgexport makes inactive VGs unknown to the system. In this state, all the
|
||||
PVs in the VG can be moved to a different system, from which
|
||||
.SH NOTES
|
||||
.
|
||||
.IP \[bu] 3
|
||||
vgexport can make inactive VG(s) unknown to the system. In this state,
|
||||
all the PVs in the VG can be moved to a different system, from which
|
||||
\fBvgimport\fP can then be run.
|
||||
|
||||
.IP \[bu] 3
|
||||
Most LVM tools ignore exported VGs.
|
||||
|
||||
.IP \[bu] 3
|
||||
vgexport clears the VG system ID, and vgimport sets the VG system ID to
|
||||
match the host running vgimport (if the host has a system ID).
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
vgextend adds one or more PVs to a VG. This increases the space available
|
||||
for LVs in the VG.
|
||||
|
||||
Also, PVs that have gone missing and then returned, e.g. due to a
|
||||
transient device failure, can be added back to the VG without
|
||||
re-initializing them (see \-\-restoremissing).
|
||||
|
||||
If the specified PVs have not yet been initialized with pvcreate, vgextend
|
||||
will initialize them. In this case pvcreate options can be used, e.g.
|
||||
\-\-labelsector, \-\-metadatasize, \-\-metadataignore,
|
||||
\-\-pvmetadatacopies, \-\-dataalignment, \-\-dataalignmentoffset.
|
||||
@@ -1,6 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
Add two PVs to a VG.
|
||||
.br
|
||||
.B vgextend vg00 /dev/sda4 /dev/sdn1
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
vgimport makes exported VGs known to the system again, perhaps after
|
||||
moving the PVs from a different system.
|
||||
|
||||
vgexport clears the VG system ID, and vgimport sets the VG system ID to
|
||||
match the host running vgimport (if the host has a system ID).
|
||||
9
man/vgimport.8.notes
Normal file
9
man/vgimport.8.notes
Normal file
@@ -0,0 +1,9 @@
|
||||
.SH NOTES
|
||||
.
|
||||
.IP \[bu] 3
|
||||
vgimport makes exported VG(s) known to the system again, perhaps
|
||||
after moving the PVs from a different system.
|
||||
|
||||
.IP \[bu] 3
|
||||
vgexport clears the VG system ID, and vgimport sets the VG system ID
|
||||
to match the host running vgimport (if the host has a system ID).
|
||||
@@ -1,6 +0,0 @@
|
||||
vgimportclone imports a VG from duplicated PVs, e.g. created by a hardware
|
||||
snapshot of existing PVs.
|
||||
|
||||
A duplicated VG cannot used until it is made to coexist with the original
|
||||
VG. vgimportclone renames the VG associated with the specified PVs and
|
||||
changes the associated VG and PV UUIDs.
|
||||
@@ -1,9 +0,0 @@
|
||||
.SH EXAMPLES
|
||||
|
||||
An original VG "vg00" has PVs "/dev/sda" and "/dev/sdb".
|
||||
The corresponding PVs from a hardware snapshot are "/dev/sdc" and "/dev/sdd".
|
||||
Rename the VG associated with "/dev/sdc" and "/dev/sdd" from "vg00" to "vg00_snap"
|
||||
(and change associated UUIDs).
|
||||
.br
|
||||
.B vgimportclone \-\-basevgname vg00_snap /dev/sdc /dev/sdd
|
||||
|
||||
9
man/vgimportclone.8.notes
Normal file
9
man/vgimportclone.8.notes
Normal file
@@ -0,0 +1,9 @@
|
||||
.SH NOTES
|
||||
.
|
||||
vgimportclone can be used to import a VG from duplicated PVs (e.g. created
|
||||
by a hardware snapshot of the PV devices).
|
||||
|
||||
A duplicated VG cannot used until it is made to coexist with the original
|
||||
VG. vgimportclone renames the VG associated with the specified PVs and
|
||||
changes the associated VG and PV UUIDs.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
vgmerge merges two existing VGs. The inactive source VG is merged into the
|
||||
destination VG if physical extent sizes are equal and PV and LV summaries
|
||||
of both VGs fit into the destination VG's limits.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user