mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-16 23:33:16 +03:00
Compare commits
15 Commits
dev-dct-cm
...
dev-bmr-dm
Author | SHA1 | Date | |
---|---|---|---|
|
0b553fdda7 | ||
|
95cd544477 | ||
|
f0f2083e67 | ||
|
d47b56fa7a | ||
|
b8241dc6d3 | ||
|
05acbfbb15 | ||
|
03b4767893 | ||
|
75de6a52a7 | ||
|
68ec6940e6 | ||
|
55eaabd118 | ||
|
79f31008fa | ||
|
69fe8729f3 | ||
|
46a772fbc4 | ||
|
91c4bd14d0 | ||
|
cfb6ef654d |
@@ -1,5 +1,7 @@
|
||||
Version 2.02.169 -
|
||||
=====================================
|
||||
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.
|
||||
|
42
configure
vendored
42
configure
vendored
@@ -702,6 +702,7 @@ BLKDEACTIVATE
|
||||
FSADM
|
||||
ELDFLAGS
|
||||
DM_LIB_PATCHLEVEL
|
||||
DMFILEMAPD
|
||||
DMEVENTD_PATH
|
||||
DMEVENTD
|
||||
DL_LIBS
|
||||
@@ -737,6 +738,7 @@ CLDNOWHOLEARCHIVE
|
||||
CLDFLAGS
|
||||
CACHE
|
||||
BUILD_NOTIFYDBUS
|
||||
BUILD_DMFILEMAPD
|
||||
BUILD_LOCKDDLM
|
||||
BUILD_LOCKDSANLOCK
|
||||
BUILD_LVMLOCKD
|
||||
@@ -958,6 +960,7 @@ enable_use_lvmetad
|
||||
with_lvmetad_pidfile
|
||||
enable_use_lvmpolld
|
||||
with_lvmpolld_pidfile
|
||||
enable_dmfilemapd
|
||||
enable_notify_dbus
|
||||
enable_blkid_wiping
|
||||
enable_udev_systemd_background_jobs
|
||||
@@ -1692,6 +1695,7 @@ Optional Features:
|
||||
--disable-use-lvmlockd disable usage of LVM lock daemon
|
||||
--disable-use-lvmetad disable usage of LVM Metadata Daemon
|
||||
--disable-use-lvmpolld disable usage of LVM Poll Daemon
|
||||
--enable-dmfilemapd enable the dmstats filemap daemon
|
||||
--enable-notify-dbus enable LVM notification using dbus
|
||||
--disable-blkid_wiping disable libblkid detection of signatures when wiping
|
||||
and use native code instead
|
||||
@@ -11876,6 +11880,21 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
################################################################################
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build dmfilemapd" >&5
|
||||
$as_echo_n "checking whether to build dmfilemapd... " >&6; }
|
||||
# Check whether --enable-dmfilemapd was given.
|
||||
if test "${enable_dmfilemapd+set}" = set; then :
|
||||
enableval=$enable_dmfilemapd; DMFILEMAPD=$enableval
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DMFILEMAPD" >&5
|
||||
$as_echo "$DMFILEMAPD" >&6; }
|
||||
BUILD_DMFILEMAPD=$DMFILEMAPD
|
||||
|
||||
$as_echo "#define DMFILEMAPD 1" >>confdefs.h
|
||||
|
||||
|
||||
################################################################################
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build notifydbus" >&5
|
||||
$as_echo_n "checking whether to build notifydbus... " >&6; }
|
||||
@@ -14925,6 +14944,24 @@ done
|
||||
|
||||
fi
|
||||
|
||||
if test "$DMFILEMAPD" = yes; then
|
||||
for ac_header in sys/inotify.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_inotify_h" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_SYS_INOTIFY_H 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
hard_bailout
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
|
||||
################################################################################
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}modprobe", so it can be a program name with args.
|
||||
@@ -15384,11 +15421,13 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile include/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
|
||||
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile include/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -16096,6 +16135,7 @@ do
|
||||
"daemons/dmeventd/plugins/mirror/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/mirror/Makefile" ;;
|
||||
"daemons/dmeventd/plugins/snapshot/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/snapshot/Makefile" ;;
|
||||
"daemons/dmeventd/plugins/thin/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/thin/Makefile" ;;
|
||||
"daemons/dmfilemapd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmfilemapd/Makefile" ;;
|
||||
"daemons/lvmdbusd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/lvmdbusd/Makefile" ;;
|
||||
"daemons/lvmdbusd/path.py") CONFIG_FILES="$CONFIG_FILES daemons/lvmdbusd/path.py" ;;
|
||||
"daemons/lvmetad/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/lvmetad/Makefile" ;;
|
||||
|
17
configure.in
17
configure.in
@@ -1269,6 +1269,16 @@ fi
|
||||
AC_DEFINE_UNQUOTED(DEFAULT_USE_LVMPOLLD, [$DEFAULT_USE_LVMPOLLD],
|
||||
[Use lvmpolld by default.])
|
||||
|
||||
################################################################################
|
||||
dnl -- Check dmfilemapd
|
||||
AC_MSG_CHECKING(whether to build dmfilemapd)
|
||||
AC_ARG_ENABLE(dmfilemapd, AC_HELP_STRING([--enable-dmfilemapd],
|
||||
[enable the dmstats filemap daemon]),
|
||||
DMFILEMAPD=$enableval)
|
||||
AC_MSG_RESULT($DMFILEMAPD)
|
||||
BUILD_DMFILEMAPD=$DMFILEMAPD
|
||||
AC_DEFINE([DMFILEMAPD], 1, [Define to 1 to enable the device-mapper filemap daemon.])
|
||||
|
||||
################################################################################
|
||||
dnl -- Build notifydbus
|
||||
AC_MSG_CHECKING(whether to build notifydbus)
|
||||
@@ -1853,6 +1863,10 @@ if test "$UDEV_SYNC" = yes; then
|
||||
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,hard_bailout)
|
||||
fi
|
||||
|
||||
if test "$DMFILEMAPD" = yes; then
|
||||
AC_CHECK_HEADERS([sys/inotify.h],,hard_bailout)
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
AC_PATH_TOOL(MODPROBE_CMD, modprobe)
|
||||
|
||||
@@ -1992,6 +2006,7 @@ AC_SUBST(BUILD_LVMPOLLD)
|
||||
AC_SUBST(BUILD_LVMLOCKD)
|
||||
AC_SUBST(BUILD_LOCKDSANLOCK)
|
||||
AC_SUBST(BUILD_LOCKDDLM)
|
||||
AC_SUBST(BUILD_DMFILEMAPD)
|
||||
AC_SUBST(BUILD_NOTIFYDBUS)
|
||||
AC_SUBST(CACHE)
|
||||
AC_SUBST(CFLAGS)
|
||||
@@ -2041,6 +2056,7 @@ AC_SUBST(DLM_LIBS)
|
||||
AC_SUBST(DL_LIBS)
|
||||
AC_SUBST(DMEVENTD)
|
||||
AC_SUBST(DMEVENTD_PATH)
|
||||
AC_SUBST(DMFILEMAPD)
|
||||
AC_SUBST(DM_LIB_PATCHLEVEL)
|
||||
AC_SUBST(ELDFLAGS)
|
||||
AC_SUBST(FSADM)
|
||||
@@ -2156,6 +2172,7 @@ daemons/dmeventd/plugins/raid/Makefile
|
||||
daemons/dmeventd/plugins/mirror/Makefile
|
||||
daemons/dmeventd/plugins/snapshot/Makefile
|
||||
daemons/dmeventd/plugins/thin/Makefile
|
||||
daemons/dmfilemapd/Makefile
|
||||
daemons/lvmdbusd/Makefile
|
||||
daemons/lvmdbusd/path.py
|
||||
daemons/lvmetad/Makefile
|
||||
|
@@ -48,8 +48,12 @@ ifeq ("@BUILD_LVMDBUSD@", "yes")
|
||||
SUBDIRS += lvmdbusd
|
||||
endif
|
||||
|
||||
ifeq ("@BUILD_DMFILEMAPD@", "yes")
|
||||
SUBDIRS += dmfilemapd
|
||||
endif
|
||||
|
||||
ifeq ($(MAKECMDGOALS),distclean)
|
||||
SUBDIRS = clvmd cmirrord dmeventd lvmetad lvmpolld lvmlockd lvmdbusd
|
||||
SUBDIRS = clvmd cmirrord dmeventd lvmetad lvmpolld lvmlockd lvmdbusd dmfilemapd
|
||||
endif
|
||||
|
||||
include $(top_builddir)/make.tmpl
|
||||
|
1
daemons/dmfilemapd/.gitignore
vendored
Normal file
1
daemons/dmfilemapd/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
dmfilemapd
|
69
daemons/dmfilemapd/Makefile.in
Normal file
69
daemons/dmfilemapd/Makefile.in
Normal file
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# Copyright (C) 2016 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This file is part of the device-mapper userspace tools.
|
||||
#
|
||||
# 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
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
SOURCES = dmfilemapd.c
|
||||
|
||||
TARGETS = dmfilemapd
|
||||
|
||||
.PHONY: install_dmeventd install_dmeventd_static
|
||||
|
||||
INSTALL_DMFILEMAPD_TARGETS = install_dmfilemapd_dynamic
|
||||
|
||||
CLEAN_TARGETS = dmfilemapd.static
|
||||
|
||||
CFLOW_LIST = $(SOURCES)
|
||||
CFLOW_LIST_TARGET = $(LIB_NAME).cflow
|
||||
CFLOW_TARGET = dmfilemapd
|
||||
|
||||
include $(top_builddir)/make.tmpl
|
||||
|
||||
all: device-mapper
|
||||
device-mapper: $(TARGETS)
|
||||
|
||||
LIBS += -ldevmapper
|
||||
LVMLIBS += -ldevmapper-event $(PTHREAD_LIBS)
|
||||
|
||||
CFLAGS_dmeventd.o += $(EXTRA_EXEC_CFLAGS)
|
||||
|
||||
dmfilemapd: $(LIB_SHARED) dmfilemapd.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) -L. -o $@ dmfilemapd.o \
|
||||
$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
|
||||
|
||||
dmfilemapd.static: $(LIB_STATIC) dmfilemapd.o $(interfacebuilddir)/libdevmapper.a
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
|
||||
dmfilemapd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
|
||||
|
||||
ifneq ("$(CFLOW_CMD)", "")
|
||||
CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))
|
||||
-include $(top_builddir)/libdm/libdevmapper.cflow
|
||||
-include $(top_builddir)/lib/liblvm-internal.cflow
|
||||
-include $(top_builddir)/lib/liblvm2cmd.cflow
|
||||
-include $(top_builddir)/daemons/dmfilemapd/$(LIB_NAME).cflow
|
||||
endif
|
||||
|
||||
install_dmfilemapd_dynamic: dmfilemapd
|
||||
$(INSTALL_PROGRAM) -D $< $(sbindir)/$(<F)
|
||||
|
||||
install_dmfilemapd_static: dmfilemapd.static
|
||||
$(INSTALL_PROGRAM) -D $< $(staticdir)/$(<F)
|
||||
|
||||
install_dmfilemapd: $(INSTALL_DMEVENTD_TARGETS)
|
||||
|
||||
install: install_dmfilemapd
|
||||
|
||||
install_device-mapper: install_dmfilemapd
|
||||
|
764
daemons/dmfilemapd/dmfilemapd.c
Normal file
764
daemons/dmfilemapd/dmfilemapd.c
Normal file
@@ -0,0 +1,764 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of the device-mapper userspace tools.
|
||||
*
|
||||
* It includes tree drawing code based on pstree: http://psmisc.sourceforge.net/
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
* of the GNU General Public License v.2.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "tool.h"
|
||||
|
||||
#include "dm-logging.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/inotify.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef __linux__
|
||||
# include "kdev_t.h"
|
||||
#else
|
||||
# define MAJOR(x) major((x))
|
||||
# define MINOR(x) minor((x))
|
||||
# define MKDEV(x,y) makedev((x),(y))
|
||||
#endif
|
||||
|
||||
/* limit to two updates/sec */
|
||||
#define FILEMAPD_WAIT_USECS 500000
|
||||
|
||||
/* how long to wait for unlinked files */
|
||||
#define FILEMAPD_NOFILE_WAIT_USECS 100000
|
||||
#define FILEMAPD_NOFILE_WAIT_TRIES 10
|
||||
|
||||
struct filemap_monitor {
|
||||
dm_filemapd_mode_t mode;
|
||||
/* group_id to update */
|
||||
uint64_t group_id;
|
||||
char *path;
|
||||
int inotify_fd;
|
||||
int inotify_watch_fd;
|
||||
/* file to monitor */
|
||||
int fd;
|
||||
|
||||
/* monitoring heuristics */
|
||||
int64_t blocks; /* allocated blocks, from stat.st_blocks */
|
||||
int64_t nr_regions;
|
||||
int deleted;
|
||||
};
|
||||
|
||||
static int _foreground;
|
||||
static int _verbose;
|
||||
|
||||
const char *const _usage = "dmfilemapd <fd> <group_id> <path> <mode> "
|
||||
"[<foreground>[<log_level>]]";
|
||||
|
||||
/*
|
||||
* Daemon logging. By default, all messages are thrown away: messages
|
||||
* are only written to the terminal if the daemon is run in the foreground.
|
||||
*/
|
||||
__attribute__((format(printf, 5, 0)))
|
||||
static void _dmfilemapd_log_line(int level,
|
||||
const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)),
|
||||
int dm_errno_or_class,
|
||||
const char *f, va_list ap)
|
||||
{
|
||||
static int _abort_on_internal_errors = -1;
|
||||
FILE *out = log_stderr(level) ? stderr : stdout;
|
||||
|
||||
level = log_level(level);
|
||||
|
||||
if (level <= _LOG_WARN || _verbose) {
|
||||
if (level < _LOG_WARN)
|
||||
out = stderr;
|
||||
vfprintf(out, f, ap);
|
||||
fputc('\n', out);
|
||||
}
|
||||
|
||||
if (_abort_on_internal_errors < 0)
|
||||
/* Set when env DM_ABORT_ON_INTERNAL_ERRORS is not "0" */
|
||||
_abort_on_internal_errors =
|
||||
strcmp(getenv("DM_ABORT_ON_INTERNAL_ERRORS") ? : "0", "0");
|
||||
|
||||
if (_abort_on_internal_errors &&
|
||||
!strncmp(f, INTERNAL_ERROR, sizeof(INTERNAL_ERROR) - 1))
|
||||
abort();
|
||||
}
|
||||
|
||||
__attribute__((format(printf, 5, 6)))
|
||||
static void _dmfilemapd_log_with_errno(int level,
|
||||
const char *file, int line,
|
||||
int dm_errno_or_class,
|
||||
const char *f, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, f);
|
||||
_dmfilemapd_log_line(level, file, line, dm_errno_or_class, f, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only used for reporting errors before daemonise().
|
||||
*/
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void _early_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fputc('\n', stderr);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static void _setup_logging(void)
|
||||
{
|
||||
dm_log_init_verbose(_verbose - 1);
|
||||
dm_log_with_errno_init(_dmfilemapd_log_with_errno);
|
||||
}
|
||||
|
||||
#define PROC_FD_DELETED_STR " (deleted)"
|
||||
/*
|
||||
* Scan the /proc/<pid>/fd directory for pid and check for an fd
|
||||
* symlink whose contents match path.
|
||||
*/
|
||||
static int _is_open_in_pid(pid_t pid, const char *path)
|
||||
{
|
||||
char deleted_path[PATH_MAX + sizeof(PROC_FD_DELETED_STR)];
|
||||
struct dirent *pid_dp = NULL;
|
||||
char path_buf[PATH_MAX];
|
||||
char link_buf[PATH_MAX];
|
||||
DIR *pid_d = NULL;
|
||||
ssize_t len;
|
||||
|
||||
if (pid == getpid())
|
||||
return 0;
|
||||
|
||||
if (dm_snprintf(path_buf, sizeof(path_buf), "/proc/%d/fd", pid) < 0) {
|
||||
log_error("Could not format pid path.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test for the kernel 'file (deleted)' form when scanning.
|
||||
*/
|
||||
if (dm_snprintf(deleted_path, sizeof(deleted_path), "%s%s",
|
||||
path, PROC_FD_DELETED_STR) < 0) {
|
||||
log_error("Could not format check path.");
|
||||
}
|
||||
|
||||
pid_d = opendir(path_buf);
|
||||
if (!pid_d) {
|
||||
log_error("Could not open proc path: %s.", path_buf);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
while ((pid_dp = readdir(pid_d)) != NULL) {
|
||||
if (pid_dp->d_name[0] == '.')
|
||||
continue;
|
||||
if ((len = readlinkat(dirfd(pid_d), pid_dp->d_name, link_buf,
|
||||
sizeof(link_buf))) < 0) {
|
||||
log_error("readlink failed for /proc/%d/fd/.", pid);
|
||||
goto bad;
|
||||
}
|
||||
link_buf[len] = '\0';
|
||||
if (!strcmp(deleted_path, link_buf)) {
|
||||
closedir(pid_d);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
bad:
|
||||
closedir(pid_d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to guess detect whether a file is open by any process by
|
||||
* scanning symbolic links in /proc/<pid>/fd.
|
||||
*
|
||||
* This is a heuristic since it cannot guarantee to detect brief
|
||||
* access in all cases: a process that opens and then closes the
|
||||
* file rapidly may never be seen by the scan.
|
||||
*
|
||||
* The method will also give false-positives if a process exists
|
||||
* that has a deleted file open that had the same path, but a
|
||||
* different inode number, to the file being monitored.
|
||||
*
|
||||
* For this reason the daemon only uses _is_open() for unlinked
|
||||
* files when the mode is DM_FILEMAPD_FOLLOW_INODE, since these
|
||||
* files can no longer be newly opened by processes.
|
||||
*
|
||||
* In this situation !is_open(path) provides an indication that
|
||||
* the daemon should shut down: the file has been unlinked form
|
||||
* the file system and we appear to hold the final reference.
|
||||
*/
|
||||
static int _is_open(const char *path)
|
||||
{
|
||||
struct dirent *proc_dp = NULL;
|
||||
DIR *proc_d = NULL;
|
||||
pid_t pid;
|
||||
|
||||
proc_d = opendir("/proc");
|
||||
if (!proc_d)
|
||||
return 0;
|
||||
while ((proc_dp = readdir(proc_d)) != NULL) {
|
||||
if (!isdigit(proc_dp->d_name[0]))
|
||||
continue;
|
||||
pid = strtol(proc_dp->d_name, NULL, 10);
|
||||
if (!pid)
|
||||
continue;
|
||||
if (_is_open_in_pid(pid, path)) {
|
||||
closedir(proc_d);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
closedir(proc_d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _filemap_monitor_wait(uint64_t usecs)
|
||||
{
|
||||
if (_verbose) {
|
||||
if (usecs == FILEMAPD_WAIT_USECS)
|
||||
log_very_verbose("waiting for FILEMAPD_WAIT");
|
||||
if (usecs == FILEMAPD_NOFILE_WAIT_USECS)
|
||||
log_very_verbose("waiting for FILEMAPD_NOFILE_WAIT");
|
||||
}
|
||||
usleep((useconds_t) usecs);
|
||||
}
|
||||
|
||||
static int _parse_args(int argc, char **argv, struct filemap_monitor *fm)
|
||||
{
|
||||
char *endptr;
|
||||
|
||||
/* we don't care what is in argv[0]. */
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
if (argc < 5) {
|
||||
_early_log("Wrong number of arguments.");
|
||||
_early_log("usage: %s", _usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(fm, 0, sizeof(*fm));
|
||||
|
||||
/*
|
||||
* We don't know the true nr_regions at daemon start time,
|
||||
* and it is not worth a dm_stats_list()/group walk to count:
|
||||
* we can assume that there is at least one region or the
|
||||
* daemon would not have been started.
|
||||
*
|
||||
* A correct value will be obtained following the first update
|
||||
* of the group's regions.
|
||||
*/
|
||||
fm->nr_regions = 1;
|
||||
|
||||
/* parse <fd> */
|
||||
fm->fd = strtol(argv[0], &endptr, 10);
|
||||
if (*endptr) {
|
||||
_early_log("Could not parse file descriptor: %s", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
/* parse <group_id> */
|
||||
fm->group_id = strtoull(argv[0], &endptr, 10);
|
||||
if (*endptr) {
|
||||
_early_log("Could not parse group identifier: %s", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
/* parse <path> */
|
||||
if (!argv[0] || !strlen(argv[0])) {
|
||||
_early_log("Path argument is required.");
|
||||
return 0;
|
||||
}
|
||||
fm->path = dm_strdup(argv[0]);
|
||||
if (!fm->path) {
|
||||
_early_log("Could not allocate memory for path argument.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
/* parse <mode> */
|
||||
if (!argv[0] || !strlen(argv[0])) {
|
||||
_early_log("Mode argument is required.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fm->mode = dm_filemapd_mode_from_string(argv[0]);
|
||||
if (fm->mode == DM_FILEMAPD_FOLLOW_NONE)
|
||||
return 0;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
/* parse [<foreground>[<verbose>]] */
|
||||
if (argc) {
|
||||
_foreground = strtol(argv[0], &endptr, 10);
|
||||
if (*endptr) {
|
||||
_early_log("Could not parse debug argument: %s.",
|
||||
argv[0]);
|
||||
return 0;
|
||||
}
|
||||
argc--;
|
||||
argv++;
|
||||
if (argc) {
|
||||
_verbose = strtol(argv[0], &endptr, 10);
|
||||
if (*endptr) {
|
||||
_early_log("Could not parse verbose "
|
||||
"argument: %s", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
if (_verbose < 0 || _verbose > 3) {
|
||||
_early_log("Verbose argument out of range: %d.",
|
||||
_verbose);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _filemap_fd_check_changed(struct filemap_monitor *fm)
|
||||
{
|
||||
int64_t blocks, old_blocks;
|
||||
struct stat buf;
|
||||
|
||||
if (fm->fd < 0) {
|
||||
log_error("Filemap fd is not open.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fstat(fm->fd, &buf)) {
|
||||
log_error("Failed to fstat filemap file descriptor.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
blocks = buf.st_blocks;
|
||||
|
||||
/* first check? */
|
||||
if (fm->blocks < 0)
|
||||
old_blocks = buf.st_blocks;
|
||||
else
|
||||
old_blocks = fm->blocks;
|
||||
|
||||
fm->blocks = blocks;
|
||||
|
||||
return (fm->blocks != old_blocks);
|
||||
}
|
||||
|
||||
static void _filemap_monitor_end_notify(struct filemap_monitor *fm)
|
||||
{
|
||||
inotify_rm_watch(fm->inotify_fd, fm->inotify_watch_fd);
|
||||
if (close(fm->inotify_fd))
|
||||
log_error("Error closing inotify fd.");
|
||||
}
|
||||
|
||||
static int _filemap_monitor_set_notify(struct filemap_monitor *fm)
|
||||
{
|
||||
int inotify_fd, watch_fd;
|
||||
|
||||
/*
|
||||
* Set IN_NONBLOCK since we do not want to block in event read()
|
||||
* calls. Do not set IN_CLOEXEC as dmfilemapd is single-threaded
|
||||
* and does not fork or exec.
|
||||
*/
|
||||
if ((inotify_fd = inotify_init1(IN_NONBLOCK)) < 0) {
|
||||
_early_log("Failed to initialise inotify.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((watch_fd = inotify_add_watch(inotify_fd, fm->path,
|
||||
IN_MODIFY | IN_DELETE_SELF)) < 0) {
|
||||
_early_log("Failed to add inotify watch.");
|
||||
return 0;
|
||||
}
|
||||
fm->inotify_fd = inotify_fd;
|
||||
fm->inotify_watch_fd = watch_fd;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void _filemap_monitor_close_fd(struct filemap_monitor *fm)
|
||||
{
|
||||
if (close(fm->fd))
|
||||
log_error("Error closing file descriptor.");
|
||||
fm->fd = -1;
|
||||
}
|
||||
|
||||
static int _filemap_monitor_reopen_fd(struct filemap_monitor *fm)
|
||||
{
|
||||
int tries = FILEMAPD_NOFILE_WAIT_TRIES;
|
||||
|
||||
/*
|
||||
* In DM_FILEMAPD_FOLLOW_PATH mode, inotify watches must be
|
||||
* re-established whenever the file at the watched path is
|
||||
* changed.
|
||||
*
|
||||
* FIXME: stat file and skip if inode is unchanged.
|
||||
*/
|
||||
_filemap_monitor_end_notify(fm);
|
||||
if (fm->fd > 0)
|
||||
log_error("Filemap file descriptor already open.");
|
||||
|
||||
while ((fm->fd < 0) && --tries)
|
||||
if (((fm->fd = open(fm->path, O_RDONLY)) < 0) && tries)
|
||||
_filemap_monitor_wait(FILEMAPD_NOFILE_WAIT_USECS);
|
||||
|
||||
if (!tries && (fm->fd < 0)) {
|
||||
log_error("Could not re-open file descriptor.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _filemap_monitor_set_notify(fm);
|
||||
}
|
||||
|
||||
static int _filemap_monitor_get_events(struct filemap_monitor *fm)
|
||||
{
|
||||
/* alignment as per man(7) inotify */
|
||||
char buf[sizeof(struct inotify_event) + NAME_MAX + 1]
|
||||
__attribute__ ((aligned(__alignof__(struct inotify_event))));
|
||||
|
||||
struct inotify_event *event;
|
||||
int check = 0;
|
||||
ssize_t len;
|
||||
char *ptr;
|
||||
|
||||
if (fm->mode == DM_FILEMAPD_FOLLOW_PATH)
|
||||
_filemap_monitor_close_fd(fm);
|
||||
|
||||
len = read(fm->inotify_fd, (void *) &buf, sizeof(buf));
|
||||
|
||||
/* no events to read? */
|
||||
if (len < 0 && (errno == EAGAIN))
|
||||
goto out;
|
||||
|
||||
/* interrupted by signal? */
|
||||
if (len < 0 && (errno == EINTR))
|
||||
goto out;
|
||||
|
||||
if (len < 0)
|
||||
return -1;
|
||||
|
||||
if (!len)
|
||||
goto out;
|
||||
|
||||
for (ptr = buf; ptr < buf + len; ptr += sizeof(*event) + event->len) {
|
||||
event = (struct inotify_event *) ptr;
|
||||
if (event->mask & IN_DELETE_SELF)
|
||||
fm->deleted = 1;
|
||||
if (event->mask & IN_MODIFY)
|
||||
check = 1;
|
||||
/*
|
||||
* Event IN_IGNORED is generated when a file has been deleted
|
||||
* and IN_DELETE_SELF generated, and indicates that the file
|
||||
* watch has been automatically removed.
|
||||
*
|
||||
* This can only happen for the DM_FILEMAPD_FOLLOW_PATH mode,
|
||||
* since inotify IN_DELETE events are generated at the time
|
||||
* the inode is destroyed: DM_FILEMAPD_FOLLOW_INODE will hold
|
||||
* the file descriptor open, meaning that the event will not
|
||||
* be generated until after the daemon closes the file.
|
||||
*
|
||||
* The event is ignored here since inotify monitoring will
|
||||
* be reestablished (or the daemon will terminate) following
|
||||
* deletion of a DM_FILEMAPD_FOLLOW_PATH monitored file.
|
||||
*/
|
||||
if (event->mask & IN_IGNORED)
|
||||
log_very_verbose("Inotify watch removed: IN_IGNORED "
|
||||
"in event->mask");
|
||||
}
|
||||
|
||||
out:
|
||||
/*
|
||||
* Re-open file descriptor if required and log disposition.
|
||||
*/
|
||||
if (fm->mode == DM_FILEMAPD_FOLLOW_PATH)
|
||||
if (!_filemap_monitor_reopen_fd(fm))
|
||||
return -1;
|
||||
|
||||
log_very_verbose("exiting _filemap_monitor_get_events() with "
|
||||
"deleted=%d, check=%d", fm->deleted, check);
|
||||
return check;
|
||||
}
|
||||
|
||||
static void _filemap_monitor_destroy(struct filemap_monitor *fm)
|
||||
{
|
||||
if (fm->fd > 0) {
|
||||
_filemap_monitor_end_notify(fm);
|
||||
if (close(fm->fd))
|
||||
log_error("Error closing fd %d.", fm->fd);
|
||||
}
|
||||
}
|
||||
|
||||
static int _filemap_monitor_check_same_file(int fd1, int fd2)
|
||||
{
|
||||
struct stat buf1, buf2;
|
||||
|
||||
if ((fd1 < 0) || (fd2 < 0))
|
||||
return 0;
|
||||
|
||||
if (fstat(fd1, &buf1)) {
|
||||
log_error("Failed to fstat file descriptor %d", fd1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fstat(fd2, &buf2)) {
|
||||
log_error("Failed to fstat file descriptor %d", fd2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ((buf1.st_dev == buf2.st_dev) && (buf1.st_ino == buf2.st_ino));
|
||||
}
|
||||
|
||||
static int _filemap_monitor_check_file_unlinked(struct filemap_monitor *fm)
|
||||
{
|
||||
char path_buf[PATH_MAX];
|
||||
char link_buf[PATH_MAX];
|
||||
int same, fd, len;
|
||||
|
||||
fm->deleted = 0;
|
||||
|
||||
if ((fd = open(fm->path, O_RDONLY)) < 0)
|
||||
goto check_unlinked;
|
||||
|
||||
if ((same = _filemap_monitor_check_same_file(fm->fd, fd)) < 0)
|
||||
return 0;
|
||||
|
||||
if (close(fd))
|
||||
log_error("Error closing fd %d", fd);
|
||||
|
||||
if (same)
|
||||
return 1;
|
||||
|
||||
check_unlinked:
|
||||
/*
|
||||
* The file has been unlinked from its original location: test
|
||||
* whether it is still reachable in the filesystem, or if it is
|
||||
* unlinked and anonymous.
|
||||
*/
|
||||
if (dm_snprintf(path_buf, sizeof(path_buf),
|
||||
"/proc/%d/fd/%d", getpid(), fm->fd) < 0) {
|
||||
log_error("Could not format pid path.");
|
||||
return 0;
|
||||
}
|
||||
if ((len = readlink(path_buf, link_buf, sizeof(link_buf))) < 0) {
|
||||
log_error("readlink failed for /proc/%d/fd/%d.",
|
||||
getpid(), fm->fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to re-open the file, from the path now reported in /proc/pid/fd.
|
||||
*/
|
||||
if ((fd = open(link_buf, O_RDONLY)) < 0)
|
||||
fm->deleted = 1;
|
||||
|
||||
if ((same = _filemap_monitor_check_same_file(fm->fd, fd)) < 0)
|
||||
return 0;
|
||||
|
||||
if ((fd > 0) && close(fd))
|
||||
log_error("Error closing fd %d", fd);
|
||||
|
||||
/* Should not happen with normal /proc. */
|
||||
if ((fd > 0) && !same) {
|
||||
log_error("File descriptor mismatch: %d and %s (read from %s) "
|
||||
"are not the same file!", fm->fd, link_buf, path_buf);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _daemonise(struct filemap_monitor *fm)
|
||||
{
|
||||
pid_t pid = 0, sid;
|
||||
int fd;
|
||||
|
||||
if (!(sid = setsid())) {
|
||||
_early_log("setsid failed.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((pid = fork()) < 0) {
|
||||
_early_log("Failed to fork daemon process.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pid > 0) {
|
||||
if (_verbose)
|
||||
_early_log("Started dmfilemapd with pid=%d", pid);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (chdir("/")) {
|
||||
_early_log("Failed to change directory.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!_verbose) {
|
||||
if (close(STDIN_FILENO))
|
||||
_early_log("Error closing stdin");
|
||||
if (close(STDOUT_FILENO))
|
||||
_early_log("Error closing stdout");
|
||||
if (close(STDERR_FILENO))
|
||||
_early_log("Error closing stderr");
|
||||
if ((open("/dev/null", O_RDONLY) < 0) ||
|
||||
(open("/dev/null", O_WRONLY) < 0) ||
|
||||
(open("/dev/null", O_WRONLY) < 0)) {
|
||||
_early_log("Error opening stdio streams.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (fd = sysconf(_SC_OPEN_MAX) - 1; fd > STDERR_FILENO; fd--) {
|
||||
if (fd == fm->fd)
|
||||
continue;
|
||||
close(fd);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _update_regions(struct dm_stats *dms, struct filemap_monitor *fm)
|
||||
{
|
||||
uint64_t *regions = NULL, *region, nr_regions = 0;
|
||||
|
||||
regions = dm_stats_update_regions_from_fd(dms, fm->fd, fm->group_id);
|
||||
if (!regions) {
|
||||
log_error("Failed to update filemap regions for group_id="
|
||||
FMTu64 ".", fm->group_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (region = regions; *region != DM_STATS_REGIONS_ALL; region++)
|
||||
nr_regions++;
|
||||
|
||||
if (regions[0] != fm->group_id) {
|
||||
log_warn("group_id changed from " FMTu64 " to " FMTu64,
|
||||
fm->group_id, regions[0]);
|
||||
fm->group_id = regions[0];
|
||||
}
|
||||
|
||||
fm->nr_regions = nr_regions;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int _dmfilemapd(struct filemap_monitor *fm)
|
||||
{
|
||||
int running = 1, check = 0, open = 0;
|
||||
struct dm_stats *dms;
|
||||
|
||||
dms = dm_stats_create("dmstats"); /* FIXME */
|
||||
if (!dm_stats_bind_from_fd(dms, fm->fd)) {
|
||||
log_error("Could not bind dm_stats handle to file descriptor "
|
||||
"%d", fm->fd);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (!_filemap_monitor_set_notify(fm))
|
||||
goto bad;
|
||||
|
||||
do {
|
||||
if (!dm_stats_list(dms, NULL)) {
|
||||
log_error("Failed to list stats handle.");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (!dm_stats_group_present(dms, fm->group_id)) {
|
||||
log_info("Filemap group removed: exiting.");
|
||||
running = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((check = _filemap_monitor_get_events(fm)) < 0)
|
||||
goto bad;
|
||||
|
||||
if (!check)
|
||||
goto wait;
|
||||
|
||||
if ((check = _filemap_fd_check_changed(fm)) < 0)
|
||||
goto bad;
|
||||
|
||||
if (!check)
|
||||
goto wait;
|
||||
|
||||
if (!_update_regions(dms, fm))
|
||||
goto bad;
|
||||
|
||||
wait:
|
||||
_filemap_monitor_wait(FILEMAPD_WAIT_USECS);
|
||||
|
||||
running = !!fm->nr_regions;
|
||||
|
||||
/* mode=inode termination condions */
|
||||
if (fm->mode == DM_FILEMAPD_FOLLOW_INODE) {
|
||||
if (!_filemap_monitor_check_file_unlinked(fm))
|
||||
goto bad;
|
||||
if (fm->deleted && !(open = _is_open(fm->path))) {
|
||||
log_info("File unlinked and closed: exiting.");
|
||||
running = 0;
|
||||
} else if (fm->deleted && open)
|
||||
log_verbose("File unlinked and open: "
|
||||
"continuing.");
|
||||
}
|
||||
|
||||
} while (running);
|
||||
|
||||
_filemap_monitor_destroy(fm);
|
||||
dm_stats_destroy(dms);
|
||||
return 0;
|
||||
|
||||
bad:
|
||||
_filemap_monitor_destroy(fm);
|
||||
dm_stats_destroy(dms);
|
||||
log_error("Exiting");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const char * _mode_names[] = {
|
||||
"inode",
|
||||
"path"
|
||||
};
|
||||
|
||||
/*
|
||||
* dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]]
|
||||
*/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct filemap_monitor fm;
|
||||
|
||||
if (!_parse_args(argc, argv, &fm))
|
||||
return 1;
|
||||
|
||||
_setup_logging();
|
||||
|
||||
log_info("Starting dmfilemapd with fd=%d, group_id=" FMTu64 " "
|
||||
"mode=%s, path=%s", fm.fd, fm.group_id,
|
||||
_mode_names[fm.mode], fm.path);
|
||||
|
||||
if (!_foreground && !_daemonise(&fm))
|
||||
return 1;
|
||||
|
||||
return _dmfilemapd(&fm);
|
||||
}
|
@@ -127,6 +127,9 @@
|
||||
/* Path to dmeventd pidfile. */
|
||||
#undef DMEVENTD_PIDFILE
|
||||
|
||||
/* Define to 1 to enable the device-mapper filemap daemon. */
|
||||
#undef DMFILEMAPD
|
||||
|
||||
/* Define to enable compat protocol */
|
||||
#undef DM_COMPAT
|
||||
|
||||
|
@@ -88,20 +88,11 @@ struct cmd_context {
|
||||
* Command line and arguments.
|
||||
*/
|
||||
const char *cmd_line;
|
||||
const char *name; /* needed before cmd->command is set */
|
||||
struct command_name *cname;
|
||||
struct command *command;
|
||||
char **argv;
|
||||
struct arg_values *opt_arg_values;
|
||||
struct arg_values *arg_values;
|
||||
struct dm_list arg_value_groups;
|
||||
|
||||
/*
|
||||
* Position args remaining after command name
|
||||
* and --options are removed from original argc/argv.
|
||||
*/
|
||||
int position_argc;
|
||||
char **position_argv;
|
||||
|
||||
/*
|
||||
* Format handlers.
|
||||
*/
|
||||
|
@@ -319,6 +319,7 @@ static int _lv_layout_and_role_thin(struct dm_pool *mem,
|
||||
{
|
||||
int top_level = 0;
|
||||
unsigned snap_count;
|
||||
struct lv_segment *seg;
|
||||
|
||||
/* non-top-level LVs */
|
||||
if (lv_is_thin_pool_metadata(lv)) {
|
||||
@@ -352,7 +353,7 @@ static int _lv_layout_and_role_thin(struct dm_pool *mem,
|
||||
!str_list_add_no_dup_check(mem, role, _lv_type_names[LV_TYPE_MULTITHINORIGIN]))
|
||||
goto_bad;
|
||||
}
|
||||
if (lv_is_thin_snapshot(lv))
|
||||
if ((seg = first_seg(lv)) && (seg->origin || seg->external_lv))
|
||||
if (!str_list_add(mem, role, _lv_type_names[LV_TYPE_SNAPSHOT]) ||
|
||||
!str_list_add_no_dup_check(mem, role, _lv_type_names[LV_TYPE_THINSNAPSHOT]))
|
||||
goto_bad;
|
||||
@@ -890,8 +891,9 @@ 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) up to stripe boundary size %s (%u extents).",
|
||||
log_print_unless_silent("Rounding size %s (%u extents) %s 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);
|
||||
}
|
||||
|
||||
@@ -966,6 +968,37 @@ 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)
|
||||
{
|
||||
@@ -1006,32 +1039,40 @@ static int _release_and_discard_lv_segment_area(struct lv_segment *seg, uint32_t
|
||||
}
|
||||
|
||||
if (lv_is_raid_image(lv)) {
|
||||
/*
|
||||
* 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.");
|
||||
/* 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)
|
||||
return 0;
|
||||
} else {
|
||||
if (!lv_remove(lv)) {
|
||||
log_error("Failed to remove RAID image %s.",
|
||||
display_lvname(lv));
|
||||
|
||||
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)))
|
||||
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 */
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
if (!lv_reduce(lv, rimage_extents))
|
||||
return_0; /* FIXME: any upper level reporting */
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1438,6 +1479,13 @@ 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);
|
||||
}
|
||||
|
||||
@@ -3301,19 +3349,24 @@ 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 * ah->area_multiple);
|
||||
total_extents += ah->log_len * (segtype_is_raid1(segtype) ? 1 : ah->area_multiple);
|
||||
} else {
|
||||
ah->log_area_count = 0;
|
||||
ah->log_len = 0;
|
||||
@@ -4010,19 +4063,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -4070,6 +4110,22 @@ 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)) {
|
||||
uint64_t lv_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, lv_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)))
|
||||
@@ -4650,6 +4706,11 @@ 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;
|
||||
}
|
||||
@@ -5315,6 +5376,7 @@ 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;
|
||||
@@ -5356,6 +5418,11 @@ int lv_resize(struct logical_volume *lv,
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure stipe 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;
|
||||
|
||||
|
@@ -148,7 +148,14 @@ 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 (mandatory during conversion between them) */
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
if (!(seg_is_raid4(seg) || seg_is_raid5_n(seg)) && !seg->meta_areas)
|
||||
raid_seg_error("no meta areas");
|
||||
if (!seg->stripe_size)
|
||||
|
@@ -1067,16 +1067,9 @@ struct lv_segment *get_only_segment_using_this_lv(const struct logical_volume *l
|
||||
* Useful functions for managing snapshots.
|
||||
*/
|
||||
int lv_is_origin(const struct logical_volume *lv);
|
||||
#define lv_is_thick_origin lv_is_origin
|
||||
|
||||
int lv_is_thin_origin(const struct logical_volume *lv, unsigned *snap_count);
|
||||
int lv_is_thin_snapshot(const struct logical_volume *lv);
|
||||
|
||||
int lv_is_cow(const struct logical_volume *lv);
|
||||
#define lv_is_thick_snapshot lv_is_cow
|
||||
|
||||
int lv_is_cache_origin(const struct logical_volume *lv);
|
||||
|
||||
int lv_is_cow(const struct logical_volume *lv);
|
||||
int lv_is_merging_cow(const struct logical_volume *cow);
|
||||
uint32_t cow_max_extents(const struct logical_volume *origin, uint32_t chunk_size);
|
||||
int cow_has_min_chunks(const struct volume_group *vg, uint32_t cow_extents, uint32_t chunk_size);
|
||||
@@ -1224,6 +1217,12 @@ 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 lv_size, uint32_t region_size);
|
||||
/* -- metadata/raid_manip.c */
|
||||
|
||||
/* ++ metadata/cache_manip.c */
|
||||
|
@@ -5629,11 +5629,6 @@ static int _access_vg_lock_type(struct cmd_context *cmd, struct volume_group *vg
|
||||
}
|
||||
}
|
||||
|
||||
if (test_mode()) {
|
||||
log_error("Test mode is not yet supported with lock type %s.", vg->lock_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -50,24 +50,26 @@ static int _check_num_areas_in_lv_segments(struct logical_volume *lv, unsigned n
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Ensure region size exceeds the minimum for lv */
|
||||
static void _ensure_min_region_size(const struct logical_volume *lv)
|
||||
/*
|
||||
* 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 lv_size, uint32_t 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;
|
||||
uint32_t min_region_size = lv_size / (1 << 21);
|
||||
uint32_t region_size_sav = region_size;
|
||||
|
||||
while (region_size < min_region_size)
|
||||
region_size *= 2;
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -106,8 +108,7 @@ 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);
|
||||
|
||||
return _ensure_min_region_size(lv);
|
||||
seg->region_size = raid_ensure_min_region_size(lv, lv->size, seg->region_size);
|
||||
}
|
||||
|
||||
/* Strip any raid suffix off LV name */
|
||||
@@ -672,7 +673,7 @@ static int _alloc_image_components(struct logical_volume *lv,
|
||||
return_0;
|
||||
|
||||
if (seg_is_linear(seg))
|
||||
region_size = get_default_region_size(lv->vg->cmd);
|
||||
region_size = seg->region_size ? : get_default_region_size(lv->vg->cmd);
|
||||
else
|
||||
region_size = seg->region_size;
|
||||
|
||||
@@ -745,6 +746,74 @@ 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
|
||||
@@ -785,7 +854,8 @@ 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,
|
||||
1 /*RAID_METADATA_AREA_LEN*/,
|
||||
raid_rmeta_extents_delta(data_lv->vg->cmd, 0, data_lv->le_count,
|
||||
seg->region_size, data_lv->vg->extent_size),
|
||||
allocate_pvs, data_lv->alloc, 0, NULL)))
|
||||
return_0;
|
||||
|
||||
@@ -845,6 +915,11 @@ 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;
|
||||
@@ -891,7 +966,9 @@ static int _raid_add_images_without_commit(struct logical_volume *lv,
|
||||
goto fail;
|
||||
|
||||
if (seg_is_linear(seg)) {
|
||||
first_seg(lv)->status |= RAID_IMAGE;
|
||||
uint32_t region_size = seg->region_size;
|
||||
|
||||
seg->status |= RAID_IMAGE;
|
||||
if (!insert_layer_for_lv(lv->vg->cmd, lv,
|
||||
RAID | LVM_READ | LVM_WRITE,
|
||||
"_rimage_0"))
|
||||
@@ -899,15 +976,8 @@ 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;
|
||||
}
|
||||
@@ -2175,7 +2245,6 @@ 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;
|
||||
@@ -2893,8 +2962,6 @@ 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))
|
||||
@@ -3093,9 +3160,12 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
|
||||
dm_list_init(&removal_lvs);
|
||||
|
||||
/* Necessary when convering to raid0/striped w/o redundancy? */
|
||||
if (!_raid_in_sync(lv))
|
||||
/* 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));
|
||||
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]: ",
|
||||
@@ -3105,8 +3175,6 @@ static int _raid456_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))
|
||||
@@ -3156,7 +3224,7 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
|
||||
} else
|
||||
seg->segtype = new_segtype;
|
||||
|
||||
seg->region_size = region_size;
|
||||
seg->region_size = new_region_size ?: region_size;
|
||||
|
||||
if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs))
|
||||
return_0;
|
||||
@@ -3203,7 +3271,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));
|
||||
@@ -3406,6 +3474,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -3586,7 +3656,8 @@ 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, 0, allocate_pvs);
|
||||
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);
|
||||
}
|
||||
|
||||
static int _takeover_from_raid45_to_raid6(TAKEOVER_FN_ARGS)
|
||||
@@ -3847,6 +3918,87 @@ 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, uint32_t region_size,
|
||||
struct dm_list *allocate_pvs)
|
||||
{
|
||||
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));
|
||||
if (!lv_extend(lv, seg->segtype, seg->area_count - seg->segtype->parity_devs, seg->stripe_size, 1, seg->region_size, 0, allocate_pvs, lv->vg->alloc, 0))
|
||||
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,
|
||||
@@ -3898,7 +4050,8 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
const unsigned new_stripes,
|
||||
const unsigned new_stripe_size_supplied,
|
||||
const unsigned new_stripe_size,
|
||||
const uint32_t new_region_size,
|
||||
/* FIXME: workaround with volatile new_region_size until cli validation patches got merged */
|
||||
uint32_t new_region_size,
|
||||
struct dm_list *allocate_pvs)
|
||||
{
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
@@ -3923,6 +4076,20 @@ 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 volatile 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, allocate_pvs);
|
||||
} else
|
||||
new_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.
|
||||
|
@@ -752,19 +752,6 @@ int lv_is_thin_origin(const struct logical_volume *lv, unsigned int *snap_count)
|
||||
return r;
|
||||
}
|
||||
|
||||
int lv_is_thin_snapshot(const struct logical_volume *lv)
|
||||
{
|
||||
struct lv_segment *seg;
|
||||
|
||||
if (!lv_is_thin_volume(lv))
|
||||
return 0;
|
||||
|
||||
if ((seg = first_seg(lv)) && (seg->origin || seg->external_lv))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Explict check of new thin pool for usability
|
||||
*
|
||||
|
@@ -1,5 +1,10 @@
|
||||
dm_bit_get_last
|
||||
dm_bit_get_prev
|
||||
dm_filemapd_mode_from_string
|
||||
dm_stats_update_regions_from_fd
|
||||
dm_bitset_parse_list
|
||||
dm_message_supports_stats_resize
|
||||
dm_stats_bind_from_fd
|
||||
dm_stats_driver_supports_resize
|
||||
dm_stats_resize_region
|
||||
dm_stats_start_filemapd
|
||||
|
@@ -619,6 +619,17 @@ int dm_message_supports_precise_timestamps(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_message_supports_stats_resize(void)
|
||||
{
|
||||
/*
|
||||
* FIXME: set to final version when known.
|
||||
*/
|
||||
if (dm_check_version() && _dm_version >= 4)
|
||||
if (_dm_version_minor >= 35)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *dm_get_next_target(struct dm_task *dmt, void *next,
|
||||
uint64_t *start, uint64_t *length,
|
||||
char **target_type, char **params)
|
||||
|
@@ -536,6 +536,12 @@ int dm_stats_bind_from_fd(struct dm_stats *dms, int fd);
|
||||
*/
|
||||
int dm_message_supports_precise_timestamps(void);
|
||||
|
||||
/*
|
||||
* Test whether the running kernel supports the @stats_resize
|
||||
* message.
|
||||
*/
|
||||
int dm_message_supports_stats_resize(void);
|
||||
|
||||
/*
|
||||
* Precise timetamps and histogram support.
|
||||
*
|
||||
@@ -544,6 +550,11 @@ int dm_message_supports_precise_timestamps(void);
|
||||
int dm_stats_driver_supports_precise(void);
|
||||
int dm_stats_driver_supports_histogram(void);
|
||||
|
||||
/*
|
||||
* Test for presence of the @stats_resize message.
|
||||
*/
|
||||
int dm_stats_driver_supports_resize(void);
|
||||
|
||||
/*
|
||||
* Returns 1 if the specified region has the precise_timestamps feature
|
||||
* enabled (i.e. produces nanosecond-precision counter values) or 0 for
|
||||
@@ -678,6 +689,14 @@ int dm_stats_create_region(struct dm_stats *dms, uint64_t *region_id,
|
||||
int precise, struct dm_histogram *bounds,
|
||||
const char *program_id, const char *user_data);
|
||||
|
||||
/*
|
||||
* Atomically resize an existing statistics region, retaining any
|
||||
* accumulated counter data. This can be used to grow a statistics
|
||||
* region to account for changes in the object it represents.
|
||||
*/
|
||||
int dm_stats_resize_region(struct dm_stats *dms, uint64_t region_id,
|
||||
int64_t size_change);
|
||||
|
||||
/*
|
||||
* Delete the specified statistics region. This will also mark the
|
||||
* region as not-present and discard any existing statistics data.
|
||||
@@ -1368,6 +1387,69 @@ uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
uint64_t group_id);
|
||||
|
||||
|
||||
/*
|
||||
* The file map monitoring daemon can monitor files in two distinct
|
||||
* ways: the mode affects the behaviour of the daemon when a file
|
||||
* under monitoring is renamed or unlinked, and the conditions which
|
||||
* cause the daemon to terminate.
|
||||
*
|
||||
* In both modes, the daemon will always shut down when the group
|
||||
* being monitored is deleted.
|
||||
*
|
||||
* Follow inode:
|
||||
* The daemon follows the inode of the file, as it was at the time the
|
||||
* daemon started. The file descriptor referencing the file is kept
|
||||
* open at all times, and the daemon will exit when it detects that
|
||||
* the file has been unlinked and it is the last holder of a reference
|
||||
* to the file.
|
||||
*
|
||||
* This mode is useful if the file is expected to be renamed, or moved
|
||||
* within the file system, while it is being monitored.
|
||||
*
|
||||
* Follow path:
|
||||
* The daemon follows the path that was given on the daemon command
|
||||
* line. The file descriptor referencing the file is re-opened on each
|
||||
* iteration of the daemon, and the daemon will exit if no file exists
|
||||
* at this location (a tolerance is allowed so that a brief delay
|
||||
* between unlink() and creat() is permitted).
|
||||
*
|
||||
* This mode is useful if the file is updated by unlinking the original
|
||||
* and placing a new file at the same path.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
DM_FILEMAPD_FOLLOW_INODE,
|
||||
DM_FILEMAPD_FOLLOW_PATH,
|
||||
DM_FILEMAPD_FOLLOW_NONE
|
||||
} dm_filemapd_mode_t;
|
||||
|
||||
/*
|
||||
* Parse a string representation of a dmfilemapd mode.
|
||||
*
|
||||
* Returns a valid dm_filemapd_mode_t value on success, or
|
||||
* DM_FILEMAPD_FOLLOW_NONE on error.
|
||||
*/
|
||||
dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str);
|
||||
|
||||
/*
|
||||
* Start the dmfilemapd filemap monitoring daemon for the specified
|
||||
* file descriptor, group, and file system path. The daemon will
|
||||
* monitor the file for allocation changes, and when a change is
|
||||
* detected, call dm_stats_update_regions_from_fd() to update the
|
||||
* mapped regions for the file.
|
||||
*
|
||||
* The mode parameter controls the behaviour of the daemon when the
|
||||
* file being monitored is unlinked or moved: see the comments for
|
||||
* dm_filemapd_mode_t for a full description and possible values.
|
||||
*
|
||||
* The daemon can be stopped at any time by sending SIGTERM to the
|
||||
* daemon pid.
|
||||
*/
|
||||
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
|
||||
dm_filemapd_mode_t mode, unsigned foreground,
|
||||
unsigned verbose);
|
||||
|
||||
/*
|
||||
* Call this to actually run the ioctl.
|
||||
*/
|
||||
|
@@ -493,6 +493,11 @@ int dm_stats_driver_supports_histogram(void)
|
||||
return _stats_check_precise_timestamps(NULL);
|
||||
}
|
||||
|
||||
int dm_stats_driver_supports_resize(void)
|
||||
{
|
||||
return dm_message_supports_stats_resize();
|
||||
}
|
||||
|
||||
static int _fill_hist_arg(char *hist_arg, size_t hist_len, uint64_t scale,
|
||||
struct dm_histogram *bounds)
|
||||
{
|
||||
@@ -2030,6 +2035,51 @@ out:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _stats_resize_region(struct dm_stats *dms, uint64_t region_id,
|
||||
int64_t size_change)
|
||||
{
|
||||
struct dm_stats_region *region = &dms->regions[region_id];
|
||||
char msg[STATS_MSG_BUF_LEN];
|
||||
struct dm_task *dmt = NULL;
|
||||
|
||||
if (!_stats_bound(dms))
|
||||
return_0;
|
||||
|
||||
if (!dm_stats_driver_supports_resize()) {
|
||||
log_error("Driver does not support stats resize message.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((dm_snprintf(msg, sizeof(msg), "@stats_resize " FMTu64 " " FMTu64,
|
||||
region_id, size_change)) < 0) {
|
||||
log_error("Could not format @stats_resize message.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(dmt = _stats_send_message(dms, msg)))
|
||||
return_0;
|
||||
|
||||
if (dms->regions && _stats_region_present(region)) {
|
||||
if (region->step == region->len)
|
||||
region->step = region->len = region->len + size_change;
|
||||
else
|
||||
region->len += size_change;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dm_stats_resize_region(struct dm_stats *dms, uint64_t region_id,
|
||||
int64_t size_change)
|
||||
{
|
||||
if (size_change < 0) {
|
||||
log_error("Shrinking statistics regions is currently "
|
||||
"unsupported.");
|
||||
return 0;
|
||||
}
|
||||
return _stats_resize_region(dms, region_id, size_change);
|
||||
}
|
||||
|
||||
static void _stats_clear_group_regions(struct dm_stats *dms, uint64_t group_id)
|
||||
{
|
||||
struct dm_stats_group *group;
|
||||
@@ -4463,15 +4513,12 @@ bad:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define MATCH_EXTENT(e, s, l) \
|
||||
(((e).start == (s)) && ((e).len == (l)))
|
||||
|
||||
static struct _extent *_find_extent(size_t nr_extents, struct _extent *extents,
|
||||
uint64_t start, uint64_t len)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < nr_extents; i++)
|
||||
if (MATCH_EXTENT(extents[i], start, len))
|
||||
if (extents[i].start == start)
|
||||
return extents + i;
|
||||
return NULL;
|
||||
}
|
||||
@@ -4503,8 +4550,10 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
{
|
||||
struct dm_stats_region *region = NULL;
|
||||
struct dm_stats_group *group = NULL;
|
||||
struct _extent ext, *file_ext;
|
||||
int64_t nr_kept, nr_old, i;
|
||||
struct _extent ext;
|
||||
uint64_t d_size;
|
||||
int have_resize;
|
||||
|
||||
group = &dms->groups[group_id];
|
||||
|
||||
@@ -4516,6 +4565,9 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Can driver extend regions in-place? */
|
||||
have_resize = dm_stats_driver_supports_resize();
|
||||
|
||||
nr_kept = nr_old = 0; /* counts of old and retained extents */
|
||||
|
||||
/*
|
||||
@@ -4527,18 +4579,34 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
region = &dms->regions[i];
|
||||
nr_old++;
|
||||
|
||||
if (_find_extent(*count, extents,
|
||||
region->start, region->len)) {
|
||||
if ((file_ext = _find_extent(*count, extents,
|
||||
region->start, region->len))) {
|
||||
|
||||
/* growing extent? */
|
||||
if (region->len < file_ext->len) {
|
||||
if (!have_resize)
|
||||
goto delete_region;
|
||||
d_size = file_ext->len - region->len;
|
||||
|
||||
log_very_verbose("Resizing region ID " FMTu64
|
||||
" to " FMTu64 " sectors.", i,
|
||||
region->len);
|
||||
|
||||
if (!dm_stats_resize_region(dms, i, d_size))
|
||||
log_error("Failed to resize region ID "
|
||||
FMTu64, i);
|
||||
}
|
||||
|
||||
ext.start = region->start;
|
||||
ext.len = region->len;
|
||||
ext.id = i;
|
||||
nr_kept++;
|
||||
|
||||
dm_pool_grow_object(mem, &ext,
|
||||
sizeof(ext));
|
||||
dm_pool_grow_object(mem, &ext, sizeof(ext));
|
||||
log_very_verbose("Kept region " FMTu64, i);
|
||||
} else {
|
||||
|
||||
} else {
|
||||
delete_region:
|
||||
if (i == group_id)
|
||||
*regroup = 1;
|
||||
|
||||
@@ -4547,7 +4615,6 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
|
||||
i);
|
||||
goto out;
|
||||
}
|
||||
|
||||
log_very_verbose("Deleted region " FMTu64, i);
|
||||
}
|
||||
}
|
||||
@@ -4873,6 +4940,154 @@ bad:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef DMFILEMAPD
|
||||
static const char *_filemapd_mode_names[] = {
|
||||
"inode",
|
||||
"path",
|
||||
NULL
|
||||
};
|
||||
|
||||
dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str)
|
||||
{
|
||||
dm_filemapd_mode_t mode = DM_FILEMAPD_FOLLOW_INODE;
|
||||
const char **mode_name;
|
||||
|
||||
if (mode_str) {
|
||||
for (mode_name = _filemapd_mode_names; *mode_name; mode_name++)
|
||||
if (!strcmp(*mode_name, mode_str))
|
||||
break;
|
||||
if (*mode_name)
|
||||
mode = DM_FILEMAPD_FOLLOW_INODE
|
||||
+ (mode_name - _filemapd_mode_names);
|
||||
else {
|
||||
log_error("Could not parse dmfilemapd mode: %s",
|
||||
mode_str);
|
||||
return DM_FILEMAPD_FOLLOW_NONE;
|
||||
}
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
#define DM_FILEMAPD "dmfilemapd"
|
||||
#define NR_FILEMAPD_ARGS 6
|
||||
/*
|
||||
* Start dmfilemapd to monitor the specified file descriptor, and to
|
||||
* update the group given by 'group_id' when the file's allocation
|
||||
* changes.
|
||||
*
|
||||
* usage: dmfilemapd <fd> <group_id> <mode> [<foreground>[<log_level>]]
|
||||
*/
|
||||
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
|
||||
dm_filemapd_mode_t mode, unsigned foreground,
|
||||
unsigned verbose)
|
||||
{
|
||||
char fd_str[8], group_str[8], fg_str[2], verb_str[2];
|
||||
const char *mode_str = _filemapd_mode_names[mode];
|
||||
char *args[NR_FILEMAPD_ARGS + 1];
|
||||
pid_t pid = 0;
|
||||
int argc = 0;
|
||||
|
||||
if (fd < 0) {
|
||||
log_error("dmfilemapd file descriptor must be "
|
||||
"non-negative: %d", fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mode < DM_FILEMAPD_FOLLOW_INODE
|
||||
|| mode > DM_FILEMAPD_FOLLOW_PATH) {
|
||||
log_error("Invalid dmfilemapd mode argument: "
|
||||
"Must be DM_FILEMAPD_FOLLOW_INODE or "
|
||||
"DM_FILEMAPD_FOLLOW_PATH");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (foreground > 1) {
|
||||
log_error("Invalid dmfilemapd foreground argument. "
|
||||
"Must be 0 or 1: %d.", foreground);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (verbose > 3) {
|
||||
log_error("Invalid dmfilemapd verbose argument. "
|
||||
"Must be 0..3: %d.", verbose);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set argv[0] */
|
||||
args[argc++] = (char *) DM_FILEMAPD;
|
||||
|
||||
/* set <fd> */
|
||||
if ((dm_snprintf(fd_str, sizeof(fd_str), "%d", fd)) < 0) {
|
||||
log_error("Could not format fd argument.");
|
||||
return 0;
|
||||
}
|
||||
args[argc++] = fd_str;
|
||||
|
||||
/* set <group_id> */
|
||||
if ((dm_snprintf(group_str, sizeof(group_str), FMTu64, group_id)) < 0) {
|
||||
log_error("Could not format group_id argument.");
|
||||
return 0;
|
||||
}
|
||||
args[argc++] = group_str;
|
||||
|
||||
/* set <path> */
|
||||
args[argc++] = (char *) path;
|
||||
|
||||
/* set <mode> */
|
||||
args[argc++] = (char *) mode_str;
|
||||
|
||||
/* set <foreground> */
|
||||
if ((dm_snprintf(fg_str, sizeof(fg_str), "%u", foreground)) < 0) {
|
||||
log_error("Could not format foreground argument.");
|
||||
return 0;
|
||||
}
|
||||
args[argc++] = fg_str;
|
||||
|
||||
/* set <verbose> */
|
||||
if ((dm_snprintf(verb_str, sizeof(verb_str), "%u", verbose)) < 0) {
|
||||
log_error("Could not format verbose argument.");
|
||||
return 0;
|
||||
}
|
||||
args[argc++] = verb_str;
|
||||
|
||||
/* terminate args[argc] */
|
||||
args[argc] = NULL;
|
||||
|
||||
log_very_verbose("Spawning daemon as '%s %d " FMTu64 " %s %s %u %u'",
|
||||
*args, fd, group_id, path, mode_str,
|
||||
foreground, verbose);
|
||||
|
||||
if (!foreground && ((pid = fork()) < 0)) {
|
||||
log_error("Failed to fork filemapd process.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pid > 0) {
|
||||
log_very_verbose("Forked filemapd process as pid %d", pid);
|
||||
return 1;
|
||||
}
|
||||
|
||||
execvp(args[0], args);
|
||||
log_error("execvp() failed.");
|
||||
if (!foreground)
|
||||
_exit(127);
|
||||
return 0;
|
||||
}
|
||||
# else /* !DMFILEMAPD */
|
||||
dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
|
||||
int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
|
||||
dm_filemapd_mode_t mode, unsigned foreground,
|
||||
unsigned verbose)
|
||||
{
|
||||
log_error("dmfilemapd support disabled.");
|
||||
return 0;
|
||||
}
|
||||
#endif /* DMFILEMAPD */
|
||||
|
||||
#else /* HAVE_LINUX_FIEMAP */
|
||||
|
||||
uint64_t *dm_stats_create_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
@@ -4890,6 +5105,13 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
log_error("File mapping requires FIEMAP ioctl support.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_stats_start_filemapd(struct dm_stats *dms, int fd, uint64_t group_id,
|
||||
const char *path)
|
||||
{
|
||||
log_error("File mapping requires FIEMAP ioctl support.");
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_LINUX_FIEMAP */
|
||||
|
||||
/*
|
||||
|
@@ -31,22 +31,18 @@ LVMRAIDMAN = lvmraid.7
|
||||
|
||||
MAN5=lvm.conf.5
|
||||
MAN7=lvmsystemid.7 lvmreport.7
|
||||
MAN8=lvm.8 lvmconf.8 lvmdump.8
|
||||
MAN8DM=dmsetup.8 dmstats.8
|
||||
MAN8CLUSTER=
|
||||
MAN8SYSTEMD_GENERATORS=lvm2-activation-generator.8
|
||||
|
||||
MAN8GEN=lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 lvm-lvpoll.8 \
|
||||
lvcreate.8 lvchange.8 lvmconfig.8 lvconvert.8 lvdisplay.8 lvextend.8 \
|
||||
MAN8=lvm-config.8 lvm-dumpconfig.8 lvm-fullreport.8 lvm-lvpoll.8 \
|
||||
lvchange.8 lvmconfig.8 lvconvert.8 lvcreate.8 lvdisplay.8 lvextend.8 \
|
||||
lvm.8 lvmchange.8 lvmconf.8 lvmdiskscan.8 lvmdump.8 lvmsadc.8 lvmsar.8 \
|
||||
lvreduce.8 lvremove.8 lvrename.8 lvresize.8 lvs.8 \
|
||||
lvscan.8 pvchange.8 pvck.8 pvcreate.8 pvdisplay.8 pvmove.8 pvremove.8 \
|
||||
pvresize.8 pvs.8 pvscan.8 vgcfgbackup.8 vgcfgrestore.8 vgchange.8 \
|
||||
vgck.8 vgcreate.8 vgconvert.8 vgdisplay.8 vgexport.8 vgextend.8 \
|
||||
vgimport.8 vgimportclone.8 vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 \
|
||||
vgrename.8 vgs.8 vgscan.8 vgsplit.8 \
|
||||
lvmsar.8 lvmsadc.8 lvmdiskscan.8 lvmchange.8
|
||||
|
||||
MAN8+=$(MAN8GEN)
|
||||
vgrename.8 vgs.8 vgscan.8 vgsplit.8
|
||||
MAN8DM=dmsetup.8 dmstats.8 dmfilemapd.8
|
||||
MAN8CLUSTER=
|
||||
MAN8SYSTEMD_GENERATORS=lvm2-activation-generator.8
|
||||
|
||||
ifeq ($(MAKECMDGOALS),all_man)
|
||||
MAN_ALL="yes"
|
||||
@@ -144,15 +140,6 @@ 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
|
||||
|
||||
generator:
|
||||
$(CC) -DMAN_PAGE_GENERATOR $(top_builddir)/tools/command.c -o man-generator
|
||||
|
||||
$(MAN8GEN): generator
|
||||
echo "Generating $@" ;
|
||||
./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)
|
||||
$(INSTALL_DATA) $(MAN5) $(MAN5DIR)/
|
||||
@@ -161,7 +148,7 @@ install_man7: $(MAN7)
|
||||
$(INSTALL) -d $(MAN7DIR)
|
||||
$(INSTALL_DATA) $(MAN7) $(MAN7DIR)/
|
||||
|
||||
install_man8: $(MAN8) $(MAN8GEN)
|
||||
install_man8: $(MAN8)
|
||||
$(INSTALL) -d $(MAN8DIR)
|
||||
$(INSTALL_DATA) $(MAN8) $(MAN8DIR)/
|
||||
|
||||
|
@@ -154,32 +154,6 @@ This timeout will be ignored if you start \fBclvmd\fP with the \fB\-d\fP.
|
||||
.br
|
||||
Display the version of the cluster LVM daemon.
|
||||
.
|
||||
.SH NOTES
|
||||
.
|
||||
.SS Activation
|
||||
.
|
||||
In a clustered VG, clvmd is used for activation, and the following values are
|
||||
possible with \fBlvchange/vgchange -a\fP:
|
||||
.IP \fBy\fP|\fBsy\fP
|
||||
clvmd activates the LV in shared mode (with a shared lock),
|
||||
allowing multiple nodes to activate the LV concurrently.
|
||||
If the LV type prohibits shared access, such as an LV with a snapshot,
|
||||
an exclusive lock is automatically used instead.
|
||||
clvmd attempts to activate the LV concurrently on all nodes.
|
||||
.IP \fBey\fP
|
||||
clvmd activates the LV in exclusive mode (with an exclusive lock),
|
||||
allowing a single node to activate the LV.
|
||||
clvmd attempts to activate the LV concurrently on all nodes, but only
|
||||
one will succeed.
|
||||
.IP \fBly\fP
|
||||
clvmd attempts to activate the LV only on the local node.
|
||||
If the LV type allows concurrent access, then shared mode is used,
|
||||
otherwise exclusive.
|
||||
.IP \fBn\fP
|
||||
clvmd deactivates the LV on all nodes.
|
||||
.IP \fBln\fP
|
||||
clvmd deactivates the LV on the local node.
|
||||
.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.B LVM_CLVMD_BINARY
|
||||
|
212
man/dmfilemapd.8.in
Normal file
212
man/dmfilemapd.8.in
Normal file
@@ -0,0 +1,212 @@
|
||||
.TH DMFILEMAPD 8 "Dec 17 2016" "Linux" "MAINTENANCE COMMANDS"
|
||||
|
||||
.de OPT_FD
|
||||
. RB [ file_descriptor ]
|
||||
..
|
||||
.
|
||||
.de OPT_GROUP
|
||||
. RB [ group_id ]
|
||||
..
|
||||
.de OPT_PATH
|
||||
. RB [ path ]
|
||||
..
|
||||
.
|
||||
.de OPT_MODE
|
||||
. RB [ mode ]
|
||||
..
|
||||
.
|
||||
.de OPT_DEBUG
|
||||
. RB [ foreground [ verbose ] ]
|
||||
..
|
||||
.
|
||||
.SH NAME
|
||||
.
|
||||
dmfilemapd \(em device-mapper filemap monitoring daemon
|
||||
.
|
||||
.SH SYNOPSIS
|
||||
.
|
||||
.de CMD_DMFILEMAPD
|
||||
. ad l
|
||||
. IR dmfilemapd
|
||||
. OPT_FD
|
||||
. OPT_GROUP
|
||||
. OPT_PATH
|
||||
. OPT_MODE
|
||||
. OPT_DEBUG
|
||||
. ad b
|
||||
..
|
||||
.CMD_DMFILEMAPD
|
||||
.
|
||||
.PD
|
||||
.ad b
|
||||
.
|
||||
.SH DESCRIPTION
|
||||
.
|
||||
The dmfilemapd daemon monitors groups of \fIdmstats\fP regions that
|
||||
correspond to the extents of a file, adding and removing regions to
|
||||
reflect the changing state of the file on-disk.
|
||||
|
||||
The daemon is normally launched automatically by the \fPdmstats
|
||||
create\fP command, but can be run manually, either to create a new
|
||||
daemon where one did not previously exist, or to change the options
|
||||
previously used, by killing the existing daemon and starting a new
|
||||
one.
|
||||
.
|
||||
.SH OPTIONS
|
||||
.
|
||||
.HP
|
||||
.BR file_descriptor
|
||||
.br
|
||||
Specify the file descriptor number for the file to be monitored.
|
||||
The file descriptor must reference a regular file, open for reading,
|
||||
in a local file system that supports the FIEMAP ioctl, and that
|
||||
returns data describing the physical location of extents.
|
||||
|
||||
The process that executes \fBdmfilemapd\fP is responsible for
|
||||
opening the file descriptor that is handed to the daemon.
|
||||
.
|
||||
.HP
|
||||
.BR group_id
|
||||
.br
|
||||
The \fBdmstats\fP group identifier of the group that \fBdmfilemapd\fP
|
||||
should update. The group must exist and it should correspond to
|
||||
a set of regions created by a previous filemap operation.
|
||||
.
|
||||
.HP
|
||||
.BR path
|
||||
.br
|
||||
The path to the file being monitored, at the time that it was
|
||||
opened. The use of \fBpath\fP by the daemon differs, depending
|
||||
on the filemap following mode in use; see \fBMODES\fP and the
|
||||
\fBmode\fP option for more information.
|
||||
|
||||
.br
|
||||
.HP
|
||||
.BR mode
|
||||
.br
|
||||
The filemap monitoring mode the daemon should use: either "inode"
|
||||
(\fBDM_FILEMAP_FOLLOW_INODE\fP), or "path"
|
||||
(\fBDM_FILEMAP_FOLLOW_PATH\fP), to enable follow-inode or
|
||||
follow-path mode respectively.
|
||||
.
|
||||
.HP
|
||||
.BR [foreground]
|
||||
.br
|
||||
If set to 1, disable forking and allow the daemon to run in the
|
||||
foreground.
|
||||
.
|
||||
.HP
|
||||
.BR [verbose]
|
||||
Control daemon logging. If set to zero, the daemon will close all
|
||||
stdio streams and run silently. If \fBverbose\fP is a number
|
||||
between 1 and 3, stdio will be retained and the daemon will log
|
||||
messages to stdout and stderr that match the specified verbosity
|
||||
level.
|
||||
.
|
||||
.
|
||||
.SH MODES
|
||||
.
|
||||
The file map monitoring daemon can monitor files in two distinct
|
||||
ways: the mode affects the behaviour of the daemon when a file
|
||||
under monitoring is renamed or unlinked, and the conditions which
|
||||
cause the daemon to terminate.
|
||||
|
||||
In both modes, the daemon will always shut down when the group
|
||||
being monitored is deleted.
|
||||
|
||||
.P
|
||||
.B Follow inode
|
||||
.P
|
||||
The daemon follows the inode of the file, as it was at the time the
|
||||
daemon started. The file descriptor referencing the file is kept
|
||||
open at all times, and the daemon will exit when it detects that
|
||||
the file has been unlinked and it is the last holder of a reference
|
||||
to the file.
|
||||
|
||||
This mode is useful if the file is expected to be renamed, or moved
|
||||
within the file system, while it is being monitored.
|
||||
|
||||
.P
|
||||
.B Follow path
|
||||
.P
|
||||
The daemon follows the path that was given on the daemon command
|
||||
line. The file descriptor referencing the file is re-opened on each
|
||||
iteration of the daemon, and the daemon will exit if no file exists
|
||||
at this location (a tolerance is allowed so that a brief delay
|
||||
between removal and replacement is permitted).
|
||||
|
||||
This mode is useful if the file is updated by unlinking the original
|
||||
and placing a new file at the same path.
|
||||
.
|
||||
.SH LIMITATIONS
|
||||
.
|
||||
The daemon attempts to maintain good synchronisation between the file
|
||||
extents and the regions contained in the group, however, since the
|
||||
daemon can only react to new allocations once they have been written,
|
||||
there are inevitably some IO events that cannot be counted when a
|
||||
file is growing, particularly if the file is being extended by a
|
||||
single thread writing beyond EOF (for example, the \fBdd\fP program).
|
||||
|
||||
There is a further loss of events in that there is currently no way
|
||||
to atomically resize a \fBdmstats\fP region and preserve its current
|
||||
counter values. This affects files when they grow by extending the
|
||||
final extent, rather than allocating a new extent: any events that
|
||||
had accumulated in the region between any prior operation and the
|
||||
resize are lost.
|
||||
|
||||
File mapping is currently most effective in cases where the majority
|
||||
of IO does not trigger extent allocation. Future updates may address
|
||||
these limitations when kernel support is available.
|
||||
.
|
||||
.SH EXAMPLES
|
||||
.
|
||||
Normally the daemon is started automatically by the \fBdmstats\fP
|
||||
\fBcreate\fP or \fBupdate_filemap\fP commands but it can be run
|
||||
manually for debugging or testing purposes.
|
||||
.P
|
||||
Start the daemon in the background, in follow-path mode
|
||||
.br
|
||||
#
|
||||
.B dmfilemapd 3 0 vm.img path 0 0 3< vm.img
|
||||
.br
|
||||
.P
|
||||
Start the daemon in follow-inode mode, disable forking and enable
|
||||
verbose logging
|
||||
.br
|
||||
#
|
||||
.B dmfilemapd 3 0 vm.img inode 1 3 3< vm.img
|
||||
.br
|
||||
Starting dmfilemapd with fd=3, group_id=0 mode=inode, path=vm.img
|
||||
.br
|
||||
dm version [ opencount flush ] [16384] (*1)
|
||||
.br
|
||||
dm info (253:0) [ opencount flush ] [16384] (*1)
|
||||
.br
|
||||
dm message (253:0) [ opencount flush ] @stats_list dmstats [16384] (*1)
|
||||
.br
|
||||
Read alias 'vm.img' from aux_data
|
||||
.br
|
||||
Found group_id 0: alias="vm.img"
|
||||
.br
|
||||
dm_stats_walk_init: initialised flags to 4000000000000
|
||||
.br
|
||||
starting stats walk with GROUP
|
||||
.br
|
||||
exiting _filemap_monitor_get_events() with deleted=0, check=0
|
||||
.br
|
||||
waiting for FILEMAPD_WAIT
|
||||
.br
|
||||
.P
|
||||
.
|
||||
.SH AUTHORS
|
||||
.
|
||||
Bryn M. Reeves <bmr@redhat.com>
|
||||
.
|
||||
.SH SEE ALSO
|
||||
.
|
||||
.BR dmstats (8)
|
||||
|
||||
LVM2 resource page: https://www.sourceware.org/lvm2/
|
||||
.br
|
||||
Device-mapper resource page: http://sources.redhat.com/dm/
|
||||
.br
|
172
man/dmstats.8.in
172
man/dmstats.8.in
@@ -14,6 +14,9 @@
|
||||
. RB [ \-\-region ]
|
||||
. RB [ \-\-group ]
|
||||
..
|
||||
.de OPT_FOREGROUND
|
||||
. RB [ \-\-foreground ]
|
||||
..
|
||||
.
|
||||
.\" Print units suffix, use with arg to print human
|
||||
.\" man2html can't handle too many changes per command
|
||||
@@ -91,6 +94,10 @@ dmstats \(em device-mapper statistics management
|
||||
. RB [ \-\-bounds
|
||||
. IR \%histogram_boundaries ]
|
||||
. RB [ \-\-filemap ]
|
||||
. RB [ \-\-follow
|
||||
. IR follow_mode ]
|
||||
. OPT_FOREGROUND
|
||||
. RB [ \-\-nomonitor ]
|
||||
. RB [ \-\-nogroup ]
|
||||
. RB [ \-\-precise ]
|
||||
. RB [ \-\-start
|
||||
@@ -220,6 +227,9 @@ dmstats \(em device-mapper statistics management
|
||||
. RI file_path
|
||||
. RB [ \-\-groupid
|
||||
. IR id ]
|
||||
. RB [ \-\-follow
|
||||
. IR follow_mode ]
|
||||
. OPT_FOREGROUND
|
||||
. ad b
|
||||
..
|
||||
.CMD_UPDATE_FILEMAP
|
||||
@@ -319,6 +329,60 @@ create regions corresponding to the locations of the on-disk extents
|
||||
allocated to the file(s).
|
||||
.
|
||||
.HP
|
||||
.BR \-\-nomonitor
|
||||
.br
|
||||
Disable the \fBdmfilemapd\fP daemon when creating new file mapped
|
||||
groups. Normally the device-mapper filemap monitoring daemon,
|
||||
\fBdmfilemapd\fP, is started for each file mapped group to update the
|
||||
set of regions as the file changes on-disk: use of this option
|
||||
disables this behaviour.
|
||||
|
||||
Regions in the group may still be updated with the
|
||||
\fBupdate_filemap\fP command, or by starting the daemon manually.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-follow
|
||||
.IR follow_mode
|
||||
.br
|
||||
Specify the \fBdmfilemapd\fP file following mode. The file map
|
||||
monitoring daemon can monitor files in two distinct ways: the mode
|
||||
affects the behaviour of the daemon when a file under monitoring is
|
||||
renamed or unlinked, and the conditions which cause the daemon to
|
||||
terminate.
|
||||
|
||||
The \fBfollow_mode\fP argument is either "inode", for follow-inode
|
||||
mode, or "path", for follow-path.
|
||||
|
||||
If follow-inode mode is used, the daemon will hold the file open, and
|
||||
continue to update regions from the same file descriptor. This means
|
||||
that the mapping will follow rename, move (within the same file
|
||||
system), and unlink operations. This mode is useful if the file is
|
||||
expected to be moved, renamed, or unlinked while it is being
|
||||
monitored.
|
||||
|
||||
In follow-inode mode, the daemon will exit once it detects that the
|
||||
file has been unlinked and it is the last holder of a reference to it.
|
||||
|
||||
If follow-path is used, the daemon will re-open the provided path on
|
||||
each monitoring iteration. This means that the group will be updated
|
||||
to reflect a new file being moved to the same path as the original
|
||||
file. This mode is useful for files that are expected to be updated
|
||||
via unlink and rename.
|
||||
|
||||
In follow-path mode, the daemon will exit if the file is removed and
|
||||
not replaced within a brief tolerance interval.
|
||||
|
||||
In either mode, the daemon exits automatically if the monitored group
|
||||
is removed.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-foreground
|
||||
.br
|
||||
Specify that the \fBdmfilemapd\fP daemon should run in the foreground.
|
||||
The daemon will not fork into the background, and will replace the
|
||||
\fBdmstats\fP command that started it.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-groupid
|
||||
.IR id
|
||||
.br
|
||||
@@ -573,6 +637,11 @@ By default regions that map a file are placed into a group and the
|
||||
group alias is set to the basename of the file. This behaviour can be
|
||||
overridden with the \fB\-\-alias\fP and \fB\-\-nogroup\fP options.
|
||||
|
||||
Creating a group that maps a file automatically starts a daemon,
|
||||
\fBdmfilemapd\fP to monitor the file and update the mapping as the
|
||||
extents allocated to the file change. This behaviour can be disabled
|
||||
using the \fB\-\-nomonitor\fP option.
|
||||
|
||||
Use the \fB\-\-group\fP option to only display information for groups
|
||||
when listing and reporting.
|
||||
.
|
||||
@@ -683,17 +752,23 @@ The group to be removed is specified using \fB\-\-groupid\fP.
|
||||
.CMD_UPDATE_FILEMAP
|
||||
.br
|
||||
Update a group of \fBdmstats\fP regions specified by \fBgroup_id\fP,
|
||||
that were previously created with \fB\-\-filemap\fP. This will add
|
||||
and remove regions to reflect changes in the allocated extents of
|
||||
the file on-disk, since the time that it was crated or last updated.
|
||||
that were previously created with \fB\-\-filemap\fP, either directly,
|
||||
or by starting the monitoring daemon, \fBdmfilemapd\fP.
|
||||
|
||||
This will add and remove regions to reflect changes in the allocated
|
||||
extents of the file on-disk, since the time that it was crated or last
|
||||
updated.
|
||||
|
||||
Use of this command is not normally needed since the \fBdmfilemapd\fP
|
||||
daemon will automatically monitor filemap groups and perform these
|
||||
updates when required.
|
||||
|
||||
If a filemapped group was created with \fB\-\-nominitor\fP, or the
|
||||
If a filemapped group was created with \fB\-\-nomonitor\fP, or the
|
||||
daemon has been killed, the \fBupdate_filemap\fP can be used to
|
||||
manually force an update.
|
||||
manually force an update or start a new daemon.
|
||||
|
||||
Use \fB\-\-nomonitor\fP to force a direct update and disable starting
|
||||
the monitoring daemon.
|
||||
.
|
||||
.SH REGIONS, AREAS, AND GROUPS
|
||||
.
|
||||
@@ -755,6 +830,93 @@ containing device.
|
||||
The \fBgroup_id\fP should be treated as an opaque identifier used to
|
||||
reference the group.
|
||||
.
|
||||
.SH FILE MAPPING
|
||||
.
|
||||
Using \fB\-\-filemap\fP, it is possible to create regions that
|
||||
correspond to the extents of a file in the file system. This allows
|
||||
IO statistics to be monitored on a per-file basis, for example to
|
||||
observe large database files, virtual machine images, or other files
|
||||
of interest.
|
||||
|
||||
To be able to use file mapping, the file must be backed by a
|
||||
device-mapper device, and in a file system that supports the FIEMAP
|
||||
ioctl (and which returns data describing the physical location of
|
||||
extents). This currently includes \fBxfs(5)\fP and \fBext4(5)\fP.
|
||||
|
||||
By default the regions making up a file are placed together in a
|
||||
group, and the group alias is set to the \fBbasename(3)\fP of the
|
||||
file. This allows statistics to be reported for the file as a whole,
|
||||
aggregating values for the regions making up the group. To see only
|
||||
the whole file (group) when using the \fBlist\fP and \fBreport\fP
|
||||
commands, use \fB\-\-group\fP.
|
||||
|
||||
Since it is possible for the file to change after the initial
|
||||
group of regions is created, the \fBupdate_filemap\fP command, and
|
||||
\fBdmfilemapd\fP daemon are provided to update file mapped groups
|
||||
either manually or automatically.
|
||||
.
|
||||
.P
|
||||
.B File follow modes
|
||||
.P
|
||||
The file map monitoring daemon can monitor files in two distinct ways:
|
||||
follow-inode mode, and follow-path mode.
|
||||
|
||||
The mode affects the behaviour of the daemon when a file under
|
||||
monitoring is renamed or unlinked, and the conditions which cause the
|
||||
daemon to terminate.
|
||||
|
||||
If follow-inode mode is used, the daemon will hold the file open, and
|
||||
continue to update regions from the same file descriptor. This means
|
||||
that the mapping will follow rename, move (within the same file
|
||||
system), and unlink operations. This mode is useful if the file is
|
||||
expected to be moved, renamed, or unlinked while it is being
|
||||
monitored.
|
||||
|
||||
In follow-inode mode, the daemon will exit once it detects that the
|
||||
file has been unlinked and it is the last holder of a reference to it.
|
||||
|
||||
If follow-path is used, the daemon will re-open the provided path on
|
||||
each monitoring iteration. This means that the group will be updated
|
||||
to reflect a new file being moved to the same path as the original
|
||||
file. This mode is useful for files that are expected to be updated
|
||||
via unlink and rename.
|
||||
|
||||
In follow-path mode, the daemon will exit if the file is removed and
|
||||
not replaced within a brief tolerance interval (one second).
|
||||
|
||||
To stop the daemon, delete the group containing the mapped regions:
|
||||
the daemon will automatically shut down.
|
||||
|
||||
The daemon can also be safely killed at any time and the group kept:
|
||||
if the file is still being allocated the mapping will become
|
||||
progressively out-of-date as extents are added and removed (in this
|
||||
case the daemon can be re-started or the group updated manually with
|
||||
the \fBupdate_filemap\fP command).
|
||||
|
||||
See the \fBcreate\fP command and \fB\-\-filemap\fP, \fB\-\-follow\fP,
|
||||
and \fB\-\-nomonitor\fP options for further information.
|
||||
.
|
||||
.P
|
||||
.B Limitations
|
||||
.P
|
||||
The daemon attempts to maintain good synchronisation between the file
|
||||
extents and the regions contained in the group, however, since it can
|
||||
only react to new allocations once they have been written, there are
|
||||
inevitably some IO events that cannot be counted when a file is
|
||||
growing, particularly if the file is being extended by a single thread
|
||||
writing beyond end-of-file (for example, the \fBdd\fP program).
|
||||
|
||||
There is a further loss of events in that there is currently no way
|
||||
to atomically resize a \fBdmstats\fP region and preserve its current
|
||||
counter values. This affects files when they grow by extending the
|
||||
final extent, rather than allocating a new extent: any events that
|
||||
had accumulated in the region between any prior operation and the
|
||||
resize are lost.
|
||||
|
||||
File mapping is currently most effective in cases where the majority
|
||||
of IO does not trigger extent allocation. Future updates may address
|
||||
these limitations when kernel support is available.
|
||||
.
|
||||
.SH REPORT FIELDS
|
||||
.
|
||||
The dmstats report provides several types of field that may be added to
|
||||
|
491
man/lvchange.8.in
Normal file
491
man/lvchange.8.in
Normal file
@@ -0,0 +1,491 @@
|
||||
.TH LVCHANGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
|
||||
.de UNITS
|
||||
..
|
||||
|
||||
.
|
||||
.SH NAME
|
||||
.
|
||||
lvchange \(em change attributes of a logical volume
|
||||
.
|
||||
.SH SYNOPSIS
|
||||
.
|
||||
.ad l
|
||||
.B lvchange
|
||||
.RB [ \-a | \-\-activate
|
||||
.RB [ a ][ e | s | l ]{ y | n }]
|
||||
.RB [ \-\-activationmode
|
||||
.RB { complete | degraded | partial }]
|
||||
.RB [ \-\-addtag
|
||||
.IR Tag ]
|
||||
.RB [ \-K | \-\-ignoreactivationskip ]
|
||||
.RB [ \-k | \-\-setactivationskip
|
||||
.RB { y | n }]
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RB { y | n }]
|
||||
.RB [ \-\-rebuild
|
||||
.IR PhysicalVolume ]
|
||||
.RB [ \-\-cachemode
|
||||
.RB { passthrough | writeback | writethrough }]
|
||||
.RB [ \-\-cachepolicy
|
||||
.IR Policy ]
|
||||
.RB [ \-\-cachesettings
|
||||
.IR Key \fB= Value ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-C | \-\-contiguous
|
||||
.RB { y | n }]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-\-deltag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-detachprofile ]
|
||||
.RB [ \-\-discards
|
||||
.RB { ignore | nopassdown | passdown }]
|
||||
.RB [ \-\-errorwhenfull
|
||||
.RB { y | n }]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB \%[ \-\-ignorelockingfailure ]
|
||||
.RB \%[ \-\-ignoremonitoring ]
|
||||
.RB \%[ \-\-ignoreskippedcluster ]
|
||||
.RB \%[ \-\-metadataprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\-monitor
|
||||
.RB { y | n }]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-p | \-\-permission
|
||||
.RB { r | rw }]
|
||||
.RB [ \-M | \-\-persistent
|
||||
.RB { y | n }
|
||||
.RB [ \-\-major
|
||||
.IR Major ]
|
||||
.RB [ \-\-minor
|
||||
.IR Minor ]]
|
||||
.RB [ \-\-poll
|
||||
.RB { y | n }]
|
||||
.RB [ \-\- [ raid ] maxrecoveryrate
|
||||
.IR Rate ]
|
||||
.RB [ \-\- [ raid ] minrecoveryrate
|
||||
.IR Rate ]
|
||||
.RB [ \-\- [ raid ] syncaction
|
||||
.RB { check | repair }]
|
||||
.RB [ \-\- [ raid ] writebehind
|
||||
.IR IOCount ]
|
||||
.RB [ \-\- [ raid ] writemostly
|
||||
.BR \fIPhysicalVolume [ : { y | n | t }]]
|
||||
.RB [ \-r | \-\-readahead
|
||||
.RB { \fIReadAheadSectors | auto | none }]
|
||||
.RB [ \-\-refresh ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-resync ]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-\-sysinit ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-Z | \-\-zero
|
||||
.RB { y | n }]
|
||||
.RI [ LogicalVolumePath ...]
|
||||
.ad b
|
||||
.
|
||||
.SH DESCRIPTION
|
||||
.
|
||||
lvchange allows you to change the attributes of a logical volume
|
||||
including making them known to the kernel ready for use.
|
||||
.
|
||||
.SH OPTIONS
|
||||
.
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.
|
||||
.HP
|
||||
.BR \-a | \-\-activate
|
||||
.RB [ a ][ e | s | l ]{ y | n }
|
||||
.br
|
||||
Controls the availability of the logical volumes for use.
|
||||
Communicates with the kernel device-mapper driver via
|
||||
libdevmapper to activate (\fB\-ay\fP) or deactivate (\fB\-an\fP) the
|
||||
logical volumes.
|
||||
.br
|
||||
Activation of a logical volume creates a symbolic link
|
||||
\fI/dev/VolumeGroupName/LogicalVolumeName\fP pointing to the device node.
|
||||
This link is removed on deactivation.
|
||||
All software and scripts should access the device through
|
||||
this symbolic link and present this as the name of the device.
|
||||
The location and name of the underlying device node may depend on
|
||||
the distribution and configuration (e.g. udev) and might change
|
||||
from release to release.
|
||||
.br
|
||||
If autoactivation option is used (\fB\-aay\fP),
|
||||
the logical volume is activated only if it matches an item in
|
||||
the \fBactivation/auto_activation_volume_list\fP
|
||||
set in \fBlvm.conf\fP(5).
|
||||
If this list is not set, then all volumes are considered for
|
||||
activation. The \fB\-aay\fP option should be also used during system
|
||||
boot so it's possible to select which volumes to activate using
|
||||
the \fBactivation/auto_activation_volume_list\fP setting.
|
||||
.br
|
||||
In a clustered VG, clvmd is used for activation, and the
|
||||
following options are possible:
|
||||
|
||||
With \fB\-aey\fP, clvmd activates the LV in exclusive mode
|
||||
(with an exclusive lock), allowing a single node to activate the LV.
|
||||
|
||||
With \fB\-asy\fP, clvmd activates the LV in shared mode
|
||||
(with a shared lock), allowing multiple nodes to activate the LV concurrently.
|
||||
If the LV type prohibits shared access, such as an LV with a snapshot,
|
||||
the '\fBs\fP' option is ignored and an exclusive lock is used.
|
||||
|
||||
With \fB\-ay\fP (no mode specified), clvmd activates the LV in shared mode
|
||||
if the LV type allows concurrent access, such as a linear LV.
|
||||
Otherwise, clvmd activates the LV in exclusive mode.
|
||||
|
||||
With \fB\-aey\fP, \fB\-asy\fP, and \fB\-ay\fP, clvmd attempts to activate the LV
|
||||
on all nodes. If exclusive mode is used, then only one of the
|
||||
nodes will be successful.
|
||||
|
||||
With \fB\-an\fP, clvmd attempts to deactivate the LV on all nodes.
|
||||
|
||||
With \fB\-aly\fP, clvmd activates the LV only on the local node, and \fB\-aln\fP
|
||||
deactivates only on the local node. If the LV type allows concurrent
|
||||
access, then shared mode is used, otherwise exclusive.
|
||||
|
||||
LVs with snapshots are always activated exclusively because they can only
|
||||
be used on one node at once.
|
||||
|
||||
For local VGs \fB\-ay\fP, \fB\-aey\fP, and \fB\-asy\fP are all equivalent.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-activationmode
|
||||
.RB { complete | degraded | partial }
|
||||
.br
|
||||
The activation mode determines whether logical volumes are allowed to
|
||||
activate when there are physical volumes missing (e.g. due to a device
|
||||
failure). \fBcomplete\fP is the most restrictive; allowing only those
|
||||
logical volumes to be activated that are not affected by the missing
|
||||
PVs. \fBdegraded\fP allows RAID logical volumes to be activated even if
|
||||
they have PVs missing. (Note that the "\fImirror\fP" segment type is not
|
||||
considered a RAID logical volume. The "\fIraid1\fP" segment type should
|
||||
be used instead.) Finally, \fBpartial\fP allows any logical volume to
|
||||
be activated even if portions are missing due to a missing or failed
|
||||
PV. This last option should only be used when performing recovery or
|
||||
repair operations. \fBdegraded\fP is the default mode. To change it,
|
||||
modify \fBactivation_mode\fP in \fBlvm.conf\fP(5).
|
||||
.
|
||||
.HP
|
||||
.BR \-K | \-\-ignoreactivationskip
|
||||
.br
|
||||
Ignore the flag to skip Logical Volumes during activation.
|
||||
.
|
||||
.HP
|
||||
.BR \-k | \-\-setactivationskip
|
||||
.RB { y | n }
|
||||
.br
|
||||
Controls whether Logical Volumes are persistently flagged to be
|
||||
skipped during activation. By default, thin snapshot volumes are
|
||||
flagged for activation skip. To activate such volumes,
|
||||
an extra \fB\-\-ignoreactivationskip\fP option must be used.
|
||||
The flag is not applied during deactivation. To see whether
|
||||
the flag is attached, use \fBlvs\fP(8) command where the state
|
||||
of the flag is reported within \fBlv_attr\fP bits.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachemode
|
||||
.RB { passthrough | writeback | writethrough }
|
||||
.br
|
||||
Specifying a cache mode determines when the writes to a cache LV
|
||||
are considered complete. When \fBwriteback\fP is specified, a write is
|
||||
considered complete as soon as it is stored in the cache pool LV.
|
||||
If \fBwritethough\fP is specified, a write is considered complete only
|
||||
when it has been stored in the cache pool LV and on the origin LV.
|
||||
While \fBwritethrough\fP may be slower for writes, it is more
|
||||
resilient if something should happen to a device associated with the
|
||||
cache pool LV. With \fBpassthrough\fP mode, all reads are served
|
||||
from origin LV (all reads miss the cache) and all writes are
|
||||
forwarded to the origin LV; additionally, write hits cause cache
|
||||
block invalidates. See \fBlvmcache(7)\fP for more details.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachepolicy
|
||||
.IR Policy ,
|
||||
.BR \-\-cachesettings
|
||||
.IR Key \fB= Value
|
||||
.br
|
||||
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
|
||||
the cache policy and its associated tunable settings. In most use-cases,
|
||||
default values should be adequate.
|
||||
.
|
||||
.HP
|
||||
.BR \-C | \-\-contiguous
|
||||
.RB { y | n }
|
||||
.br
|
||||
Tries to set or reset the contiguous allocation policy for
|
||||
logical volumes. It's only possible to change a non-contiguous
|
||||
logical volume's allocation policy to contiguous, if all of the
|
||||
allocated physical extents are already contiguous.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-detachprofile
|
||||
.br
|
||||
Detach any metadata configuration profiles attached to given
|
||||
Logical Volumes. See \fBlvm.conf\fP(5) for more information
|
||||
about metadata profiles.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-discards
|
||||
.RB { ignore | nopassdown | passdown }
|
||||
.br
|
||||
Set this to \fBignore\fP to ignore any discards received by a
|
||||
thin pool Logical Volume. Set to \fBnopassdown\fP to process such
|
||||
discards within the thin pool itself and allow the no-longer-needed
|
||||
extents to be overwritten by new data. Set to \fBpassdown\fP (the
|
||||
default) to process them both within the thin pool itself and to
|
||||
pass them down the underlying device.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-errorwhenfull
|
||||
.RB { y | n }
|
||||
.br
|
||||
Sets thin pool behavior when data space is exhaused. See
|
||||
.BR lvcreate (8)
|
||||
for information.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-ignoremonitoring
|
||||
.br
|
||||
Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
|
||||
is specified.
|
||||
Do not use this if dmeventd is already monitoring a device.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-major
|
||||
.IR Major
|
||||
.br
|
||||
Sets the major number. This option is supported only on older systems
|
||||
(kernel version 2.4) and is ignored on modern Linux systems where major
|
||||
numbers are dynamically assigned.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-minor
|
||||
.IR Minor
|
||||
.br
|
||||
Set the minor number.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-metadataprofile
|
||||
.IR ProfileName
|
||||
.br
|
||||
Uses and attaches \fIProfileName\fP configuration profile to the logical
|
||||
volume metadata. Whenever the logical volume is processed next time,
|
||||
the profile is automatically applied. If the volume group has another
|
||||
profile attached, the logical volume profile is preferred.
|
||||
See \fBlvm.conf\fP(5) for more information about metadata profiles.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-monitor
|
||||
.RB { y | n }
|
||||
.br
|
||||
Start or stop monitoring a mirrored or snapshot logical volume with
|
||||
dmeventd, if it is installed.
|
||||
If a device used by a monitored mirror reports an I/O error,
|
||||
the failure is handled according to
|
||||
\%\fBmirror_image_fault_policy\fP and \fBmirror_log_fault_policy\fP
|
||||
set in \fBlvm.conf\fP(5).
|
||||
.
|
||||
.HP
|
||||
.BR \-\-noudevsync
|
||||
.br
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.
|
||||
.HP
|
||||
.BR \-p | \-\-permission
|
||||
.RB { r | rw }
|
||||
.br
|
||||
Change access permission to read-only or read/write.
|
||||
.
|
||||
.HP
|
||||
.BR \-M | \-\-persistent
|
||||
.RB { y | n }
|
||||
.br
|
||||
Set to \fBy\fP to make the minor number specified persistent.
|
||||
Change of persistent numbers is not supported for pool volumes.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-poll
|
||||
.RB { y | n }
|
||||
.br
|
||||
Without polling a logical volume's backgrounded transformation process
|
||||
will never complete. If there is an incomplete pvmove or lvconvert (for
|
||||
example, on rebooting after a crash), use \fB\-\-poll y\fP to restart the
|
||||
process from its last checkpoint. However, it may not be appropriate to
|
||||
immediately poll a logical volume when it is activated, use
|
||||
\fB\-\-poll n\fP to defer and then \fB\-\-poll y\fP to restart the process.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] rebuild
|
||||
.BR \fIPhysicalVolume
|
||||
.br
|
||||
Option can be repeated multiple times.
|
||||
Selects PhysicalVolume(s) to be rebuild in a RaidLV.
|
||||
Use this option instead of
|
||||
.BR \-\-resync
|
||||
or
|
||||
.BR \-\- [ raid ] syncaction
|
||||
\fBrepair\fP in case the PVs with corrupted data are known and their data
|
||||
should be reconstructed rather than reconstructing default (rotating) data.
|
||||
.br
|
||||
E.g. in a raid1 mirror, the master leg on /dev/sda may hold corrupt data due
|
||||
to a known transient disk error, thus
|
||||
.br
|
||||
\fBlvchange --rebuild /dev/sda LV\fP
|
||||
.br
|
||||
will request the master leg to be rebuild rather than rebuilding
|
||||
all other legs from the master.
|
||||
On a raid5 with rotating data and parity
|
||||
.br
|
||||
\fBlvchange --rebuild /dev/sda LV\fP
|
||||
.br
|
||||
will rebuild all data and parity blocks in the stripe on /dev/sda.
|
||||
.HP
|
||||
.BR \-\- [ raid ] maxrecoveryrate
|
||||
.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
|
||||
.br
|
||||
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
|
||||
is specified as an amount per second for each device in the array.
|
||||
If no suffix is given, then KiB/sec/device is assumed. Setting the
|
||||
recovery rate to \fB0\fP means it will be unbounded.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] minrecoveryrate
|
||||
.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
|
||||
.br
|
||||
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
|
||||
is specified as an amount per second for each device in the array.
|
||||
If no suffix is given, then KiB/sec/device is assumed. Setting the
|
||||
recovery rate to \fB0\fP means it will be unbounded.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] syncaction
|
||||
.RB { check | repair }
|
||||
.br
|
||||
This argument is used to initiate various RAID synchronization operations.
|
||||
The \fBcheck\fP and \fBrepair\fP options provide a way to check the
|
||||
integrity of a RAID logical volume (often referred to as "scrubbing").
|
||||
These options cause the RAID logical volume to
|
||||
read all of the data and parity blocks in the array and check for any
|
||||
discrepancies (e.g. mismatches between mirrors or incorrect parity values).
|
||||
If \fBcheck\fP is used, the discrepancies will be counted but not repaired.
|
||||
If \fBrepair\fP is used, the discrepancies will be corrected as they are
|
||||
encountered. The \fBlvs\fP(8) command can be used to show the number of
|
||||
discrepancies found or repaired.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] writebehind
|
||||
.IR IOCount
|
||||
.br
|
||||
Specify the maximum number of outstanding writes that are allowed to
|
||||
devices in a RAID1 logical volume that are marked as write-mostly.
|
||||
Once this value is exceeded, writes become synchronous (i.e. all writes
|
||||
to the constituent devices must complete before the array signals the
|
||||
write has completed). Setting the value to zero clears the preference
|
||||
and allows the system to choose the value arbitrarily.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] writemostly
|
||||
.BR \fIPhysicalVolume [ : { y | n | t }]
|
||||
.br
|
||||
Mark a device in a RAID1 logical volume as write-mostly. All reads
|
||||
to these drives will be avoided unless absolutely necessary. This keeps
|
||||
the number of I/Os to the drive to a minimum. The default behavior is to
|
||||
set the write-mostly attribute for the specified physical volume in the
|
||||
logical volume. It is possible to also remove the write-mostly flag by
|
||||
appending a "\fB:n\fP" to the physical volume or to toggle the value by specifying
|
||||
"\fB:t\fP". The \fB\-\-writemostly\fP argument can be specified more than one time
|
||||
in a single command; making it possible to toggle the write-mostly attributes
|
||||
for all the physical volumes in a logical volume at once.
|
||||
.
|
||||
.HP
|
||||
.BR \-r | \-\-readahead
|
||||
.RB { \fIReadAheadSectors | auto | none }
|
||||
.br
|
||||
Set read ahead sector count of this logical volume.
|
||||
For volume groups with metadata in lvm1 format, this must
|
||||
be a value between 2 and 120 sectors.
|
||||
The default value is "\fBauto\fP" which allows the kernel to choose
|
||||
a suitable value automatically.
|
||||
"\fBnone\fP" is equivalent to specifying zero.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-refresh
|
||||
.br
|
||||
If the logical volume is active, reload its metadata.
|
||||
This is not necessary in normal operation, but may be useful
|
||||
if something has gone wrong or if you're doing clustering
|
||||
manually without a clustered lock manager.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-resync
|
||||
.br
|
||||
Forces the complete resynchronization of a mirror. In normal
|
||||
circumstances you should not need this option because synchronization
|
||||
happens automatically. Data is read from the primary mirror device
|
||||
and copied to the others, so this can take a considerable amount of
|
||||
time - and during this time you are without a complete redundant copy
|
||||
of your data.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-sysinit
|
||||
.br
|
||||
Indicates that \fBlvchange\fP(8) is being invoked from early system
|
||||
initialisation scripts (e.g. rc.sysinit or an initrd),
|
||||
before writeable filesystems are available. As such,
|
||||
some functionality needs to be disabled and this option
|
||||
acts as a shortcut which selects an appropriate set of options. Currently
|
||||
this is equivalent to using \fB\-\-ignorelockingfailure\fP,
|
||||
\fB\-\-ignoremonitoring\fP, \fB\-\-poll n\fP and setting
|
||||
\fBLVM_SUPPRESS_LOCKING_FAILURE_MESSAGES\fP
|
||||
environment variable.
|
||||
|
||||
If \fB\-\-sysinit\fP is used in conjunction with
|
||||
\fBlvmetad\fP(8) enabled and running,
|
||||
autoactivation is preferred over manual activation via direct lvchange call.
|
||||
Logical volumes are autoactivated according to
|
||||
\fBauto_activation_volume_list\fP set in \fBlvm.conf\fP(5).
|
||||
.
|
||||
.HP
|
||||
.BR \-Z | \-\-zero
|
||||
.RB { y | n }
|
||||
.br
|
||||
Set zeroing mode for thin pool. Note: already provisioned blocks from pool
|
||||
in non-zero mode are not cleared in unwritten parts when setting zero to
|
||||
\fBy\fP.
|
||||
.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.
|
||||
.TP
|
||||
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
|
||||
Suppress locking failure messages.
|
||||
.
|
||||
.SH Examples
|
||||
.
|
||||
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
|
||||
.sp
|
||||
.B lvchange \-pr vg00/lvol1
|
||||
.
|
||||
.SH SEE ALSO
|
||||
.
|
||||
.nh
|
||||
.BR lvm (8),
|
||||
.BR lvmetad (8),
|
||||
.BR lvs (8),
|
||||
.BR lvcreate (8),
|
||||
.BR vgchange (8),
|
||||
.BR lvmcache (7),
|
||||
.BR lvmthin (7),
|
||||
.BR lvm.conf (5)
|
1199
man/lvconvert.8.in
Normal file
1199
man/lvconvert.8.in
Normal file
File diff suppressed because it is too large
Load Diff
914
man/lvcreate.8.in
Normal file
914
man/lvcreate.8.in
Normal file
@@ -0,0 +1,914 @@
|
||||
.TH LVCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.
|
||||
.\" Use 1st. parameter with \% to fix 'man2html' rendeing on same line!
|
||||
.de SIZE_G
|
||||
. IR \\$1 \c
|
||||
. RB [ b | B | s | S | k | K | m | M | g | G ]
|
||||
..
|
||||
.de SIZE_E
|
||||
. IR \\$1 \c
|
||||
. RB [ b | B | s | S | k | K | m | M | \c
|
||||
. BR g | G | t | T | p | P | e | E ]
|
||||
..
|
||||
.
|
||||
.SH NAME
|
||||
.
|
||||
lvcreate \- create a logical volume in an existing volume group
|
||||
.
|
||||
.SH SYNOPSIS
|
||||
.
|
||||
.ad l
|
||||
.B lvcreate
|
||||
.RB [ \-a | \-\-activate
|
||||
.RB [ a ][ e | l | s ]{ y | n }]
|
||||
.RB [ \-\-addtag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-alloc
|
||||
.IR Allocation\%Policy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RB { y | n }]
|
||||
.RB [ \-H | \-\-cache ]
|
||||
.RB [ \-\-cachemode
|
||||
.RB { passthrough | writeback | writethrough }]
|
||||
.RB [ \-\-cachepolicy
|
||||
.IR Policy ]
|
||||
.RB \%[ \-\-cachepool
|
||||
.IR CachePoolLogicalVolume ]
|
||||
.RB [ \-\-cachesettings
|
||||
.IR Key \fB= Value ]
|
||||
.RB [ \-c | \-\-chunksize
|
||||
.IR ChunkSize ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB \%[ \-C | \-\-contiguous
|
||||
.RB { y | n }]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-\-discards
|
||||
.RB \%{ ignore | nopassdown | passdown }]
|
||||
.RB [ \-\-errorwhenfull
|
||||
.RB { y | n }]
|
||||
.RB [{ \-l | \-\-extents
|
||||
.BR \fILogicalExtents\%Number [ % { FREE | PVS | VG }]
|
||||
.RB |
|
||||
.BR \-L | \-\-size
|
||||
.BR \fILogicalVolumeSize }
|
||||
.RB [ \-i | \-\-stripes
|
||||
.IR Stripes
|
||||
.RB [ \-I | \-\-stripesize
|
||||
.IR StripeSize ]]]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-K | \-\-ignoreactivationskip ]
|
||||
.RB [ \-\-ignoremonitoring ]
|
||||
.RB [ \-\-minor
|
||||
.IR Minor
|
||||
.RB [ \-j | \-\-major
|
||||
.IR Major ]]
|
||||
.RB [ \-\-metadataprofile
|
||||
.IR Profile\%Name ]
|
||||
.RB [ \-m | \-\-mirrors
|
||||
.IR Mirrors
|
||||
.RB [ \-\-corelog | \-\-mirrorlog
|
||||
.RB { disk | core | mirrored }]
|
||||
.RB [ \-\-nosync ]
|
||||
.RB [ \-R | \-\-regionsize
|
||||
.BR \fIMirrorLogRegionSize ]]
|
||||
.RB [ \-\-monitor
|
||||
.RB { y | n }]
|
||||
.RB [ \-n | \-\-name
|
||||
.IR Logical\%Volume ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-p | \-\-permission
|
||||
.RB { r | rw }]
|
||||
.RB [ \-M | \-\-persistent
|
||||
.RB { y | n }]
|
||||
.\" .RB [ \-\-pooldatasize
|
||||
.\" .I DataVolumeSize
|
||||
.RB \%[ \-\-poolmetadatasize
|
||||
.IR MetadataVolumeSize ]
|
||||
.RB [ \-\-poolmetadataspare
|
||||
.RB { y | n }]
|
||||
.RB [ \-\- [ raid ] maxrecoveryrate
|
||||
.IR Rate ]
|
||||
.RB [ \-\- [ raid ] minrecoveryrate
|
||||
.IR Rate ]
|
||||
.RB [ \-r | \-\-readahead
|
||||
.RB { \fIReadAheadSectors | auto | none }]
|
||||
.RB [ \-\-reportformat
|
||||
.RB {basic | json}]
|
||||
.RB \%[ \-k | \-\-setactivationskip
|
||||
.RB { y | n }]
|
||||
.RB [ \-s | \-\-snapshot ]
|
||||
.RB [ \-V | \-\-virtualsize
|
||||
.IR VirtualSize ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-T | \-\-thin ]
|
||||
.RB [ \-\-thinpool
|
||||
.IR ThinPoolLogicalVolume ]
|
||||
.RB [ \-\-type
|
||||
.IR SegmentType ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-W | \-\-wipesignatures
|
||||
.RB { y | n }]
|
||||
.RB [ \-Z | \-\-zero
|
||||
.RB { y | n }]
|
||||
.RI [ VolumeGroup
|
||||
.RI |
|
||||
.RI \%{ ExternalOrigin | Origin | Pool } LogicalVolume
|
||||
.RI \%[ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]]
|
||||
.LP
|
||||
.B lvcreate
|
||||
.RB [ \-l | \-\-extents
|
||||
.BR \fILogicalExtentsNumber [ % { FREE | ORIGIN | PVS | VG }]
|
||||
|
|
||||
.BR \-L | \-\-size
|
||||
.\" | \-\-pooldatasize
|
||||
.IR LogicalVolumeSize ]
|
||||
.RB [ \-c | \-\-chunksize
|
||||
.IR ChunkSize ]
|
||||
.RB \%[ \-\-commandprofile
|
||||
.IR Profile\%Name ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-ignoremonitoring ]
|
||||
.RB [ \-\-metadataprofile
|
||||
.IR Profile\%Name ]
|
||||
.RB \%[ \-\-monitor
|
||||
.RB { y | n }]
|
||||
.RB [ \-n | \-\-name
|
||||
.IR SnapshotLogicalVolumeName ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB {basic | json}]
|
||||
.BR \-s | \-\-snapshot | \-H | \-\-cache
|
||||
.RI \%{[ VolumeGroup \fB/\fP] OriginalLogicalVolume
|
||||
.RB \%[ \-V | \-\-virtualsize
|
||||
.IR VirtualSize ]}
|
||||
.ad b
|
||||
.
|
||||
.SH DESCRIPTION
|
||||
.
|
||||
lvcreate creates a new logical volume in a volume group (see
|
||||
.BR vgcreate "(8), " vgchange (8))
|
||||
by allocating logical extents from the free physical extent pool
|
||||
of that volume group. If there are not enough free physical extents then
|
||||
the volume group can be extended (see
|
||||
.BR vgextend (8))
|
||||
with other physical volumes or by reducing existing logical volumes
|
||||
of this volume group in size (see
|
||||
.BR lvreduce (8)).
|
||||
If you specify one or more PhysicalVolumes, allocation of physical
|
||||
extents will be restricted to these volumes.
|
||||
.br
|
||||
.br
|
||||
The second form supports the creation of snapshot logical volumes which
|
||||
keep the contents of the original logical volume for backup purposes.
|
||||
.
|
||||
.SH OPTIONS
|
||||
.
|
||||
See
|
||||
.BR lvm (8)
|
||||
for common options.
|
||||
.
|
||||
.HP
|
||||
.BR \-a | \-\-activate
|
||||
.RB [ a ][ l | e | s ]{ y | n }
|
||||
.br
|
||||
Controls the availability of the Logical Volumes for immediate use after
|
||||
the command finishes running.
|
||||
By default, new Logical Volumes are activated (\fB\-ay\fP).
|
||||
If it is possible technically, \fB\-an\fP will leave the new Logical
|
||||
Volume inactive. But for example, snapshots of active origin can only be
|
||||
created in the active state so \fB\-an\fP cannot be used with
|
||||
\fB-\-type snapshot\fP. This does not apply to thin volume snapshots,
|
||||
which are by default created with flag to skip their activation
|
||||
(\fB-ky\fP).
|
||||
Normally the \fB\-\-zero n\fP argument has to be supplied too because
|
||||
zeroing (the default behaviour) also requires activation.
|
||||
If autoactivation option is used (\fB\-aay\fP), the logical volume is
|
||||
activated only if it matches an item in the
|
||||
\fBactivation/auto_activation_volume_list\fP
|
||||
set in \fBlvm.conf\fP(5).
|
||||
For autoactivated logical volumes, \fB\-\-zero n\fP and
|
||||
\fB\-\-wipesignatures n\fP is always assumed and it can't
|
||||
be overridden. If the clustered locking is enabled,
|
||||
\fB\-aey\fP will activate exclusively on one node and
|
||||
.BR \-a { a | l } y
|
||||
will activate only on the local node.
|
||||
.
|
||||
.HP
|
||||
.BR \-H | \-\-cache
|
||||
.br
|
||||
Creates cache or cache pool logical volume.
|
||||
.\" or both.
|
||||
Specifying the optional argument \fB\-\-extents\fP or \fB\-\-size\fP
|
||||
will cause the creation of the cache logical volume.
|
||||
.\" Specifying the optional argument \fB\-\-pooldatasize\fP will cause
|
||||
.\" the creation of the cache pool logical volume.
|
||||
.\" Specifying both arguments will cause the creation of cache with its
|
||||
.\" cache pool volume.
|
||||
When the Volume group name is specified together with existing logical volume
|
||||
name which is NOT a cache pool name, such volume is treated
|
||||
as cache origin volume and cache pool is created. In this case the
|
||||
\fB\-\-extents\fP or \fB\-\-size\fP is used to specify size of cache pool volume.
|
||||
See \fBlvmcache\fP(7) for more info about caching support.
|
||||
Note that the cache segment type requires a dm-cache kernel module version
|
||||
1.3.0 or greater.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachemode
|
||||
.RB { passthrough | writeback | writethrough }
|
||||
.br
|
||||
Specifying a cache mode determines when the writes to a cache LV
|
||||
are considered complete. When \fBwriteback\fP is specified, a write is
|
||||
considered complete as soon as it is stored in the cache pool LV.
|
||||
If \fBwritethough\fP is specified, a write is considered complete only
|
||||
when it has been stored in the cache pool LV and on the origin LV.
|
||||
While \fBwritethrough\fP may be slower for writes, it is more
|
||||
resilient if something should happen to a device associated with the
|
||||
cache pool LV. With \fBpassthrough\fP mode, all reads are served
|
||||
from origin LV (all reads miss the cache) and all writes are
|
||||
forwarded to the origin LV; additionally, write hits cause cache
|
||||
block invalidates. See \fBlvmcache(7)\fP for more details.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachepolicy
|
||||
.IR Policy
|
||||
.br
|
||||
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
|
||||
the cache policy. \fBmq\fP is the basic policy name. \fBsmq\fP is more advanced
|
||||
version available in newer kernels.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachepool
|
||||
.IR CachePoolLogicalVolume { Name | Path }
|
||||
.br
|
||||
Specifies the name of cache pool volume name. The other way to specify pool name
|
||||
is to append name to Volume group name argument.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-cachesettings
|
||||
.IB Key = Value
|
||||
.br
|
||||
Only applicable to cached LVs; see also \fBlvmcache(7)\fP. Sets
|
||||
the cache tunable settings. In most use-cases, default values should be adequate.
|
||||
Special string value \fBdefault\fP switches setting back to its default kernel value
|
||||
and removes it from the list of settings stored in lvm2 metadata.
|
||||
.
|
||||
.HP
|
||||
.BR \-c | \-\-chunksize
|
||||
.SIZE_G \%ChunkSize
|
||||
.br
|
||||
Gives the size of chunk for snapshot, cache pool and thin pool logical volumes.
|
||||
Default unit is in kilobytes.
|
||||
.br
|
||||
For snapshots the value must be power of 2 between 4KiB and 512KiB
|
||||
and the default value is 4KiB.
|
||||
.br
|
||||
For cache pools the value must a multiple of 32KiB
|
||||
between 32KiB and 1GiB. The default is 64KiB.
|
||||
When the size is specified with volume caching, it may not be smaller
|
||||
than cache pool creation chunk size was.
|
||||
.br
|
||||
For thin pools the value must be a multiple of 64KiB
|
||||
between 64KiB and 1GiB.
|
||||
Default value starts with 64KiB and grows up to
|
||||
fit the pool metadata size within 128MiB,
|
||||
if the pool metadata size is not specified.
|
||||
See
|
||||
.BR lvm.conf (5)
|
||||
setting \fBallocation/thin_pool_chunk_size_policy\fP
|
||||
to select different calculation policy.
|
||||
Thin pool target version <1.4 requires this value to be a power of 2.
|
||||
For target version <1.5 discard is not supported for non power of 2 values.
|
||||
.
|
||||
.HP
|
||||
.BR \-C | \-\-contiguous
|
||||
.RB { y | n }
|
||||
.br
|
||||
Sets or resets the contiguous allocation policy for
|
||||
logical volumes. Default is no contiguous allocation based
|
||||
on a next free principle.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-corelog
|
||||
.br
|
||||
This is shortcut for option \fB\-\-mirrorlog core\fP.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-discards
|
||||
.RB { ignore | nopassdown | passdown }
|
||||
.br
|
||||
Sets discards behavior for thin pool.
|
||||
Default is \fBpassdown\fP.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-errorwhenfull
|
||||
.RB { y | n }
|
||||
.br
|
||||
Configures thin pool behaviour when data space is exhausted.
|
||||
Default is \fBn\fPo.
|
||||
Device will queue I/O operations until target timeout
|
||||
(see dm-thin-pool kernel module option \fPno_space_timeout\fP)
|
||||
expires. Thus configured system has a time to i.e. extend
|
||||
the size of thin pool data device.
|
||||
When set to \fBy\fPes, the I/O operation is immeditelly errored.
|
||||
.
|
||||
.HP
|
||||
.BR \-K | \-\-ignoreactivationskip
|
||||
.br
|
||||
Ignore the flag to skip Logical Volumes during activation.
|
||||
Use \fB\-\-setactivationskip\fP option to set or reset
|
||||
activation skipping flag persistently for logical volume.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-ignoremonitoring
|
||||
.br
|
||||
Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
|
||||
is specified.
|
||||
.
|
||||
.HP
|
||||
.BR -l | \-\-extents
|
||||
.IR LogicalExtentsNumber \c
|
||||
.RB [ % { VG | PVS | FREE | ORIGIN }]
|
||||
.br
|
||||
Specifies the size of the new LV in logical extents. The number of
|
||||
physical extents allocated may be different, and depends on the LV type.
|
||||
Certain LV types require more physical extents for data redundancy or
|
||||
metadata. An alternate syntax allows the size to be determined indirectly
|
||||
as a percentage of the size of a related VG, LV, or set of PVs. The
|
||||
suffix \fB%VG\fP denotes the total size of the VG, the suffix \fB%FREE\fP
|
||||
the remaining free space in the VG, and the suffix \fB%PVS\fP the free
|
||||
space in the specified Physical Volumes. For a snapshot, the size
|
||||
can be expressed as a percentage of the total size of the Origin Logical
|
||||
Volume with the suffix \fB%ORIGIN\fP (\fB100%ORIGIN\fP provides space for
|
||||
the whole origin).
|
||||
When expressed as a percentage, the size defines an upper limit for the
|
||||
number of logical extents in the new LV. The precise number of logical
|
||||
extents in the new LV is not determined until the command has completed.
|
||||
.
|
||||
.HP
|
||||
.BR \-j | \-\-major
|
||||
.IR Major
|
||||
.br
|
||||
Sets the major number.
|
||||
Major numbers are not supported with pool volumes.
|
||||
This option is supported only on older systems
|
||||
(kernel version 2.4) and is ignored on modern Linux systems where major
|
||||
numbers are dynamically assigned.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-metadataprofile
|
||||
.IR ProfileName
|
||||
.br
|
||||
Uses and attaches the \fIProfileName\fP configuration profile to the logical
|
||||
volume metadata. Whenever the logical volume is processed next time,
|
||||
the profile is automatically applied. If the volume group has another
|
||||
profile attached, the logical volume profile is preferred.
|
||||
See \fBlvm.conf\fP(5) for more information about \fBmetadata profiles\fP.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-minor
|
||||
.IR Minor
|
||||
.br
|
||||
Sets the minor number.
|
||||
Minor numbers are not supported with pool volumes.
|
||||
.
|
||||
.HP
|
||||
.BR \-m | \-\-mirrors
|
||||
.IR mirrors
|
||||
.br
|
||||
Creates a mirrored logical volume with \fImirrors\fP copies.
|
||||
For example, specifying \fB\-m 1\fP
|
||||
would result in a mirror with two-sides; that is,
|
||||
a linear volume plus one copy.
|
||||
|
||||
Specifying the optional argument \fB\-\-nosync\fP will cause the creation
|
||||
of the mirror LV to skip the initial resynchronization. Any data written
|
||||
afterwards will be mirrored, but the original contents will not be copied.
|
||||
|
||||
This is useful for skipping a potentially long and resource intensive initial
|
||||
sync of an empty mirrored RaidLV.
|
||||
|
||||
There are two implementations of mirroring which can be used and correspond
|
||||
to the "\fIraid1\fP" and "\fImirror\fP" segment types.
|
||||
The default is "\fIraid1\fP". See the
|
||||
\fB\-\-type\fP option for more information if you would like to use the
|
||||
legacy "\fImirror\fP" segment type. See
|
||||
.BR lvm.conf (5)
|
||||
settings \fB global/mirror_segtype_default\fP
|
||||
and \fBglobal/raid10_segtype_default\fP
|
||||
to configure default mirror segment type.
|
||||
The options
|
||||
\fB\-\-mirrorlog\fP and \fB\-\-corelog\fP apply
|
||||
to the legacy "\fImirror\fP" segment type only.
|
||||
|
||||
Note the current maxima for mirrors are 7 for "mirror" providing
|
||||
8 mirror legs and 9 for "raid1" providing 10 legs.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-mirrorlog
|
||||
.RB { disk | core | mirrored }
|
||||
.br
|
||||
Specifies the type of log to be used for logical volumes utilizing
|
||||
the legacy "\fImirror\fP" segment type.
|
||||
.br
|
||||
The default is \fBdisk\fP, which is persistent and requires
|
||||
a small amount of storage space, usually on a separate device from the
|
||||
data being mirrored.
|
||||
.br
|
||||
Using \fBcore\fP means the mirror is regenerated by copying the data
|
||||
from the first device each time the logical volume is activated,
|
||||
like after every reboot.
|
||||
.br
|
||||
Using \fBmirrored\fP will create a persistent log that is itself mirrored.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-monitor
|
||||
.RB { y | n }
|
||||
.br
|
||||
Starts or avoids monitoring a mirrored, snapshot or thin pool logical volume with
|
||||
dmeventd, if it is installed.
|
||||
If a device used by a monitored mirror reports an I/O error,
|
||||
the failure is handled according to
|
||||
\fBactivation/mirror_image_fault_policy\fP
|
||||
and \fBactivation/mirror_log_fault_policy\fP
|
||||
set in \fBlvm.conf\fP(5).
|
||||
.
|
||||
.HP
|
||||
.BR \-n | \-\-name
|
||||
.IR LogicalVolume { Name | Path }
|
||||
.br
|
||||
Sets the name for the new logical volume.
|
||||
.br
|
||||
Without this option a default name of "lvol#" will be generated where
|
||||
# is the LVM internal number of the logical volume.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-nosync
|
||||
.br
|
||||
Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the
|
||||
initial resynchronization. In case of mirror, raid1 and raid10, any data
|
||||
written afterwards will be mirrored, but the original contents will not be
|
||||
copied. In case of raid4 and raid5, no parity blocks will be written,
|
||||
though any data written afterwards will cause parity blocks to be stored.
|
||||
.br
|
||||
This is useful for skipping a potentially long and resource intensive initial
|
||||
sync of an empty mirror/raid1/raid4/raid5 and raid10 LV.
|
||||
.br
|
||||
This option is not valid for raid6, because raid6 relies on proper parity
|
||||
(P and Q Syndromes) being created during initial synchronization in order
|
||||
to reconstruct proper user date in case of device failures.
|
||||
|
||||
raid0 and raid0_meta don't provide any data copies or parity support
|
||||
and thus don't support initial resynchronization.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-noudevsync
|
||||
.br
|
||||
Disables udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.
|
||||
.HP
|
||||
.BR \-p | \-\-permission
|
||||
.RB { r | rw }
|
||||
.br
|
||||
Sets access permissions to read only (\fBr\fP) or read and write (\fBrw\fP).
|
||||
.br
|
||||
Default is read and write.
|
||||
.
|
||||
.HP
|
||||
.BR \-M | \-\-persistent
|
||||
.RB { y | n }
|
||||
.br
|
||||
Set to \fBy\fP to make the minor number specified persistent.
|
||||
Pool volumes cannot have persistent major and minor numbers.
|
||||
Defaults to \fBy\fPes only when major or minor number is specified.
|
||||
Otherwise it is \fBn\fPo.
|
||||
.\" .HP
|
||||
.\" .IR \fB\-\-pooldatasize " " PoolDataVolumeSize [ bBsSkKmMgGtTpPeE ]
|
||||
.\" Sets the size of pool's data logical volume.
|
||||
.\" For thin pools you may also specify the size
|
||||
.\" with the option \fB\-\-size\fP.
|
||||
.\"
|
||||
.
|
||||
.HP
|
||||
.BR \-\-poolmetadatasize
|
||||
.SIZE_G \%MetadataVolumeSize
|
||||
.br
|
||||
Sets the size of pool's metadata logical volume.
|
||||
Supported values are in range between 2MiB and 16GiB for thin pool,
|
||||
and upto 16GiB for cache pool. The minimum value is computed from pool's
|
||||
data size.
|
||||
Default value for thin pool is (Pool_LV_size / Pool_LV_chunk_size * 64b).
|
||||
To work with a thin pool, there should be at least 25% of free space
|
||||
when the size of metadata is smaller then 16MiB,
|
||||
or at least 4MiB of free space otherwise.
|
||||
Default unit is megabytes.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-poolmetadataspare
|
||||
.RB { y | n }
|
||||
.br
|
||||
Controls creation and maintanence of pool metadata spare logical volume
|
||||
that will be used for automated pool recovery.
|
||||
Only one such volume is maintained within a volume group
|
||||
with the size of the biggest pool metadata volume.
|
||||
Default is \fBy\fPes.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] maxrecoveryrate
|
||||
.SIZE_G \%Rate
|
||||
.br
|
||||
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
|
||||
is specified as an amount per second for each device in the array.
|
||||
If no suffix is given, then KiB/sec/device is assumed. Setting the
|
||||
recovery rate to 0 means it will be unbounded.
|
||||
.
|
||||
.HP
|
||||
.BR \-\- [ raid ] minrecoveryrate
|
||||
.SIZE_G \%Rate
|
||||
.br
|
||||
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
|
||||
is specified as an amount per second for each device in the array.
|
||||
If no suffix is given, then KiB/sec/device is assumed. Setting the
|
||||
recovery rate to 0 means it will be unbounded.
|
||||
.
|
||||
.HP
|
||||
.BR \-r | \-\-readahead
|
||||
.RB { \fIReadAheadSectors | auto | none }
|
||||
.br
|
||||
Sets read ahead sector count of this logical volume.
|
||||
For volume groups with metadata in lvm1 format, this must
|
||||
be a value between 2 and 120.
|
||||
The default value is \fBauto\fP which allows the kernel to choose
|
||||
a suitable value automatically.
|
||||
\fBnone\fP is equivalent to specifying zero.
|
||||
.
|
||||
.HP
|
||||
.BR \-R | \-\-regionsize
|
||||
.SIZE_G \%MirrorLogRegionSize
|
||||
.br
|
||||
A mirror is divided into regions of this size (in MiB), and the mirror log
|
||||
uses this granularity to track which regions are in sync.
|
||||
.
|
||||
.HP
|
||||
.BR \-k | \-\-setactivationskip
|
||||
.RB { y | n }
|
||||
.br
|
||||
Controls whether Logical Volumes are persistently flagged to be skipped during
|
||||
activation. By default, thin snapshot volumes are flagged for activation skip.
|
||||
See
|
||||
.BR lvm.conf (5)
|
||||
\fBactivation/auto_set_activation_skip\fP
|
||||
how to change its default behaviour.
|
||||
To activate such volumes, an extra \fB\-\-ignoreactivationskip\fP
|
||||
option must be used. The flag is not applied during deactivation. Use
|
||||
\fBlvchange \-\-setactivationskip\fP
|
||||
command to change the skip flag for existing volumes.
|
||||
To see whether the flag is attached, use \fBlvs\fP command
|
||||
where the state of the flag is reported within \fBlv_attr\fP bits.
|
||||
.
|
||||
.HP
|
||||
.BR \-L | \-\-size
|
||||
.SIZE_E \%LogicalVolumeSize
|
||||
.br
|
||||
Gives the size to allocate for the new logical volume.
|
||||
A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
|
||||
\fBK\fP for kilobytes, \fBM\fP for megabytes,
|
||||
\fBG\fP for gigabytes, \fBT\fP for terabytes, \fBP\fP for petabytes
|
||||
or \fBE\fP for exabytes is optional.
|
||||
.br
|
||||
Default unit is megabytes.
|
||||
.
|
||||
.HP
|
||||
.BR \-s | \fB\-\-snapshot
|
||||
.IR OriginalLogicalVolume { Name | Path }
|
||||
.br
|
||||
Creates a snapshot logical volume (or snapshot) for an existing, so called
|
||||
original logical volume (or origin).
|
||||
Snapshots provide a 'frozen image' of the contents of the origin
|
||||
while the origin can still be updated. They enable consistent
|
||||
backups and online recovery of removed/overwritten data/files.
|
||||
.br
|
||||
Thin snapshot is created when the origin is a thin volume and
|
||||
the size IS NOT specified. Thin snapshot shares same blocks within
|
||||
the thin pool volume.
|
||||
The non thin volume snapshot with the specified size does not need
|
||||
the same amount of storage the origin has. In a typical scenario,
|
||||
15-20% might be enough. In case the snapshot runs out of storage, use
|
||||
.BR lvextend (8)
|
||||
to grow it. Shrinking a snapshot is supported by
|
||||
.BR lvreduce (8)
|
||||
as well. Run
|
||||
.BR lvs (8)
|
||||
on the snapshot in order to check how much data is allocated to it.
|
||||
Note: a small amount of the space you allocate to the snapshot is
|
||||
used to track the locations of the chunks of data, so you should
|
||||
allocate slightly more space than you actually need and monitor
|
||||
(\fB\-\-monitor\fP) the rate at which the snapshot data is growing
|
||||
so you can \fBavoid\fP running out of space.
|
||||
If \fB\-\-thinpool\fP is specified, thin volume is created that will
|
||||
use given original logical volume as an external origin that
|
||||
serves unprovisioned blocks.
|
||||
Only read-only volumes can be used as external origins.
|
||||
To make the volume external origin, lvm expects the volume to be inactive.
|
||||
External origin volume can be used/shared for many thin volumes
|
||||
even from different thin pools. See
|
||||
.BR lvconvert (8)
|
||||
for online conversion to thin volumes with external origin.
|
||||
.
|
||||
.HP
|
||||
.BR \-i | \-\-stripes
|
||||
.IR Stripes
|
||||
.br
|
||||
Gives the number of stripes.
|
||||
This is equal to the number of physical volumes to scatter
|
||||
the logical volume data. When creating a RAID 4/5/6 logical volume,
|
||||
the extra devices which are necessary for parity are
|
||||
internally accounted for. Specifying \fB\-i 3\fP
|
||||
would cause 3 devices for striped and RAID 0 logical volumes,
|
||||
4 devices for RAID 4/5, 5 devices for RAID 6 and 6 devices for RAID 10.
|
||||
Alternatively, RAID 0 will stripe across 2 devices,
|
||||
RAID 4/5 across 3 PVs, RAID 6 across 5 PVs and RAID 10 across
|
||||
4 PVs in the volume group if the \fB\-i\fP argument is omitted.
|
||||
In order to stripe across all PVs of the VG if the \fB\-i\fP argument is
|
||||
omitted, set raid_stripe_all_devices=1 in the allocation
|
||||
section of \fBlvm.conf (5)\fP or add
|
||||
.br
|
||||
\fB\-\-config allocation/raid_stripe_all_devices=1\fP
|
||||
.br
|
||||
to the command.
|
||||
|
||||
Note the current maxima for stripes depend on the created RAID type.
|
||||
For raid10, the maximum of stripes is 32,
|
||||
for raid0, it is 64,
|
||||
for raid4/5, it is 63
|
||||
and for raid6 it is 62.
|
||||
|
||||
See the \fB\-\-nosync\fP option to optionally avoid initial syncrhonization of RaidLVs.
|
||||
|
||||
Two implementations of basic striping are available in the kernel.
|
||||
The original device-mapper implementation is the default and should
|
||||
normally be used. The alternative implementation using MD, available
|
||||
since version 1.7 of the RAID device-mapper kernel target (kernel
|
||||
version 4.2) is provided to facilitate the development of new RAID
|
||||
features. It may be accessed with \fB--type raid0[_meta]\fP, but is best
|
||||
avoided at present because of assorted restrictions on resizing and converting
|
||||
such devices.
|
||||
.HP
|
||||
.BR \-I | \-\-stripesize
|
||||
.IR StripeSize
|
||||
.br
|
||||
Gives the number of kilobytes for the granularity of the stripes.
|
||||
.br
|
||||
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
|
||||
For metadata in LVM2 format, the stripe size may be a larger
|
||||
power of 2 but must not exceed the physical extent size.
|
||||
.
|
||||
.HP
|
||||
.BR \-T | \-\-thin
|
||||
.br
|
||||
Creates thin pool or thin logical volume or both.
|
||||
Specifying the optional argument \fB\-\-size\fP or \fB\-\-extents\fP
|
||||
will cause the creation of the thin pool logical volume.
|
||||
Specifying the optional argument \fB\-\-virtualsize\fP will cause
|
||||
the creation of the thin logical volume from given thin pool volume.
|
||||
Specifying both arguments will cause the creation of both
|
||||
thin pool and thin volume using this pool.
|
||||
See \fBlvmthin\fP(7) for more info about thin provisioning support.
|
||||
Thin provisioning requires device mapper kernel driver
|
||||
from kernel 3.2 or greater.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-thinpool
|
||||
.IR ThinPoolLogicalVolume { Name | Path }
|
||||
.br
|
||||
Specifies the name of thin pool volume name. The other way to specify pool name
|
||||
is to append name to Volume group name argument.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-type
|
||||
.IR SegmentType
|
||||
.br
|
||||
Creates a logical volume with the specified segment type.
|
||||
Supported types are:
|
||||
.BR cache ,
|
||||
.BR cache-pool ,
|
||||
.BR error ,
|
||||
.BR linear ,
|
||||
.BR mirror,
|
||||
.BR raid0 ,
|
||||
.BR raid1 ,
|
||||
.BR raid4 ,
|
||||
.BR raid5_la ,
|
||||
.BR raid5_ls
|
||||
.RB (=
|
||||
.BR raid5 ),
|
||||
.BR raid5_ra ,
|
||||
.BR raid5_rs ,
|
||||
.BR raid6_nc ,
|
||||
.BR raid6_nr ,
|
||||
.BR raid6_zr
|
||||
.RB (=
|
||||
.BR raid6 ),
|
||||
.BR raid10 ,
|
||||
.BR snapshot ,
|
||||
.BR striped,
|
||||
.BR thin ,
|
||||
.BR thin-pool
|
||||
or
|
||||
.BR zero .
|
||||
Segment type may have a commandline switch alias that will
|
||||
enable its use.
|
||||
When the type is not explicitly specified an implicit type
|
||||
is selected from combination of options:
|
||||
.BR \-H | \-\-cache | \-\-cachepool
|
||||
(cache or cachepool),
|
||||
.BR \-T | \-\-thin | \-\-thinpool
|
||||
(thin or thinpool),
|
||||
.BR \-m | \-\-mirrors
|
||||
(raid1 or mirror),
|
||||
.BR \-s | \-\-snapshot | \-V | \-\-virtualsize
|
||||
(snapshot or thin),
|
||||
.BR \-i | \-\-stripes
|
||||
(striped).
|
||||
The default segment type is \fBlinear\fP.
|
||||
.
|
||||
.HP
|
||||
.BR \-V | \-\-virtualsize
|
||||
.SIZE_E \%VirtualSize
|
||||
.br
|
||||
Creates a thinly provisioned device or a sparse device of the given size (in MiB by default).
|
||||
See
|
||||
.BR lvm.conf (5)
|
||||
settings \fBglobal/sparse_segtype_default\fP
|
||||
to configure default sparse segment type.
|
||||
See \fBlvmthin\fP(7) for more info about thin provisioning support.
|
||||
Anything written to a sparse snapshot will be returned when reading from it.
|
||||
Reading from other areas of the device will return blocks of zeros.
|
||||
Virtual snapshot (sparse snapshot) is implemented by creating
|
||||
a hidden virtual device of the requested size using the zero target.
|
||||
A suffix of _vorigin is used for this device.
|
||||
Note: using sparse snapshots is not efficient for larger
|
||||
device sizes (GiB), thin provisioning should be used for this case.
|
||||
.
|
||||
.HP
|
||||
.BR \-W | \-\-wipesignatures
|
||||
.RB { y | n }
|
||||
.br
|
||||
Controls detection and subsequent wiping of signatures on newly created
|
||||
Logical Volume. There's a prompt for each signature detected to confirm
|
||||
its wiping (unless \fB--yes\fP is used where LVM assumes 'yes' answer
|
||||
for each prompt automatically). If this option is not specified, then by
|
||||
default \fB-W\fP | \fB--wipesignatures y\fP is assumed each time the
|
||||
zeroing is done (\fB\-Z\fP | \fB\-\-zero y\fP). This default behaviour
|
||||
can be controlled by \fB\%allocation/wipe_signatures_when_zeroing_new_lvs\fP
|
||||
setting found in
|
||||
.BR lvm.conf (5).
|
||||
.br
|
||||
If blkid wiping is used (\fBallocation/use_blkid_wiping\fP setting in
|
||||
.BR lvm.conf (5))
|
||||
and LVM2 is compiled with blkid wiping support, then \fBblkid\fP(8) library is used
|
||||
to detect the signatures (use \fBblkid \-k\fP command to list the signatures that are recognized).
|
||||
Otherwise, native LVM2 code is used to detect signatures (MD RAID, swap and LUKS
|
||||
signatures are detected only in this case).
|
||||
.br
|
||||
Logical volume is not wiped if the read only flag is set.
|
||||
.
|
||||
.HP
|
||||
.BR \-Z | \-\-zero
|
||||
.RB { y | n }
|
||||
.br
|
||||
Controls zeroing of the first 4KiB of data in the new logical volume.
|
||||
Default is \fBy\fPes.
|
||||
Snapshot COW volumes are always zeroed.
|
||||
Logical volume is not zeroed if the read only flag is set.
|
||||
.br
|
||||
Warning: trying to mount an unzeroed logical volume can cause the system to
|
||||
hang.
|
||||
.
|
||||
.SH Examples
|
||||
.
|
||||
Creates a striped logical volume with 3 stripes, a stripe size of 8KiB
|
||||
and a size of 100MiB in the volume group named vg00.
|
||||
The logical volume name will be chosen by lvcreate:
|
||||
.sp
|
||||
.B lvcreate \-i 3 \-I 8 \-L 100M vg00
|
||||
|
||||
Creates a mirror logical volume with 2 sides with a useable size of 500 MiB.
|
||||
This operation would require 3 devices (or option
|
||||
\fB\-\-alloc \%anywhere\fP) - two for the mirror
|
||||
devices and one for the disk log:
|
||||
.sp
|
||||
.B lvcreate \-m1 \-L 500M vg00
|
||||
|
||||
Creates a mirror logical volume with 2 sides with a useable size of 500 MiB.
|
||||
This operation would require 2 devices - the log is "in-memory":
|
||||
.sp
|
||||
.B lvcreate \-m1 \-\-mirrorlog core \-L 500M vg00
|
||||
|
||||
Creates a snapshot logical volume named "vg00/snap" which has access to the
|
||||
contents of the original logical volume named "vg00/lvol1"
|
||||
at snapshot logical volume creation time. If the original logical volume
|
||||
contains a file system, you can mount the snapshot logical volume on an
|
||||
arbitrary directory in order to access the contents of the filesystem to run
|
||||
a backup while the original filesystem continues to get updated:
|
||||
.sp
|
||||
.B lvcreate \-\-size 100m \-\-snapshot \-\-name snap /dev/vg00/lvol1
|
||||
|
||||
Creates a snapshot logical volume named "vg00/snap" with size
|
||||
for overwriting 20% of the original logical volume named "vg00/lvol1".:
|
||||
.sp
|
||||
.B lvcreate \-s \-l 20%ORIGIN \-\-name snap vg00/lvol1
|
||||
|
||||
Creates a sparse device named /dev/vg1/sparse of size 1TiB with space for just
|
||||
under 100MiB of actual data on it:
|
||||
.sp
|
||||
.B lvcreate \-\-virtualsize 1T \-\-size 100M \-\-snapshot \-\-name sparse vg1
|
||||
|
||||
Creates a linear logical volume "vg00/lvol1" using physical extents
|
||||
/dev/sda:0\-7 and /dev/sdb:0\-7 for allocation of extents:
|
||||
.sp
|
||||
.B lvcreate \-L 64M \-n lvol1 vg00 /dev/sda:0\-7 /dev/sdb:0\-7
|
||||
|
||||
Creates a 5GiB RAID5 logical volume "vg00/my_lv", with 3 stripes (plus
|
||||
a parity drive for a total of 4 devices) and a stripesize of 64KiB:
|
||||
.sp
|
||||
.B lvcreate \-\-type raid5 \-L 5G \-i 3 \-I 64 \-n my_lv vg00
|
||||
|
||||
Creates a RAID5 logical volume "vg00/my_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's more than 8 PVs in the VG in which case \fB\-i 7\fP
|
||||
has to be used to get to the currently possible maximum of
|
||||
8 devices including parity for RaidLVs):
|
||||
.sp
|
||||
.B lvcreate \-\-config allocation/raid_stripe_all_devices=1 \-\-type raid5 \-l 100%FREE \-n my_lv vg00
|
||||
|
||||
Creates a 5GiB RAID10 logical volume "vg00/my_lv", with 2 stripes on
|
||||
2 2-way mirrors. Note that the \fB-i\fP and \fB-m\fP arguments behave
|
||||
differently.
|
||||
The \fB-i\fP specifies the number of stripes.
|
||||
The \fB-m\fP specifies the number of
|
||||
.B additional
|
||||
copies:
|
||||
.sp
|
||||
.B lvcreate \-\-type raid10 \-L 5G \-i 2 \-m 1 \-n my_lv vg00
|
||||
|
||||
Creates 100MiB pool logical volume for thin provisioning
|
||||
build with 2 stripes 64KiB and chunk size 256KiB together with
|
||||
1TiB thin provisioned logical volume "vg00/thin_lv":
|
||||
.sp
|
||||
.B lvcreate \-i 2 \-I 64 \-c 256 \-L100M \-T vg00/pool \-V 1T \-\-name thin_lv
|
||||
|
||||
Creates a thin snapshot volume "thinsnap" of thin volume "thinvol" that
|
||||
will share the same blocks within the thin pool.
|
||||
Note: the size MUST NOT be specified, otherwise the non-thin snapshot
|
||||
is created instead:
|
||||
.sp
|
||||
.B lvcreate \-s vg00/thinvol \-\-name thinsnap
|
||||
|
||||
Creates a thin snapshot volume of read-only inactive volume "origin"
|
||||
which then becomes the thin external origin for the thin snapshot volume
|
||||
in vg00 that will use an existing thin pool "vg00/pool":
|
||||
.sp
|
||||
.B lvcreate \-s \-\-thinpool vg00/pool origin
|
||||
|
||||
Create a cache pool LV that can later be used to cache one
|
||||
logical volume.
|
||||
.sp
|
||||
.B lvcreate \-\-type cache-pool \-L 1G \-n my_lv_cachepool vg /dev/fast1
|
||||
|
||||
If there is an existing cache pool LV, create the large slow
|
||||
device (i.e. the origin LV) and link it to the supplied cache pool LV,
|
||||
creating a cache LV.
|
||||
.sp
|
||||
.B lvcreate \-\-cache \-L 100G \-n my_lv vg/my_lv_cachepool /dev/slow1
|
||||
|
||||
If there is an existing logical volume, create the small and fast
|
||||
cache pool LV and link it to the supplied existing logical
|
||||
volume (i.e. the origin LV), creating a cache LV.
|
||||
.sp
|
||||
.B lvcreate \-\-type cache \-L 1G \-n my_lv_cachepool vg/my_lv /dev/fast1
|
||||
|
||||
.\" Create a 1G cached LV "lvol1" with 10M cache pool "vg00/pool".
|
||||
.\" .sp
|
||||
.\" .B lvcreate \-\-cache \-L 1G \-n lv \-\-pooldatasize 10M vg00/pool
|
||||
.
|
||||
.SH SEE ALSO
|
||||
.
|
||||
.nh
|
||||
.BR lvm (8),
|
||||
.BR lvm.conf (5),
|
||||
.BR lvmcache (7),
|
||||
.BR lvmthin (7),
|
||||
.BR lvconvert (8),
|
||||
.BR lvchange (8),
|
||||
.BR lvextend (8),
|
||||
.BR lvreduce (8),
|
||||
.BR lvremove (8),
|
||||
.BR lvrename (8)
|
||||
.BR lvs (8),
|
||||
.BR lvscan (8),
|
||||
.BR vgcreate (8),
|
||||
.BR blkid (8)
|
134
man/lvdisplay.8.in
Normal file
134
man/lvdisplay.8.in
Normal file
@@ -0,0 +1,134 @@
|
||||
.TH LVDISPLAY 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvdisplay \(em display attributes of a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvdisplay
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-c | \-\-colon ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-maps ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]
|
||||
.br
|
||||
|
||||
.B lvdisplay
|
||||
.BR \-C | \-\-columns
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-segments ]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]
|
||||
.SH DESCRIPTION
|
||||
lvdisplay allows you to see the attributes of a logical volume
|
||||
like size, read/write status, snapshot information etc.
|
||||
.P
|
||||
\fBlvs\fP(8) is an alternative that provides the same information
|
||||
in the style of \fBps\fP(1).
|
||||
\fBlvs\fP(8) is recommended over \fBlvdisplay\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options and \fBlvs\fP for options given with
|
||||
\fB\-\-columns\fP.
|
||||
.TP
|
||||
.B \-\-all
|
||||
Include information in the output about internal Logical Volumes that
|
||||
are components of normally-accessible Logical Volumes, such as mirrors,
|
||||
but which are not independently accessible (e.g. not mountable).
|
||||
For example, after creating a mirror using
|
||||
\fBlvcreate \-m1 \-\-mirrorlog disk\fP,
|
||||
this option will reveal three internal Logical Volumes, with suffixes
|
||||
mimage_0, mimage_1, and mlog.
|
||||
.TP
|
||||
.BR \-C ", " \-\-columns
|
||||
Display output in columns, the equivalent of \fBlvs\fP(8).
|
||||
Options listed are the same as options given in \fBlvs\fP(8).
|
||||
.TP
|
||||
.BR \-c ", " \-\-colon
|
||||
Generate colon separated output for easier parsing in scripts or programs.
|
||||
N.B. \fBlvs\fP(8) provides considerably more control over the output.
|
||||
.nf
|
||||
|
||||
The values are:
|
||||
|
||||
\(bu logical volume name
|
||||
\(bu volume group name
|
||||
\(bu logical volume access
|
||||
\(bu logical volume status
|
||||
\(bu internal logical volume number
|
||||
\(bu open count of logical volume
|
||||
\(bu logical volume size in sectors
|
||||
\(bu current logical extents associated to logical volume
|
||||
\(bu allocated logical extents of logical volume
|
||||
\(bu allocation policy of logical volume
|
||||
\(bu read ahead sectors of logical volume
|
||||
\(bu major device number of logical volume
|
||||
\(bu minor device number of logical volume
|
||||
|
||||
.fi
|
||||
.TP
|
||||
.BR \-m ", " \-\-maps
|
||||
Display the mapping of logical extents to physical volumes and
|
||||
physical extents. To map physical extents
|
||||
to logical extents use:
|
||||
.B pvs \-\-segments \-o+lv_name,seg_start_pe,segtype
|
||||
.SH Examples
|
||||
Shows attributes of that logical volume. If snapshot
|
||||
logical volumes have been created for this original logical volume,
|
||||
this command shows a list of all snapshot logical volumes and their
|
||||
status (active or inactive) as well:
|
||||
.sp
|
||||
.B lvdisplay \-v vg00/lvol2
|
||||
|
||||
Shows the attributes of this snapshot logical volume and also which
|
||||
original logical volume it is associated with:
|
||||
.sp
|
||||
.B lvdisplay vg00/snapshot
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvs (8),
|
||||
.BR lvscan (8),
|
||||
.BR pvs (8)
|
134
man/lvextend.8.in
Normal file
134
man/lvextend.8.in
Normal file
@@ -0,0 +1,134 @@
|
||||
.TH LVEXTEND 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvextend \(em extend the size of a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvextend
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-i | \-\-stripes
|
||||
.I Stripes
|
||||
.RB [ \-I | \-\-stripesize
|
||||
.IR StripeSize ]]
|
||||
.RB { \-l | \-\-extents
|
||||
.RI [ + ] LogicalExtentsNumber [ % { VG | LV | PVS | FREE | ORIGIN }]
|
||||
|
|
||||
.BR \-L | \-\-size
|
||||
.RI [ + ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]}
|
||||
.RB [ \-n | \-\-nofsck ]
|
||||
.RB [ \-\-noudevsync]
|
||||
.RB [ \-r | \-\-resizefs ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-use\-policies ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.I LogicalVolumePath
|
||||
.RI [ PhysicalVolumePath [ :PE [ \-PE ]]...]
|
||||
.SH DESCRIPTION
|
||||
lvextend allows you to extend the size of a logical volume.
|
||||
Extension of snapshot logical volumes (see
|
||||
.BR lvcreate (8)
|
||||
for information to create snapshots) is supported as well.
|
||||
But to change the number of copies in a mirrored logical
|
||||
volume use
|
||||
.BR lvconvert (8).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Proceed with size extension without prompting.
|
||||
.TP
|
||||
.IR \fB\-l ", " \fB\-\-extents " [" + ] LogicalExtentsNumber [ % { VG | LV | PVS | FREE | ORIGIN }]
|
||||
Extend or set the logical volume size in units of logical extents.
|
||||
With the '\fI+\fP' sign the value is added to the actual size
|
||||
of the logical volume and without it, the value is taken as an absolute one.
|
||||
The total number of physical extents allocated will be
|
||||
greater than this, for example, if the volume is mirrored.
|
||||
The number can also be expressed as a percentage of the total space
|
||||
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
|
||||
size of the Logical Volume with the suffix \fI%LV\fP, of the remaining
|
||||
free space for the specified PhysicalVolume(s) with the suffix \fI%PVS\fP,
|
||||
as a percentage of the remaining free space in the Volume Group
|
||||
with the suffix \fI%FREE\fP, or (for a snapshot) as a percentage of the total
|
||||
space in the Origin Logical Volume with the suffix \fI%ORIGIN\fP.
|
||||
The resulting value is rounded upward.
|
||||
N.B. In a future release, when expressed as a percentage with PVS, VG or FREE,
|
||||
the number will be treated as an approximate upper limit for the total number
|
||||
of physical extents to be allocated (including extents used by any mirrors, for
|
||||
example). The code may currently allocate more space than you might otherwise
|
||||
expect.
|
||||
.TP
|
||||
.IR \fB\-L ", " \fB\-\-size " [" + ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
|
||||
Extend or set the logical volume size in units of megabytes.
|
||||
A size suffix of M for megabytes,
|
||||
G for gigabytes, T for terabytes, P for petabytes
|
||||
or E for exabytes is optional.
|
||||
With the + sign the value is added to the actual size
|
||||
of the logical volume and without it, the value is taken as an absolute one.
|
||||
.TP
|
||||
.BR \-i ", " \-\-stripes " " \fIStripes
|
||||
Gives the number of stripes for the extension.
|
||||
Not applicable to LVs using the original metadata LVM format, which must
|
||||
use a single value throughout.
|
||||
.TP
|
||||
.BR \-I ", " \-\-stripesize " " \fIStripeSize
|
||||
Gives the number of kilobytes for the granularity of the stripes.
|
||||
Not applicable to LVs using the original metadata LVM format, which must
|
||||
use a single value throughout.
|
||||
.br
|
||||
StripeSize must be 2^n (n = 2 to 9)
|
||||
.TP
|
||||
.BR \-n ", " \-\-nofsck
|
||||
Do not perform fsck before extending filesystem when filesystem
|
||||
requires it. You may need to use \fB\-\-force\fR to proceed with
|
||||
this option.
|
||||
.TP
|
||||
.B \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.TP
|
||||
.BR \-r ", " \-\-resizefs
|
||||
Resize underlying filesystem together with the logical volume using
|
||||
\fBfsadm\fR(8).
|
||||
.TP
|
||||
.B \-\-use\-policies
|
||||
Resizes the logical volume according to configured policy. See
|
||||
\fBlvm.conf\fR(5) for some details.
|
||||
|
||||
.SH Examples
|
||||
Extends the size of the logical volume "vg01/lvol10" by 54MiB on physical
|
||||
volume /dev/sdk3. This is only possible if /dev/sdk3 is a member of
|
||||
volume group vg01 and there are enough free physical extents in it:
|
||||
.sp
|
||||
.B lvextend \-L +54 /dev/vg01/lvol10 /dev/sdk3
|
||||
|
||||
Extends the size of logical volume "vg01/lvol01" by the amount of free
|
||||
space on physical volume /dev/sdk3. This is equivalent to specifying
|
||||
"\-l +100%PVS" on the command line:
|
||||
.sp
|
||||
.B lvextend /dev/vg01/lvol01 /dev/sdk3
|
||||
|
||||
Extends a logical volume "vg01/lvol01" by 16MiB using physical extents
|
||||
/dev/sda:8\-9 and /dev/sdb:8\-9 for allocation of extents:
|
||||
.sp
|
||||
.B lvextend -L+16M vg01/lvol01 /dev/sda:8\-9 /dev/sdb:8\-9
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR fsadm (8),
|
||||
.BR lvm (8),
|
||||
.BR lvm.conf (5),
|
||||
.BR lvcreate (8),
|
||||
.BR lvconvert (8),
|
||||
.BR lvreduce (8),
|
||||
.BR lvresize (8),
|
||||
.BR lvchange (8)
|
1
man/lvm-config.8.in
Normal file
1
man/lvm-config.8.in
Normal file
@@ -0,0 +1 @@
|
||||
.so man8/lvmconfig.8
|
1
man/lvm-dumpconfig.8.in
Normal file
1
man/lvm-dumpconfig.8.in
Normal file
@@ -0,0 +1 @@
|
||||
.so man8/lvmconfig.8
|
145
man/lvm-fullreport.8.in
Normal file
145
man/lvm-fullreport.8.in
Normal file
@@ -0,0 +1,145 @@
|
||||
.TH LVM-FULLREPORT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvm fullreport \(em Report information about PVs, PV segments, VGs, LVs and LV segments, all at once for each VG.
|
||||
.SH SYNOPSIS
|
||||
.B lvm fullreport
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-nameprefixes ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-rows ]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-\-unquoted ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName
|
||||
.RI [ VolumeGroupName ...]]
|
||||
.SH DESCRIPTION
|
||||
lvm fullreport produces formatted output about PVs, PV segments, VGs, LVs
|
||||
and LV segments, all at once for each VG and guarded by per-VG lock
|
||||
for consistency.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-all
|
||||
Include information in the output about internal Logical Volumes that
|
||||
are components of normally-accessible Logical Volumes, such as mirrors,
|
||||
but which are not independently accessible (e.g. not mountable).
|
||||
The names of such Logical Volumes are enclosed within square brackets
|
||||
in the output. For example, after creating a mirror using
|
||||
.B lvcreate -m1 \-\-mirrorlog disk
|
||||
, this option will reveal three internal Logical
|
||||
Volumes, with suffixes mimage_0, mimage_1, and mlog.
|
||||
.TP
|
||||
.B \-\-aligned
|
||||
Use with \fB\-\-separator\fP to align the output columns.
|
||||
.TP
|
||||
.B \-\-binary
|
||||
Use binary values "0" or "1" instead of descriptive literal values
|
||||
for columns that have exactly two valid values to report (not counting
|
||||
the "unknown" value which denotes that the value could not be determined).
|
||||
.TP
|
||||
.B \-\-configreport \fI ReportName
|
||||
Make any subsequent \fB\-o, \-\-options\fP, \fB\-O, \-\-sort\fP or
|
||||
\fB\-S, \-\-select\fP to apply for \fIReportName\fP where \fIReportName\fP
|
||||
is 'pv' for PV subreport, 'pvseg' for PV segment subreport, 'vg' for
|
||||
VG subreport, 'lv' for LV subreport, 'seg' for LV segment subreport or 'log'
|
||||
for log report. If \fB\-\-configreport\fP option is not used to identify a
|
||||
report, then all command's subreports are assumed except log report. The log
|
||||
report is available only if enabled by \fBlog/report_command_log\fP
|
||||
\fBlvm.conf\fP(5) setting or if \fB\-\-logonly\fP option is used.
|
||||
.TP
|
||||
.B \-\-logonly
|
||||
Suppress the main report itself and display only log report on output.
|
||||
.TP
|
||||
.B \-\-nameprefixes
|
||||
Add an "LVM2_" prefix plus the field name to the output. Useful
|
||||
with \fB\-\-noheadings\fP to produce a list of field=value pairs that can
|
||||
be used to set environment variables (for example, in \fBudev\fP(7) rules).
|
||||
.TP
|
||||
.B \-\-noheadings
|
||||
Suppress the headings line that is normally the first line of output.
|
||||
Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-nosuffix
|
||||
Suppress the suffix on output sizes. Use with \fB\-\-units\fP
|
||||
(except h and H) if processing the output.
|
||||
.TP
|
||||
.BR \-o ", " \-\-options
|
||||
Comma-separated ordered list of columns.
|
||||
.IP
|
||||
Precede the list with '\fI+\fP' to append to the current list
|
||||
of columns, '\fI-\fP' to remove from the current list of columns
|
||||
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
|
||||
be repeated, providing several lists. These lists are evaluated
|
||||
from left to right.
|
||||
.IP
|
||||
For the list of columns, see \fBpvs\fP(8), \fBvgs\fP(8),
|
||||
\fBlvs\fP(8) man page or check \fBpvs\fP, \fBvgs\fP, \fBlvs -o help\fP
|
||||
output.
|
||||
.TP
|
||||
.BR \-O ", " \-\-sort
|
||||
Comma-separated ordered list of columns to sort by. Replaces the default
|
||||
selection. Precede any column with '\fI\-\fP' for a reverse sort on that
|
||||
column.
|
||||
.TP
|
||||
.B \-\-rows
|
||||
Output columns as rows.
|
||||
.TP
|
||||
.BR \-S ", " \-\-select " " \fISelection
|
||||
Display only rows that match Selection criteria. All rows are displayed with
|
||||
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
|
||||
matches the Selection and 0 otherwise. The Selection criteria are defined
|
||||
by specifying column names and their valid values (that can include reserved
|
||||
values) while making use of supported comparison operators. See \fBlvm\fP(8)
|
||||
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
|
||||
about constructing the Selection criteria. As a quick help and to see full
|
||||
list of column names that can be used in Selection including the list of
|
||||
reserved values and the set of supported selection operators, check the
|
||||
output of \fBpvs\fP, \fBvgs\fP, \fBlvs -S help\fP command.
|
||||
.TP
|
||||
.B \-\-separator \fISeparator
|
||||
String to use to separate each column. Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-unbuffered
|
||||
Produce output immediately without sorting or aligning the columns properly.
|
||||
.TP
|
||||
.B \-\-units \fIhHbBsSkKmMgGtTpPeE
|
||||
All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
|
||||
(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.
|
||||
Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify
|
||||
custom units e.g. \-\-units 3M
|
||||
.TP
|
||||
.B \-\-unquoted
|
||||
When used with \fB\-\-nameprefixes\fP, output values in the field=value
|
||||
pairs are not quoted.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvs (8),
|
||||
.BR vgs (8),
|
||||
.BR lvs (8)
|
89
man/lvm-lvpoll.8.in
Normal file
89
man/lvm-lvpoll.8.in
Normal file
@@ -0,0 +1,89 @@
|
||||
.TH "LVPOLL" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvpoll \(em Internal command used by lvmpolld to complete some Logical Volume operations.
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B lvm lvpoll
|
||||
.BR \-\-polloperation
|
||||
.RI { pvmove | convert | merge | merge_thin }
|
||||
.RB [ \-\-abort ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-handlemissingpvs ]
|
||||
.RB [ \-i | \-\-interval
|
||||
.IR Seconds ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.IR LogicalVolume [ Path ]
|
||||
.SH DESCRIPTION
|
||||
\fBlvpoll\fP is an internal command used by \fBlvmpolld\fP(8) to monitor and
|
||||
complete \fBlvconvert\fP(8) and \fBpvmove\fP(8) operations.
|
||||
\fBlvpoll\fP itself does not initiate these operations and
|
||||
you should never normally need to invoke it directly.
|
||||
|
||||
.I LogicalVolume
|
||||
The Logical Volume undergoing conversion or, in the case of pvmove, the name of
|
||||
the internal pvmove Logical Volume (see \fBEXAMPLES\fP).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-\-polloperation " {" \fIconvert | \fImerge | \fImerge_thin | \fIpvmove }
|
||||
Mandatory option.
|
||||
\fIpvmove\fP refers to a pvmove operation that is moving data.
|
||||
\fIconvert\fP refers to an operation that is increasing the number of redundant copies of data maintained by a mirror.
|
||||
\fImerge\fP indicates a merge operation that doesn't involve thin volumes.
|
||||
\fImerge_thin\fP indicates a merge operation involving thin snapshots.
|
||||
\fBpvmove\fP(8) and \fBlvconvert\fP(8) describe how to initiate these operations.
|
||||
.TP
|
||||
.B \-\-abort
|
||||
Abort pvmove in progress. See \fBpvmove\fP(8).
|
||||
.TP
|
||||
.B \-\-handlemissingpvs
|
||||
Used when the polling operation needs to handle missing PVs to be able to
|
||||
continue. This can happen when \fBlvconvert\fP(8) is repairing a mirror
|
||||
with one or more faulty devices.
|
||||
.TP
|
||||
.BR \-i ", " \-\-interval " "\fISeconds
|
||||
Report progress at regular intervals
|
||||
|
||||
.SH EXAMPLES
|
||||
Resume polling of a pvmove operation identified by the Logical Volume vg00/pvmove0:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation pvmove vg00/pvmove0
|
||||
.P
|
||||
Abort the same pvmove operation:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation pvmove --abort vg00/pvmove0
|
||||
.P
|
||||
To find out the name of the pvmove Logical Volume resulting from an original
|
||||
\fBpvmove /dev/sda1\fP command you may use the following \fBlvs\fP command.
|
||||
(Remove the parentheses from the LV name.)
|
||||
.sp
|
||||
.B lvs -a -S move_pv=/dev/sda1
|
||||
.P
|
||||
Resume polling of mirror conversion vg00/lvmirror:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation convert vg00/lvmirror
|
||||
.P
|
||||
Complete mirror repair:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation convert vg/damaged_mirror --handlemissingpvs
|
||||
.P
|
||||
Process snapshot merge:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation merge vg/snapshot_old
|
||||
.P
|
||||
Finish thin snapshot merge:
|
||||
.sp
|
||||
.B lvm lvpoll --polloperation merge_thin vg/thin_snapshot
|
||||
.SH SEE ALSO
|
||||
.BR lvconvert (8),
|
||||
.BR lvm (8),
|
||||
.BR lvmpolld (8),
|
||||
.BR lvs (8),
|
||||
.BR pvmove (8)
|
258
man/lvm.8.in
258
man/lvm.8.in
@@ -45,9 +45,6 @@ A file containing a simple script with one command per line
|
||||
can also be given on the command line. The script can also be
|
||||
executed directly if the first line is #! followed by the absolute
|
||||
path of \fBlvm\fP.
|
||||
.P
|
||||
Additional hyphens within option names are ignored. For example,
|
||||
\fB\-\-readonly\fP and \fB\-\-read\-only\fP are both accepted.
|
||||
.
|
||||
.SH BUILT-IN COMMANDS
|
||||
.
|
||||
@@ -241,6 +238,261 @@ The following commands are not implemented in LVM2 but might be
|
||||
in the future:
|
||||
.BR lvmsadc ", " lvmsar ", " pvdata .
|
||||
.
|
||||
.SH OPTIONS
|
||||
.
|
||||
The following options are available for many of the commands.
|
||||
They are implemented generically and documented here rather
|
||||
than repeated on individual manual pages.
|
||||
.P
|
||||
Additional hyphens within option names are ignored. For example,
|
||||
\fB\-\-readonly\fP and \fB\-\-read\-only\fP are both accepted.
|
||||
.
|
||||
.HP
|
||||
.BR \-h | \-? | \-\-help
|
||||
.br
|
||||
Display the help text.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-version
|
||||
.br
|
||||
Display version information.
|
||||
.
|
||||
.HP
|
||||
.BR \-v | \-\-verbose
|
||||
.br
|
||||
Set verbose level. Repeat from 1 to 3 times to increase the detail
|
||||
of messages sent to stdout and stderr. Overrides config file setting.
|
||||
.
|
||||
.HP
|
||||
.BR \-d | \-\-debug
|
||||
.br
|
||||
Set debug level. Repeat from 1 to 6 times to increase the detail of
|
||||
messages sent to the log file and/or syslog (if configured).
|
||||
Overrides config file setting.
|
||||
.
|
||||
.HP
|
||||
.BR \-q | \-\-quiet
|
||||
.br
|
||||
Suppress output and log messages.
|
||||
Overrides \fB\-d\fP and \fB\-v\fP.
|
||||
Repeat once to also suppress any prompts with answer 'no'.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-yes
|
||||
.br
|
||||
Don't prompt for confirmation interactively but instead always assume the
|
||||
answer is 'yes'. Take great care if you use this!
|
||||
.
|
||||
.HP
|
||||
.BR \-t | \-\-test
|
||||
.br
|
||||
Run in test mode. Commands will not update metadata.
|
||||
This is implemented by disabling all metadata writing but nevertheless
|
||||
returning success to the calling function. This may lead to unusual
|
||||
error messages in multi-stage operations if a tool relies on reading
|
||||
back metadata it believes has changed but hasn't.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-driverloaded
|
||||
.RB { y | n }
|
||||
.br
|
||||
Whether or not the device-mapper kernel driver is loaded.
|
||||
If you set this to \fBn\fP, no attempt will be made to contact the driver.
|
||||
.
|
||||
.HP
|
||||
.BR \-A | \-\-autobackup
|
||||
.RB { y | n }
|
||||
.br
|
||||
Whether or not to metadata should be backed up automatically after a change.
|
||||
You are strongly advised not to disable this!
|
||||
See \fBvgcfgbackup\fP(8).
|
||||
.
|
||||
.HP
|
||||
.BR \-P | \-\-partial
|
||||
.br
|
||||
When set, the tools will do their best to provide access to Volume Groups
|
||||
that are only partially available (one or more Physical Volumes belonging
|
||||
to the Volume Group are missing from the system). Where part of a logical
|
||||
volume is missing, \fI\%/dev/ioerror\fP will be substituted, and you could use
|
||||
\fBdmsetup\fP(8) to set this up to return I/O errors when accessed,
|
||||
or create it as a large block device of nulls. Metadata may not be
|
||||
changed with this option. To insert a replacement Physical Volume
|
||||
of the same or large size use \fBpvcreate \-u\fP to set the uuid to
|
||||
match the original followed by \fBvgcfgrestore\fP(8).
|
||||
.
|
||||
.HP
|
||||
.BR \-S | \-\-select
|
||||
.IR Selection
|
||||
.br
|
||||
For reporting commands, display only rows that match \fISelection\fP criteria.
|
||||
All rows are displayed with the additional "selected" column (\fB-o selected\fP)
|
||||
showing 1 if the row matches the \fISelection\fP and 0 otherwise. For non-reporting
|
||||
commands which process LVM entities, the selection can be used to match items
|
||||
to process. See \fBSelection\fP section in \fBlvmreport\fP(7) man page for more
|
||||
information about the way the selection criteria are constructed.
|
||||
.
|
||||
.HP
|
||||
.BR \-M | \-\-metadatatype
|
||||
.IR Type
|
||||
.br
|
||||
Specifies which \fItype\fP of on-disk metadata to use, such as \fBlvm1\fP
|
||||
or \fBlvm2\fP, which can be abbreviated to \fB1\fP or \fB2\fP respectively.
|
||||
The default (\fBlvm2\fP) can be changed by setting \fBformat\fP
|
||||
in the \fBglobal\fP section of the config file \fBlvm.conf\fP(5).
|
||||
.
|
||||
.HP
|
||||
.BR \-\-ignorelockingfailure
|
||||
.br
|
||||
This lets you proceed with read-only metadata operations such as
|
||||
\fBlvchange \-ay\fP and \fBvgchange \-ay\fP even if the locking module fails.
|
||||
One use for this is in a system init script if the lock directory
|
||||
is mounted read-only when the script runs.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-ignoreskippedcluster
|
||||
.br
|
||||
Use to avoid exiting with an non-zero status code if the command is run
|
||||
without clustered locking and some clustered Volume Groups have to be
|
||||
skipped over.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-readonly
|
||||
.br
|
||||
Run the command in a special read-only mode which will read on-disk
|
||||
metadata without needing to take any locks. This can be used to peek
|
||||
inside metadata used by a virtual machine image while the virtual
|
||||
machine is running.
|
||||
It can also be used to peek inside the metadata of clustered Volume
|
||||
Groups when clustered locking is not configured or running. No attempt
|
||||
will be made to communicate with the device-mapper kernel driver, so
|
||||
this option is unable to report whether or not Logical Volumes are
|
||||
actually in use.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-foreign
|
||||
.br
|
||||
Cause the command to access foreign VGs, that would otherwise be skipped.
|
||||
It can be used to report or display a VG that is owned by another host.
|
||||
This option can cause a command to perform poorly because lvmetad caching
|
||||
is not used and metadata is read from disks.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-shared
|
||||
.br
|
||||
Cause the command to access shared VGs, that would otherwise be skipped
|
||||
when lvmlockd is not being used. It can be used to report or display a
|
||||
lockd VG without locking. Applicable only if LVM is compiled with lockd
|
||||
support.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-addtag
|
||||
.IR Tag
|
||||
.br
|
||||
Add the tag \fITag\fP to a PV, VG or LV.
|
||||
Supply this argument multiple times to add more than one tag at once.
|
||||
A tag is a word that can be used to group LVM2 objects of the same type
|
||||
together.
|
||||
Tags can be given on the command line in place of PV, VG or LV
|
||||
arguments. Tags should be prefixed with @ to avoid ambiguity.
|
||||
Each tag is expanded by replacing it with all objects possessing
|
||||
that tag which are of the type expected by its position on the command line.
|
||||
PVs can only possess tags while they are part of a Volume Group:
|
||||
PV tags are discarded if the PV is removed from the VG.
|
||||
As an example, you could tag some LVs as \fBdatabase\fP and others
|
||||
as \fBuserdata\fP and then activate the database ones
|
||||
with \fBlvchange \-ay @database\fP.
|
||||
Objects can possess multiple tags simultaneously.
|
||||
Only the new LVM2 metadata format supports tagging: objects using the
|
||||
LVM1 metadata format cannot be tagged because the on-disk format does not
|
||||
support it.
|
||||
Characters allowed in tags are:
|
||||
.BR A - Z
|
||||
.BR a - z
|
||||
.BR 0 - 9
|
||||
.BR "_ + . -"
|
||||
and as of version 2.02.78 the following characters are also accepted:
|
||||
.BR "/ = ! : # &" .
|
||||
.
|
||||
.HP
|
||||
.BR \-\-deltag
|
||||
.IR Tag
|
||||
.br
|
||||
Delete the tag \fITag\fP from a PV, VG or LV, if it's present.
|
||||
Supply this argument multiple times to remove more than one tag at once.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-alloc
|
||||
.RB { anywhere | contiguous | cling | inherit | normal }
|
||||
.br
|
||||
Selects the allocation policy when a command needs to allocate
|
||||
Physical Extents from the Volume Group.
|
||||
Each Volume Group and Logical Volume has an allocation policy defined.
|
||||
The default for a Volume Group is \fBnormal\fP which applies
|
||||
common-sense rules such as not placing parallel stripes on the same
|
||||
Physical Volume. The default for a Logical Volume is \fBinherit\fP
|
||||
which applies the same policy as for the Volume Group. These policies can
|
||||
be changed using \fBlvchange\fP(8) and \fBvgchange\fP(8) or overridden
|
||||
on the command line of any command that performs allocation.
|
||||
The \fBcontiguous\fP policy requires that new Physical Extents be placed adjacent
|
||||
to existing Physical Extents.
|
||||
The \fBcling\fP policy places new Physical Extents on the same Physical
|
||||
Volume as existing Physical Extents in the same stripe of the Logical Volume.
|
||||
If there are sufficient free Physical Extents to satisfy
|
||||
an allocation request but \fBnormal\fP doesn't use them,
|
||||
\fBanywhere\fP will - even if that reduces performance by
|
||||
placing two stripes on the same Physical Volume.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-commandprofile
|
||||
.IR ProfileName
|
||||
.br
|
||||
Selects the command configuration profile to use when processing an LVM command.
|
||||
See also \fBlvm.conf\fP(5) for more information about \fBcommand profile config\fP and
|
||||
the way it fits with other LVM configuration methods. Using \fB\-\-commandprofile\fP
|
||||
option overrides any command profile specified via \fBLVM_COMMAND_PROFILE\fP
|
||||
environment variable.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-metadataprofile
|
||||
.IR ProfileName
|
||||
.br
|
||||
Selects the metadata configuration profile to use when processing an LVM command.
|
||||
When using metadata profile during Volume Group or Logical Volume creation,
|
||||
the metadata profile name is saved in metadata. When such Volume Group or Logical
|
||||
Volume is processed next time, the metadata profile is automatically applied
|
||||
and the use of \fB\-\-metadataprofile\fP option is not necessary. See also
|
||||
\fBlvm.conf\fP(5) for more information about \fBmetadata profile config\fP and the
|
||||
way it fits with other LVM configuration methods.
|
||||
.
|
||||
.HP
|
||||
.BR \-\-profile
|
||||
.IR ProfileName
|
||||
.br
|
||||
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
|
||||
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
|
||||
for any other command (with the exception of \fBlvmconfig\fP command where the
|
||||
\fB\-\-profile\fP has special meaning, see \fBlvmconfig\fP(8) for more information).
|
||||
.
|
||||
.HP
|
||||
.BR \-\-reportformat
|
||||
.IR {basic|json}
|
||||
.br
|
||||
Overrides current output format for reports which is defined globally by
|
||||
\fBreport/output_format\fP configuration setting in \fBlvm.conf\fP(5).
|
||||
The \fBbasic\fP format is the original format with columns and rows and
|
||||
if there is more than one report per command, each report is prefixed
|
||||
with report's name for identification. The \fBjson\fP stands for report
|
||||
output in JSON format.
|
||||
.HP
|
||||
.BR \-\-config
|
||||
.IR ConfigurationString
|
||||
.br
|
||||
Uses the ConfigurationString as direct string representation of the configuration
|
||||
to override the existing configuration. The ConfigurationString is of exactly
|
||||
the same format as used in any LVM configuration file. See \fBlvm.conf\fP(5)
|
||||
for more information about \fBdirect config override on command line\fP and the
|
||||
way it fits with other LVM configuration methods.
|
||||
.
|
||||
.SH VALID NAMES
|
||||
.
|
||||
The valid characters for VG and LV names are:
|
||||
|
10
man/lvmchange.8.in
Normal file
10
man/lvmchange.8.in
Normal file
@@ -0,0 +1,10 @@
|
||||
.TH LVMCHANGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvmchange \(em change attributes of the logical volume manager
|
||||
.SH SYNOPSIS
|
||||
.B lvmchange
|
||||
.SH DESCRIPTION
|
||||
lvmchange is not currently supported under LVM2, although
|
||||
\fBdmsetup\fP(8) has a \fBremove_all\fP command.
|
||||
.SH SEE ALSO
|
||||
.BR dmsetup (8)
|
225
man/lvmconfig.8.in
Normal file
225
man/lvmconfig.8.in
Normal file
@@ -0,0 +1,225 @@
|
||||
.TH "LVMCONFIG" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
|
||||
.SH "NAME"
|
||||
lvmconfig, lvm dumpconfig, lvm config \(em Display LVM configuration
|
||||
.SH SYNOPSIS
|
||||
.
|
||||
.ad l
|
||||
.B lvmconfig
|
||||
.RB [ \-f | \-\-file
|
||||
.IR Filename ]
|
||||
.RB [ \-\-type
|
||||
.RB { current | default | diff | full |\: list | missing | new \c
|
||||
.RB | profilable | profilable-command | profilable-metadata }]
|
||||
.RB [ \-\-atversion
|
||||
.IR Version ]
|
||||
.RB [ \-\-sinceversion
|
||||
.IR Version ]
|
||||
.RB [ \-\-ignoreadvanced ]
|
||||
.RB [ \-\-ignoreunsupported ]
|
||||
.RB [ \-\-ignorelocal ]
|
||||
.RB [ \-l | \-\-list ]
|
||||
.RB [ \-\-config
|
||||
.IR ConfigurationString ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\-profile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\-metadataprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\-mergedconfig ]
|
||||
.RB [ \-\-showdeprecated ]
|
||||
.RB [ \-\-showunsupported ]
|
||||
.RB [ \-\-validate ]
|
||||
.RB [ \-\-withsummary ]
|
||||
.RB [ \-\-withcomments ]
|
||||
.RB [ \-\-withspaces ]
|
||||
.RB [ \-\-withversions ]
|
||||
.RB [ ConfigurationNode... ]
|
||||
.ad b
|
||||
.
|
||||
.SH DESCRIPTION
|
||||
lvmconfig produces formatted output from the LVM configuration tree.
|
||||
The command was added in release 2.02.119 and has an identical longer form
|
||||
\fBlvm dumpconfig\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-f ", " \-\-file " \fIFilename"
|
||||
Send output to a file named 'filename'.
|
||||
|
||||
.TP
|
||||
.BR \-l ", " \-\-list
|
||||
List configuration settings with summarizing comment. This is the same as using
|
||||
\fBlvmconfig --type list --withsummary\fP.
|
||||
|
||||
.TP
|
||||
.BR \-\-type " {" current | default | diff | full | missing | new | profilable |\: profilable-command | profilable-metadata }
|
||||
Select the type of configuration to display. The configuration settings
|
||||
displayed have either default values or currently-used values assigned based on
|
||||
the type selected. If no type is selected, \fB\-\-type current\fP is used
|
||||
by default. Whenever a configuration setting with a default value is
|
||||
commented out, it means the setting does not have any concrete default
|
||||
value defined. Output can be saved and used as a proper \fBlvm.conf\fP(5)
|
||||
file.
|
||||
.RS
|
||||
.IP \fBcurrent\fP 3
|
||||
Display the current \fBlvm.conf\fP configuration merged with any \fBtag
|
||||
config\fP if used. See also \fBlvm.conf\fP(5) for more info about LVM
|
||||
configuration methods.
|
||||
.IP \fBdefault\fP 3
|
||||
Display all possible configuration settings with default values assigned.
|
||||
.IP \fBdiff\fP 3
|
||||
Display all configuration settings for which the values used differ from defaults.
|
||||
The value assigned for each configuration setting is the value currently used.
|
||||
Using this type also implies the use of \fB\-\-mergedconfig\fP option.
|
||||
This is actually minimal LVM configuration which can be used without
|
||||
a change to current configured behaviour.
|
||||
.IP \fBfull\fP 3
|
||||
Display full configuration tree - a combination of current configuration tree
|
||||
(\fB\-\-type current\fP) and tree of settings for which default values are
|
||||
used (\fB\-\-type missing\fP). This is exactly the configuration tree that
|
||||
LVM2 uses during command execution. Using this type also implies
|
||||
the use of \fB\-\-mergedconfig\fP option. If comments are displayed
|
||||
(see \fB\-\-withcomments\fP and \fB\-\-withsummary\fP options), then
|
||||
for each setting found in existing configuration and for which defaults
|
||||
are not used, there's an extra comment line printed to denote this.
|
||||
.IP \fBlist\fP 3
|
||||
Display plain list of configuration settings.
|
||||
.IP \fBmissing\fP 3
|
||||
Display all configuration settings with default values assigned which are
|
||||
missing in the configuration currently used and for which LVM automatically
|
||||
fallbacks to using these default values.
|
||||
.IP \fBnew\fP 3
|
||||
Display all new configuration settings introduced in current LVM version
|
||||
or specific version as defined by \fB\-\-atversion\fP option.
|
||||
.IP \fBprofilable\fP 3
|
||||
Display all profilable configuration settings with default values assigned.
|
||||
See \fBlvm.conf\fP(5) for more info about \fBprofile config\fP method.
|
||||
.IP \fBprofilable-command\fP 3
|
||||
Display all profilable configuration settings with default values assigned
|
||||
that can be used in command profile. This is a subset of settings displayed
|
||||
by \fB\-\-type profilable\fP.
|
||||
.IP \fBprofilable-metadata\fP 3
|
||||
Display all profilable configuration settings with default values assigned
|
||||
that can be used in metadata profile. This is a subset of settings displayed
|
||||
by \fB\-\-type profilable\fP.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.BI \-\-atversion " Version"
|
||||
Specify an LVM version in x.y.z format where x is the major version,
|
||||
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
|
||||
When configuration is displayed, the configuration settings recognized
|
||||
at this LVM version will be considered only. This can be used
|
||||
to display a configuration that a certain LVM version understands and
|
||||
which does not contain any newer settings for which LVM would
|
||||
issue a warning message when checking the configuration.
|
||||
|
||||
.TP
|
||||
.BI \-\-sinceversion " Version"
|
||||
Specify an LVM version in x.y.z format where x is the major version,
|
||||
the y is the minor version and z is the patchlevel (e.g. 2.2.106).
|
||||
This option is currently applicable only with \fB\-\-type new\fP
|
||||
to display all configuration settings introduced since given version.
|
||||
|
||||
.TP
|
||||
.B \-\-ignoreadvanced
|
||||
Exclude advanced configuration settings from the output.
|
||||
|
||||
.TP
|
||||
.B \-\-ignoreunsupported
|
||||
Exclude unsupported configuration settings from the output. These settings are
|
||||
either used for debugging and development purposes only or their support is not
|
||||
yet complete and they are not meant to be used in production. The \fBcurrent\fP
|
||||
and \fBdiff\fP types include unsupported settings in their output by default,
|
||||
all the other types ignore unsupported settings.
|
||||
|
||||
.TP
|
||||
.B \-\-ignorelocal
|
||||
Ignore local section.
|
||||
|
||||
.TP
|
||||
.BI \-\-config " ConfigurationString"
|
||||
Use \fIConfigurationString\fP to override existing configuration.
|
||||
This configuration is then applied for the lvmconfig command itself.
|
||||
See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
|
||||
|
||||
.TP
|
||||
.BI \-\-commandprofile " ProfileName"
|
||||
Use \fIProfileName\fP to override existing configuration.
|
||||
This configuration is then applied for the lvmconfig command itself.
|
||||
See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for
|
||||
more info about \fBconfig cascade\fP.
|
||||
|
||||
.TP
|
||||
.BI \-\-profile " ProfileName"
|
||||
The same as using \fB\-\-commandprofile\fP but the configuration is not
|
||||
applied for the lvmconfig command itself.
|
||||
|
||||
.TP
|
||||
.BI \-\-metadataprofile " ProfileName"
|
||||
Use \fIProfileName\fP to override existing configuration.
|
||||
The configuration defined in metadata profile has no effect for
|
||||
the lvmconfig command itself. lvmconfig displays the configuration only.
|
||||
See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for more
|
||||
info about \fBconfig cascade\fP.
|
||||
|
||||
.TP
|
||||
.B \-\-mergedconfig
|
||||
When the lvmconfig command is run with the \fB\-\-config\fP option
|
||||
and/or \fB\-\-commandprofile\fP (or using \fBLVM_COMMAND_PROFILE\fP
|
||||
environment variable), \fB\-\-profile\fP, \fB\-\-metadataprofile\fP
|
||||
option, merge all the contents of the \fBconfig cascade\fP before displaying it.
|
||||
Without the \fB\-\-mergeconfig\fP option used, only the configuration at
|
||||
the front of the cascade is displayed. See also \fBlvm.conf\fP(5) for more
|
||||
info about \fBconfig cascade\fP.
|
||||
|
||||
.TP
|
||||
.B \-\-showdeprecated
|
||||
Include deprecated configuration settings in the output. These settings
|
||||
are always deprecated since certain version. If concrete version is specified
|
||||
with \fB--atversion\fP option, deprecated settings are automatically included
|
||||
if specified version is lower that the version in which the settings were
|
||||
deprecated. The \fBcurrent\fP and \fBdiff\fP types include deprecated settings
|
||||
int their output by default, all the other types ignore deprecated settings.
|
||||
|
||||
.TP
|
||||
.B \-\-showunsupported
|
||||
Include unsupported configuration settings in the output. These settings
|
||||
are either used for debugging or development purposes only or their support
|
||||
is not yet complete and they are not meant to be used in production. The
|
||||
\fBcurrent\fP and \fBdiff\fP types include unsupported settings in their
|
||||
output by default, all the other types ignore unsupported settings.
|
||||
|
||||
.TP
|
||||
.B \-\-validate
|
||||
Validate current configuration used and exit with appropriate
|
||||
return code. The validation is done only for the configuration
|
||||
at the front of the \fBconfig cascade\fP. To validate the whole
|
||||
merged configuration tree, use also the \fB\-\-mergedconfig\fP option.
|
||||
The validation is done even if \fBconfig/checks\fP \fBlvm.conf\fP(5)
|
||||
option is disabled.
|
||||
|
||||
.TP
|
||||
.B \-\-withsummary
|
||||
Display a one line comment for each configuration node.
|
||||
|
||||
.TP
|
||||
.B \-\-withcomments
|
||||
Display a full comment for each configuration node. For deprecated
|
||||
settings, also display comments about deprecation in addition.
|
||||
|
||||
.TP
|
||||
.B \-\-withspaces
|
||||
Where appropriate, add more spaces in output for better readability.
|
||||
|
||||
.TP
|
||||
.B \-\-withversions
|
||||
Also display a comment containing the version of introduction for
|
||||
each configuration node. If the setting is deprecated, also display
|
||||
the version since which it is deprecated.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8)
|
||||
.BR lvmconf (8)
|
||||
.BR lvm.conf (5)
|
27
man/lvmdiskscan.8.in
Normal file
27
man/lvmdiskscan.8.in
Normal file
@@ -0,0 +1,27 @@
|
||||
.TH LVMDISKSCAN 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvmdiskscan \(em scan for all devices visible to LVM2
|
||||
.SH SYNOPSIS
|
||||
.B lvmdiskscan
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-l | \-\-lvmpartition ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.SH DESCRIPTION
|
||||
lvmdiskscan scans all SCSI, (E)IDE disks, multiple devices and a bunch
|
||||
of other block devices in the system looking for LVM physical volumes.
|
||||
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.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-l ", " \-\-lvmpartition
|
||||
Only reports Physical Volumes.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvm.conf (5),
|
||||
.BR pvscan (8),
|
||||
.BR vgscan (8)
|
@@ -573,37 +573,25 @@ To place the lvmlock LV on a specific device, create the VG with only that
|
||||
device, then use vgextend to add other devices.
|
||||
|
||||
|
||||
.SS LV activation
|
||||
.SS shared LVs
|
||||
|
||||
In a shared VG, activation changes involve locking through lvmlockd, and
|
||||
the following values are possible with lvchange/vgchange -a:
|
||||
When an LV is used concurrently from multiple hosts (e.g. by a
|
||||
multi\-host/cluster application or file system), the LV can be activated
|
||||
on multiple hosts concurrently using a shared lock.
|
||||
|
||||
.IP \fBy\fP|\fBey\fP
|
||||
The command activates the LV in exclusive mode, allowing a single host
|
||||
to activate the LV. Before activating the LV, the command uses lvmlockd
|
||||
to acquire an exclusive lock on the LV. If the lock cannot be acquired,
|
||||
the LV is not activated and an error is reported. This would happen if
|
||||
the LV is active on another host.
|
||||
To activate the LV with a shared lock: lvchange \-asy vg/lv.
|
||||
|
||||
.IP \fBsy\fP
|
||||
The command activates the LV in shared mode, allowing multiple hosts to
|
||||
activate the LV concurrently. Before activating the LV, the
|
||||
command uses lvmlockd to acquire a shared lock on the LV. If the lock
|
||||
cannot be acquired, the LV is not activated and an error is reported.
|
||||
This would happen if the LV is active exclusively on another host. If the
|
||||
LV type prohibits shared access, such as a snapshot, the command will
|
||||
report an error and fail.
|
||||
The shared mode is intended for a multi\-host/cluster application or
|
||||
file system.
|
||||
LV types that cannot be used concurrently
|
||||
With lvmlockd, an unspecified activation mode is always exclusive, i.e.
|
||||
\-ay defaults to \-aey.
|
||||
|
||||
If the LV type does not allow the LV to be used concurrently from multiple
|
||||
hosts, then a shared activation lock is not allowed and the lvchange
|
||||
command will report an error. LV types that cannot be used concurrently
|
||||
from multiple hosts include thin, cache, raid, mirror, and snapshot.
|
||||
|
||||
lvextend on LV with shared locks is not yet allowed. The LV must be
|
||||
deactivated, or activated exclusively to run lvextend.
|
||||
|
||||
.IP \fBn\fP
|
||||
The command deactivates the LV. After deactivating the LV, the command
|
||||
uses lvmlockd to release the current lock on the LV.
|
||||
|
||||
|
||||
.SS recover from lost PV holding sanlock locks
|
||||
|
||||
|
16
man/lvmsadc.8.in
Normal file
16
man/lvmsadc.8.in
Normal file
@@ -0,0 +1,16 @@
|
||||
.TH "LVMSADC" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
|
||||
|
||||
.SH "NAME"
|
||||
lvmsadc \(em LVM system activity data collector
|
||||
|
||||
.SH "SYNOPSIS"
|
||||
.B lvmsadc
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
lvmsadc is not currently supported under LVM2: the device-mapper statistics
|
||||
facility provides similar performance metrics using the \fBdmstats(8)\fP
|
||||
command.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR dmstats (8)
|
||||
.BR lvm (8)
|
16
man/lvmsar.8.in
Normal file
16
man/lvmsar.8.in
Normal file
@@ -0,0 +1,16 @@
|
||||
.TH "LVMSAR" "8" "LVM TOOLS #VERSION#" "Red Hat, Inc" "\""
|
||||
|
||||
.SH "NAME"
|
||||
lvmsar \(em LVM system activity reporter
|
||||
|
||||
.SH "SYNOPSIS"
|
||||
.B lvmsar
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
lvmsar is not currently supported under LVM2: the device-mapper statistics
|
||||
facility provides similar performance metrics using the \fBdmstats(8)\fP
|
||||
command.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR dmstats (8)
|
||||
.BR lvm (8)
|
@@ -157,17 +157,17 @@ The --thinpool argument specifies which thin pool will
|
||||
contain the ThinLV.
|
||||
.fi
|
||||
|
||||
.B lvcreate \-n ThinLV \-V VirtualSize \-\-thinpool ThinPoolLV VG
|
||||
.B lvcreate \-n ThinLV \-V VirtualSize \-\-thinpool VG/ThinPoolLV
|
||||
|
||||
.I Example
|
||||
.br
|
||||
Create a thin LV in a thin pool:
|
||||
.br
|
||||
# lvcreate \-n thin1 \-V 1T \-\-thinpool pool0 vg
|
||||
# lvcreate \-n thin1 \-V 1T \-\-thinpool vg/pool0
|
||||
|
||||
Create another thin LV in the same thin pool:
|
||||
.br
|
||||
# lvcreate \-n thin2 \-V 1T \-\-thinpool pool0 vg
|
||||
# lvcreate \-n thin2 \-V 1T \-\-thinpool vg/pool0
|
||||
|
||||
# lvs vg/thin1 vg/thin2
|
||||
LV VG Attr LSize Pool Origin Data%
|
||||
@@ -184,9 +184,9 @@ when creating a thin snapshot.
|
||||
.br
|
||||
A size argument will cause an old COW snapshot to be created.
|
||||
|
||||
.B lvcreate \-n SnapLV \-\-snapshot VG/ThinLV
|
||||
.B lvcreate \-n SnapLV \-s VG/ThinLV
|
||||
.br
|
||||
.B lvcreate \-n SnapLV \-\-snapshot VG/PrevSnapLV
|
||||
.B lvcreate \-n SnapLV \-s VG/PrevSnapLV
|
||||
|
||||
.I Example
|
||||
.br
|
||||
@@ -286,12 +286,15 @@ 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:
|
||||
An existing LV is converted to a thin pool by changing its type to
|
||||
thin-pool. 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.
|
||||
The thin-pool type is inferred by lvm; the --thinpool option is not an
|
||||
alias for --type thin-pool. The use of the --thinpool option here is
|
||||
different from the use of the --thinpool option when creating a thin LV,
|
||||
where it specifies the pool in which the thin LV is created.
|
||||
|
||||
|
||||
.SS Automatic pool metadata LV
|
||||
@@ -1231,7 +1234,7 @@ and creates a thin LV in the new pool.
|
||||
.br
|
||||
\-V VirtualSize specifies the virtual size of the thin LV.
|
||||
|
||||
.B lvcreate \-\-type thin \-V VirtualSize \-L LargeSize
|
||||
.B lvcreate \-V VirtualSize \-L LargeSize
|
||||
.RS
|
||||
.B \-n ThinLV \-\-thinpool VG/ThinPoolLV
|
||||
.RE
|
||||
|
110
man/lvreduce.8.in
Normal file
110
man/lvreduce.8.in
Normal file
@@ -0,0 +1,110 @@
|
||||
.TH LVREDUCE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvreduce \(em reduce the size of a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvreduce
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB { \-l | \-\-extents
|
||||
.RI [ \- ] LogicalExtentsNumber [ % { VG | LV | FREE | ORIGIN }]
|
||||
.RB |
|
||||
.BR \-L | \-\-size
|
||||
.RI [ \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]}
|
||||
.RB [ \-n | \-\-nofsck ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-r | \-\-resizefs ]
|
||||
.IR LogicalVolume { Name | Path }
|
||||
.SH DESCRIPTION
|
||||
lvreduce allows you to reduce the size of a logical volume.
|
||||
Be careful when reducing a logical volume's size, because data in the
|
||||
reduced part is lost!!!
|
||||
.br
|
||||
You should therefore ensure that any filesystem on the volume is
|
||||
resized
|
||||
.I before
|
||||
running lvreduce so that the extents that are to be removed are not in use.
|
||||
.br
|
||||
Shrinking snapshot logical volumes (see
|
||||
.BR lvcreate (8)
|
||||
for information to create snapshots) is supported as well.
|
||||
But to change the number of copies in a mirrored logical
|
||||
volume use
|
||||
.BR lvconvert (8).
|
||||
.br
|
||||
Sizes will be rounded if necessary - for example, the volume size must
|
||||
be an exact number of extents and the size of a striped segment must
|
||||
be a multiple of the number of stripes.
|
||||
.br
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Force size reduction without prompting even when it may cause data loss.
|
||||
.TP
|
||||
.IR \fB\-l ", " \fB\-\-extents " [" \- ] LogicalExtentsNumber [ % { VG | LV | FREE | ORIGIN }]
|
||||
Reduce or set the logical volume size in units of logical extents.
|
||||
With the \fI-\fP sign the value will be subtracted from
|
||||
the logical volume's actual size and without it the value will be taken
|
||||
as an absolute size.
|
||||
The total number of physical extents freed will be greater than this logical
|
||||
value if, for example, the volume is mirrored.
|
||||
The number can also be expressed as a percentage of the total space
|
||||
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
|
||||
size of the Logical Volume with the suffix \fI%LV\fP, as a percentage of the
|
||||
remaining free space in the Volume Group with the suffix \fI%FREE\fP, or (for
|
||||
a snapshot) as a percentage of the total space in the Origin Logical
|
||||
Volume with the suffix \fI%ORIGIN\fP.
|
||||
The resulting value for the subtraction is rounded downward, for the absolute
|
||||
size it is rounded upward.
|
||||
N.B. In a future release, when expressed as a percentage with VG or FREE, the
|
||||
number will be treated as an approximate total number of physical extents to be
|
||||
freed (including extents used by any mirrors, for example). The code may
|
||||
currently release more space than you might otherwise expect.
|
||||
.TP
|
||||
.IR \fB\-L ", " \fB\-\-size " [" \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
|
||||
Reduce or set the logical volume size in units of megabytes.
|
||||
A size suffix of \fIk\fP for kilobyte, \fIm\fP for megabyte,
|
||||
\fIg\fP for gigabytes, \fIt\fP for terabytes, \fIp\fP for petabytes
|
||||
or \fIe\fP for exabytes is optional.
|
||||
With the \fI\-\fP sign the value will be subtracted from
|
||||
the logical volume's actual size and without it it will be taken as
|
||||
an absolute size.
|
||||
.TP
|
||||
.BR \-n ", " \-\-nofsck
|
||||
Do not perform fsck before resizing filesystem when filesystem
|
||||
requires it. You may need to use \fB\-\-force\fR to proceed with
|
||||
this option.
|
||||
.TP
|
||||
.BR \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.TP
|
||||
.BR \-r ", " \-\-resizefs
|
||||
Resize underlying filesystem together with the logical volume using
|
||||
.BR fsadm (8).
|
||||
.SH Examples
|
||||
Reduce the size of logical volume lvol1 in volume group vg00 by 3 logical extents:
|
||||
.sp
|
||||
.B lvreduce \-l \-3 vg00/lvol1
|
||||
.SH SEE ALSO
|
||||
.BR fsadm (8),
|
||||
.BR lvchange (8),
|
||||
.BR lvconvert (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvextend (8),
|
||||
.BR lvm (8),
|
||||
.BR lvresize (8),
|
||||
.BR vgreduce (8)
|
80
man/lvremove.8.in
Normal file
80
man/lvremove.8.in
Normal file
@@ -0,0 +1,80 @@
|
||||
.TH LVREMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvremove \(em remove a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvremove
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-nohistory ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RI [ LogicalVolume { Name | Path }...]
|
||||
.SH DESCRIPTION
|
||||
lvremove removes one or more logical volumes.
|
||||
Confirmation will be requested before deactivating any active logical
|
||||
volume prior to removal. Logical volumes cannot be deactivated
|
||||
or removed while they are open (e.g. if they contain a mounted filesystem).
|
||||
Removing an origin logical volume will also remove all dependent snapshots.
|
||||
.sp
|
||||
If the logical volume is clustered then it must be deactivated on all
|
||||
nodes in the cluster before it can be removed. A single lvchange command
|
||||
issued from one node can do this.
|
||||
.sp
|
||||
If the configuration setting \fBmetadata/record_lvs_history\fP is enabled
|
||||
and the logical volume being removed forms part of the history of at least
|
||||
one logical volume that is still present then a simplified representation of
|
||||
the logical volume 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) and
|
||||
allows you to see the ancestry chain of thin snapshot volumes even after
|
||||
some intermediate logical volumes have been removed.
|
||||
The names of such historical logical volumes 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 logical volume completely.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Remove active logical volumes without confirmation.
|
||||
Tool will try to deactivate \fIunused\fP volume.
|
||||
To proceed with damaged pools use \-ff
|
||||
.TP
|
||||
.B \-\-nohistory
|
||||
Disable the recording of history of logical volumes which are being removed.
|
||||
(This has no effect unless the configuration setting
|
||||
\fBmetadata/record_lvs_history\fP is enabled.)
|
||||
.TP
|
||||
.B \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.SH Examples
|
||||
Remove the active logical volume lvol1 in volume group vg00
|
||||
without asking for confirmation:
|
||||
.sp
|
||||
.B lvremove \-f vg00/lvol1
|
||||
.sp
|
||||
Remove all logical volumes in volume group vg00:
|
||||
.sp
|
||||
.B lvremove vg00
|
||||
.SH SEE ALSO
|
||||
.BR lvcreate (8),
|
||||
.BR lvdisplay (8),
|
||||
.BR lvchange (8),
|
||||
.BR lvm (8),
|
||||
.BR lvs (8),
|
||||
.BR lvscan (8),
|
||||
.BR vgremove (8)
|
51
man/lvrename.8.in
Normal file
51
man/lvrename.8.in
Normal file
@@ -0,0 +1,51 @@
|
||||
.TH LVRENAME 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvrename \(em rename a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvrename
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RI { OldLogicalVolume { Name | Path }
|
||||
.IR NewLogicalVolume { Name | Path }
|
||||
|
|
||||
.I VolumeGroupName OldLogicalVolumeName NewLogicalVolumeName\fR}
|
||||
.SH DESCRIPTION
|
||||
lvrename renames an existing logical volume or an existing
|
||||
historical logical volume from
|
||||
.IR OldLogicalVolume { Name | Path }
|
||||
to
|
||||
.IR NewLogicalVolume { Name | Path }.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.SH EXAMPLE
|
||||
To rename lvold in volume group vg02 to lvnew:
|
||||
.sp
|
||||
.B lvrename /dev/vg02/lvold vg02/lvnew
|
||||
.sp
|
||||
An alternate syntax to rename this logical volume is:
|
||||
.sp
|
||||
.B lvrename vg02 lvold lvnew
|
||||
.sp
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvchange (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgrename (8)
|
124
man/lvresize.8.in
Normal file
124
man/lvresize.8.in
Normal file
@@ -0,0 +1,124 @@
|
||||
.TH LVRESIZE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvresize \(em resize a logical volume
|
||||
.SH SYNOPSIS
|
||||
.B lvresize
|
||||
.RB [ \-\-alloc " " \fIAllocationPolicy ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-i | \-\-stripes " " \fIStripes
|
||||
.RB [ \-I | \-\-stripesize " " \fIStripeSize ]]
|
||||
.RB { \-l | \-\-extents
|
||||
.RI [ + | \- ] LogicalExtentsNumber [ % { VG | LV | PVS | FREE | ORIGIN "}] |"
|
||||
.BR \-L | \-\-size
|
||||
.RI [ + | \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]}
|
||||
.RB [ \-\-poolmetadatasize
|
||||
.RI [ + ] MetadataVolumeSize [ bBsSkKmMgG ]]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-n | \-\-nofsck ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-r | \-\-resizefs ]
|
||||
.IR LogicalVolume { Name | Path }
|
||||
.RI [ PhysicalVolumePath [ :PE [ \-PE ]]...]
|
||||
.SH DESCRIPTION
|
||||
lvresize allows you to resize a logical volume.
|
||||
Be careful when reducing a logical volume's size, because data in the reduced
|
||||
part is lost!!!
|
||||
You should therefore ensure that any filesystem on the volume is
|
||||
shrunk first so that the extents that are to be removed are not in use.
|
||||
Resizing snapshot logical volumes (see
|
||||
.BR lvcreate (8)
|
||||
for information about creating snapshots) is supported as well.
|
||||
But to change the number of copies in a mirrored logical
|
||||
volume use
|
||||
.BR lvconvert (8).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Force resize without prompting even when it may cause data loss.
|
||||
.TP
|
||||
.BR \-n ", " \-\-nofsck
|
||||
Do not perform fsck before resizing filesystem when filesystem
|
||||
requires it. You may need to use \fB\-\-force\fR to proceed with
|
||||
this option.
|
||||
.TP
|
||||
.BR \-r ", " \-\-resizefs
|
||||
Resize underlying filesystem together with the logical volume using
|
||||
\fBfsadm\fR(8).
|
||||
.TP
|
||||
.IR \fB\-l ", " \fB\-\-extents " [" + | \- ] LogicalExtentsNumber [ % { VG | LV | PVS | FREE | ORIGIN }]
|
||||
Change or set the logical volume size in units of logical extents.
|
||||
With the \fI+\fP or \fI\-\fP sign the value is added to or subtracted from the actual size
|
||||
of the logical volume and without it, the value is taken as an absolute one.
|
||||
The total number of physical extents affected will be
|
||||
greater than this if, for example, the volume is mirrored.
|
||||
The number can also be expressed as a percentage of the total space
|
||||
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
|
||||
size of the Logical Volume with the suffix \fI%LV\fP, as a percentage of
|
||||
the remaining free space of the PhysicalVolumes on the command line with the
|
||||
suffix \fI%PVS\fP, as a percentage of the remaining free space in the
|
||||
Volume Group with the suffix \fI%FREE\fP, or (for a snapshot) as a percentage
|
||||
of the total space in the Origin Logical Volume with the suffix \fI%ORIGIN\fP.
|
||||
The resulting value is rounded downward for the subtraction otherwise
|
||||
it is rounded upward.
|
||||
N.B. In a future release, when expressed as a percentage with PVS, VG or FREE,
|
||||
the number will be treated as an approximate total number of physical extents
|
||||
to be allocated or freed (including extents used by any mirrors, for example).
|
||||
The code may currently allocate or remove more space than you might otherwise
|
||||
expect.
|
||||
.TP
|
||||
.IR \fB\-L ", " \fB\-\-size " [" + | \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
|
||||
Change or set the logical volume size in units of megabytes.
|
||||
A size suffix of \fIM\fP for megabytes,
|
||||
\fIG\fP for gigabytes, \fIT\fP for terabytes, \fIP\fP for petabytes
|
||||
or \fIE\fP for exabytes is optional.
|
||||
With the \fI+\fP or \fI\-\fP sign the value is added or subtracted
|
||||
from the actual size of the logical volume and rounded
|
||||
to the full extent size and without it,
|
||||
the value is taken as an absolute one.
|
||||
.TP
|
||||
.BR \-i ", " \-\-stripes " " \fIStripes
|
||||
Gives the number of stripes to use when extending a Logical Volume.
|
||||
Defaults to whatever the last segment of the Logical Volume uses.
|
||||
Not applicable to LVs using the original metadata LVM format, which must
|
||||
use a single value throughout.
|
||||
.TP
|
||||
.IR \fB\-\-poolmetadatasize " [" + ] MetadataVolumeSize [ bBsSkKmMgG ]
|
||||
Change or set the thin pool metadata logical volume size.
|
||||
With the \fI+\fP sign the value is added to the actual size
|
||||
of the metadata volume and rounded to the full extent size
|
||||
and without it, the value is taken as an absolute one.
|
||||
Maximal size is 16GiB. Default unit is megabytes.
|
||||
.TP
|
||||
.BR \-I ", " \-\-stripesize " " \fIStripeSize
|
||||
Gives the number of kilobytes for the granularity of the stripes.
|
||||
Defaults to whatever the last segment of the Logical Volume uses.
|
||||
Not applicable to LVs using the original metadata LVM format, which
|
||||
must use a single value throughout.
|
||||
.br
|
||||
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
|
||||
For metadata in LVM2 format, the stripe size may be a larger
|
||||
power of 2 but must not exceed the physical extent size.
|
||||
.TP
|
||||
.B \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.SH EXAMPLES
|
||||
.br
|
||||
Extend a logical volume vg1/lv1 by 16MB using physical extents
|
||||
/dev/sda:0\-1 and /dev/sdb:0\-1 for allocation of extents:
|
||||
.sp
|
||||
.B lvresize \-L+16M vg1/lv1 /dev/sda:0\-1 /dev/sdb:0\-1
|
||||
.SH SEE ALSO
|
||||
.BR fsadm (8),
|
||||
.BR lvm (8),
|
||||
.BR lvconvert (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvreduce (8),
|
||||
.BR lvchange (8)
|
290
man/lvs.8.in
Normal file
290
man/lvs.8.in
Normal file
@@ -0,0 +1,290 @@
|
||||
.TH LVS 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvs \(em report information about logical volumes
|
||||
.SH SYNOPSIS
|
||||
.B lvs
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-H | \-\-history ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-nameprefixes ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RI [ + | \- ] Key1 [,[ + | \- ] Key2 [,...]]]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-rows ]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-segments ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-\-unquoted ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName | LogicalVolume { Name | Path }
|
||||
.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
|
||||
|
||||
.SH DESCRIPTION
|
||||
lvs produces formatted output about logical volumes.
|
||||
.SH OPTIONS
|
||||
See
|
||||
.BR lvm (8)
|
||||
for common options.
|
||||
.TP
|
||||
.B \-\-aligned
|
||||
Use with \fB\-\-separator\fP to align the output columns.
|
||||
.TP
|
||||
.B \-\-all
|
||||
Include information in the output about internal Logical Volumes that
|
||||
are components of normally-accessible Logical Volumes, such as mirrors,
|
||||
but which are not independently accessible (e.g. not mountable).
|
||||
The names of such Logical Volumes are enclosed within square brackets
|
||||
in the output. For example, after creating a mirror using
|
||||
.B lvcreate -m1 \-\-mirrorlog disk
|
||||
, this option will reveal three internal Logical
|
||||
Volumes, with suffixes mimage_0, mimage_1, and mlog.
|
||||
.TP
|
||||
.B \-\-binary
|
||||
Use binary values "0" or "1" instead of descriptive literal values
|
||||
for columns that have exactly two valid values to report (not counting
|
||||
the "unknown" value which denotes that the value could not be determined).
|
||||
.TP
|
||||
.B \-\-configreport \fI ReportName
|
||||
Make any subsequent \fB\-o, \-\-options\fP, \fB\-O, \-\-sort\fP or
|
||||
\fB\-S, \-\-select\fP to apply for \fIReportName\fP where \fIReportName\fP
|
||||
is either 'lv' for command's main report or 'log' for log report.
|
||||
If \fB\-\-configreport\fP option is not used to identify a report, then
|
||||
command's main report is assumed. The log report is available only if
|
||||
enabled by \fBlog/report_command_log\fP \fBlvm.conf\fP(5) setting or
|
||||
if \fB\-\-logonly\fP option is used.
|
||||
.TP
|
||||
.B \-H ", " \-\-history
|
||||
Include historical logical volumes in the output.
|
||||
(This has no effect unless logical volumes were removed while the configuration
|
||||
setting \fBmetadata/record_lvs_history\fP was enabled.)
|
||||
.TP
|
||||
.B \-\-logonly
|
||||
Suppress the lvs report itself and display only log report on output.
|
||||
.TP
|
||||
.B \-\-nameprefixes
|
||||
Add an "LVM2_" prefix plus the field name to the output. Useful
|
||||
with \fB\-\-noheadings\fP to produce a list of field=value pairs that can
|
||||
be used to set environment variables (for example, in
|
||||
.BR udev (7)
|
||||
rules).
|
||||
.TP
|
||||
.B \-\-noheadings
|
||||
Suppress the headings line that is normally the first line of output.
|
||||
Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-nosuffix
|
||||
Suppress the suffix on output sizes. Use with \fB\-\-units\fP
|
||||
(except h and H) if processing the output.
|
||||
.TP
|
||||
.BR \-o ", " \-\-options
|
||||
Comma-separated ordered list of columns.
|
||||
.IP
|
||||
Precede the list with '\fI+\fP' to append to the current list
|
||||
of columns, '\fI-\fP' to remove from the current list of columns
|
||||
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
|
||||
be repeated, providing several lists. These lists are evaluated
|
||||
from left to right.
|
||||
.IP
|
||||
Use \fB\-o lv_all\fP to select all logical volume columns,
|
||||
and \fB\-o seg_all\fP
|
||||
to select all logical volume segment columns.
|
||||
.IP
|
||||
Use \fB\-o help\fP to view the full list of columns available.
|
||||
.IP
|
||||
Column names include:
|
||||
chunk_size,
|
||||
convert_lv,
|
||||
copy_percent,
|
||||
data_lv,
|
||||
devices,
|
||||
discards,
|
||||
lv_attr,
|
||||
lv_host,
|
||||
lv_kernel_major,
|
||||
lv_kernel_minor,
|
||||
lv_kernel_read_ahead,
|
||||
lv_major,
|
||||
lv_minor,
|
||||
lv_name,
|
||||
lv_path,
|
||||
lv_profile,
|
||||
lv_read_ahead,
|
||||
lv_size,
|
||||
lv_tags,
|
||||
lv_time,
|
||||
lv_uuid,
|
||||
metadata_lv,
|
||||
mirror_log,
|
||||
modules,
|
||||
move_pv,
|
||||
origin,
|
||||
origin_size,
|
||||
pool_lv,
|
||||
raid_max_recovery_rate,
|
||||
raid_min_recovery_rate,
|
||||
raid_mismatch_count,
|
||||
raid_sync_action,
|
||||
raid_write_behind,
|
||||
region_size,
|
||||
segtype,
|
||||
seg_count,
|
||||
seg_pe_ranges,
|
||||
seg_size,
|
||||
seg_size_pe,
|
||||
seg_start,
|
||||
seg_start_pe,
|
||||
seg_tags,
|
||||
snap_percent,
|
||||
stripes,
|
||||
stripe_size,
|
||||
sync_percent,
|
||||
thin_count,
|
||||
transaction_id,
|
||||
zero.
|
||||
.IP
|
||||
With \fB\-\-segments\fP, any "seg_" prefixes are optional;
|
||||
otherwise any "lv_" prefixes are optional. Columns mentioned in
|
||||
.BR vgs (8)
|
||||
can also be chosen.
|
||||
.IP
|
||||
The lv_attr bits are:
|
||||
.RS
|
||||
.IP 1 3
|
||||
Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin,
|
||||
(O)rigin with merging snapshot, (r)aid, (R)aid without initial sync,
|
||||
(s)napshot, merging (S)napshot, (p)vmove, (v)irtual,
|
||||
mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device,
|
||||
under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or
|
||||
pool m(e)tadata or pool metadata spare.
|
||||
.IP 2 3
|
||||
Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only
|
||||
volume
|
||||
.IP 3 3
|
||||
Allocation policy: (a)nywhere, (c)ontiguous, (i)nherited, c(l)ing, (n)ormal
|
||||
This is capitalised if the volume is currently locked against allocation
|
||||
changes, for example during
|
||||
.BR pvmove (8).
|
||||
.IP 4 3
|
||||
fixed (m)inor
|
||||
.IP 5 3
|
||||
State: (a)ctive, (h)istorical, (s)uspended, (I)nvalid snapshot,
|
||||
invalid (S)uspended snapshot, snapshot (m)erge failed,
|
||||
suspended snapshot (M)erge failed, mapped (d)evice present without tables,
|
||||
mapped device present with (i)nactive table, thin-pool (c)heck needed,
|
||||
suspended thin-pool (C)heck needed, (X) unknown
|
||||
.IP 6 3
|
||||
device (o)pen, (X) unknown
|
||||
.IP 7 3
|
||||
Target type: (C)ache, (m)irror, (r)aid, (s)napshot, (t)hin, (u)nknown, (v)irtual.
|
||||
This groups logical volumes related to the same kernel target together. So,
|
||||
for example, mirror images, mirror logs as well as mirrors themselves appear as
|
||||
(m) if they use the original device-mapper mirror kernel driver; whereas the raid
|
||||
equivalents using the md raid kernel driver all appear as (r).
|
||||
Snapshots using the original device-mapper driver appear as (s); whereas
|
||||
snapshots of thin volumes using the new thin provisioning driver appear as (t).
|
||||
.IP 8 3
|
||||
Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.
|
||||
.IP 9 3
|
||||
Volume Health, where there are currently three groups of attributes identified:
|
||||
.IP
|
||||
Common ones for all Logical Volumes: (p)artial, (X) unknown.
|
||||
.br
|
||||
(p)artial signifies that one or more of the Physical Volumes this Logical
|
||||
Volume uses is missing from the system. (X) unknown signifies the status
|
||||
is unknown.
|
||||
.IP
|
||||
Related to RAID Logical Volumes: (r)efresh needed, (m)ismatches exist, (w)ritemostly.
|
||||
.br
|
||||
(r)efresh signifies that one or more of the Physical Volumes this RAID Logical
|
||||
Volume uses had suffered a write error. The write error could be due to a
|
||||
temporary failure of that Physical Volume or an indication that it is failing.
|
||||
The device should be refreshed or replaced. (m)ismatches signifies that the
|
||||
RAID logical volume has portions of the array that are not coherent.
|
||||
Inconsistencies are detected by initiating a "check" on a RAID logical volume.
|
||||
(The scrubbing operations, "check" and "repair", can be performed on a RAID
|
||||
logical volume via the 'lvchange' command.) (w)ritemostly signifies the
|
||||
devices in a RAID 1 logical volume that have been marked write-mostly.
|
||||
.IP
|
||||
Related to Thin pool Logical Volumes: (F)ailed, out of (D)ata space,
|
||||
(M)etadata read only.
|
||||
.br
|
||||
(F)ailed is set if thin pool encounters serious failures and hence no further I/O
|
||||
is permitted at all. The out of (D)ata space is set if thin pool has run out of
|
||||
data space. (M)etadata read only signifies that thin pool encounters certain
|
||||
types of failures but it's still possible to do reads at least,
|
||||
but no metadata changes are allowed.
|
||||
.IP
|
||||
Related to Thin Logical Volumes: (F)ailed.
|
||||
.br
|
||||
(F)ailed is set when related thin pool enters Failed state and no further I/O
|
||||
is permitted at all.
|
||||
.IP 10 3
|
||||
s(k)ip activation: this volume is flagged to be skipped during activation.
|
||||
.RE
|
||||
.TP
|
||||
.BR \-O ", " \-\-sort
|
||||
Comma-separated ordered list of columns to sort by. Replaces the default
|
||||
selection. Precede any column with '\fI\-\fP' for a reverse sort on that column.
|
||||
.TP
|
||||
.B \-\-rows
|
||||
Output columns as rows.
|
||||
.TP
|
||||
.BR \-S ", " \-\-select " " \fISelection
|
||||
Display only rows that match Selection criteria. All rows are displayed with
|
||||
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
|
||||
matches the Selection and 0 otherwise. The Selection criteria are defined
|
||||
by specifying column names and their valid values (that can include reserved
|
||||
values) while making use of supported comparison operators. See \fBlvm\fP(8)
|
||||
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
|
||||
about constructing the Selection criteria. As a quick help and to see full
|
||||
list of column names that can be used in Selection including the list of
|
||||
reserved values and the set of supported selection operators, check the
|
||||
output of \fBlvs -S help\fP command.
|
||||
.TP
|
||||
.B \-\-segments
|
||||
Use default columns that emphasize segment information.
|
||||
.TP
|
||||
.B \-\-separator \fISeparator
|
||||
String to use to separate each column. Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-unbuffered
|
||||
Produce output immediately without sorting or aligning the columns properly.
|
||||
.TP
|
||||
.B \-\-units \fIhHbBsSkKmMgGtTpPeE
|
||||
All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
|
||||
(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.
|
||||
Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify
|
||||
custom units e.g. \fB\-\-units 3M\fP
|
||||
.TP
|
||||
.B \-\-unquoted
|
||||
When used with \fB\-\-nameprefixes\fP, output values in the field=value
|
||||
pairs are not quoted.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvdisplay (8),
|
||||
.BR pvs (8),
|
||||
.BR vgs (8)
|
@@ -1,75 +0,0 @@
|
||||
.SH NOTES
|
||||
.
|
||||
The lv_attr bits are:
|
||||
.IP 1 3
|
||||
Volume type: (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin,
|
||||
(O)rigin with merging snapshot, (r)aid, (R)aid without initial sync,
|
||||
(s)napshot, merging (S)napshot, (p)vmove, (v)irtual,
|
||||
mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device,
|
||||
under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or
|
||||
pool m(e)tadata or pool metadata spare.
|
||||
.IP 2 3
|
||||
Permissions: (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only
|
||||
volume
|
||||
.IP 3 3
|
||||
Allocation policy: (a)nywhere, (c)ontiguous, (i)nherited, c(l)ing, (n)ormal
|
||||
This is capitalised if the volume is currently locked against allocation
|
||||
changes, for example during
|
||||
.BR pvmove (8).
|
||||
.IP 4 3
|
||||
fixed (m)inor
|
||||
.IP 5 3
|
||||
State: (a)ctive, (h)istorical, (s)uspended, (I)nvalid snapshot,
|
||||
invalid (S)uspended snapshot, snapshot (m)erge failed,
|
||||
suspended snapshot (M)erge failed, mapped (d)evice present without tables,
|
||||
mapped device present with (i)nactive table, thin-pool (c)heck needed,
|
||||
suspended thin-pool (C)heck needed, (X) unknown
|
||||
.IP 6 3
|
||||
device (o)pen, (X) unknown
|
||||
.IP 7 3
|
||||
Target type: (C)ache, (m)irror, (r)aid, (s)napshot, (t)hin, (u)nknown, (v)irtual.
|
||||
This groups logical volumes related to the same kernel target together. So,
|
||||
for example, mirror images, mirror logs as well as mirrors themselves appear as
|
||||
(m) if they use the original device-mapper mirror kernel driver; whereas the raid
|
||||
equivalents using the md raid kernel driver all appear as (r).
|
||||
Snapshots using the original device-mapper driver appear as (s); whereas
|
||||
snapshots of thin volumes using the new thin provisioning driver appear as (t).
|
||||
.IP 8 3
|
||||
Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.
|
||||
.IP 9 3
|
||||
Volume Health, where there are currently three groups of attributes identified:
|
||||
.IP
|
||||
Common ones for all Logical Volumes: (p)artial, (X) unknown.
|
||||
.br
|
||||
(p)artial signifies that one or more of the Physical Volumes this Logical
|
||||
Volume uses is missing from the system. (X) unknown signifies the status
|
||||
is unknown.
|
||||
.IP
|
||||
Related to RAID Logical Volumes: (r)efresh needed, (m)ismatches exist, (w)ritemostly.
|
||||
.br
|
||||
(r)efresh signifies that one or more of the Physical Volumes this RAID Logical
|
||||
Volume uses had suffered a write error. The write error could be due to a
|
||||
temporary failure of that Physical Volume or an indication that it is failing.
|
||||
The device should be refreshed or replaced. (m)ismatches signifies that the
|
||||
RAID logical volume has portions of the array that are not coherent.
|
||||
Inconsistencies are detected by initiating a "check" on a RAID logical volume.
|
||||
(The scrubbing operations, "check" and "repair", can be performed on a RAID
|
||||
logical volume via the 'lvchange' command.) (w)ritemostly signifies the
|
||||
devices in a RAID 1 logical volume that have been marked write-mostly.
|
||||
.IP
|
||||
Related to Thin pool Logical Volumes: (F)ailed, out of (D)ata space,
|
||||
(M)etadata read only.
|
||||
.br
|
||||
(F)ailed is set if thin pool encounters serious failures and hence no further I/O
|
||||
is permitted at all. The out of (D)ata space is set if thin pool has run out of
|
||||
data space. (M)etadata read only signifies that thin pool encounters certain
|
||||
types of failures but it's still possible to do reads at least,
|
||||
but no metadata changes are allowed.
|
||||
.IP
|
||||
Related to Thin Logical Volumes: (F)ailed.
|
||||
.br
|
||||
(F)ailed is set when related thin pool enters Failed state and no further I/O
|
||||
is permitted at all.
|
||||
.IP 10 3
|
||||
s(k)ip activation: this volume is flagged to be skipped during activation.
|
||||
|
52
man/lvscan.8.in
Normal file
52
man/lvscan.8.in
Normal file
@@ -0,0 +1,52 @@
|
||||
.TH LVSCAN 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
lvscan \(em scan (all disks) for Logical Volumes
|
||||
.SH SYNOPSIS
|
||||
.B lvscan
|
||||
.RB [ \-a | \-\-all]
|
||||
.RB [ \-b | \-\-blockdevice ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.SH DESCRIPTION
|
||||
lvscan scans all known volume groups or all supported LVM block devices
|
||||
in the system for defined Logical Volumes. The output consists
|
||||
of one line for each Logical Volume 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 the Logical Volumes.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-\-all
|
||||
Include information in the output about internal Logical Volumes that
|
||||
are components of normally-accessible Logical Volumes, such as mirrors,
|
||||
but which are not independently accessible (e.g. not mountable).
|
||||
For example, after creating a mirror using
|
||||
.B lvcreate \-m1 \-\-mirrorlog disk\fR,
|
||||
this option will reveal three internal Logical Volumes, with suffixes
|
||||
mimage_0, mimage_1, and mlog.
|
||||
.TP
|
||||
.BR \-b ", " \-\-blockdevice
|
||||
This option is now ignored. Instead, use \fBlvs\fP(8) or
|
||||
\fBlvdisplay\fP(8) to obtain the device number.
|
||||
.TP
|
||||
.IR \fB\-\-cache " " LogicalVolume
|
||||
Applicable only when \fBlvmetad\fP(8) is in use (see also \fBlvm.conf\fP(5),
|
||||
global/use_lvmetad). This command issues a rescan of physical volume labels and
|
||||
metadata areas of all PVs that the logical volume uses. In particular, this can
|
||||
be used when a RAID logical volume becomes degraded, to update information
|
||||
about physical volume availability. This is only necessary if the logical
|
||||
volume is \fBnot\fP being monitored by dmeventd (see \fBlvchange\fP(8), option
|
||||
\fB\-\-monitor\fP).
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvdisplay (8)
|
||||
.BR lvs (8)
|
59
man/pvchange.8.in
Normal file
59
man/pvchange.8.in
Normal file
@@ -0,0 +1,59 @@
|
||||
.TH PVCHANGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvchange \(em change attributes of a physical volume
|
||||
.SH SYNOPSIS
|
||||
.B pvchange
|
||||
.RB [ \-\-addtag
|
||||
.IR Tag ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-\-deltag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-metadataignore
|
||||
.RI { y | n }]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-x | \-\-allocatable
|
||||
.RI { y | n }]
|
||||
.RB [ \-u | \-\-uuid ]
|
||||
.RI [ PhysicalVolumePath ...]
|
||||
.SH DESCRIPTION
|
||||
pvchange allows you to change the allocation permissions of one or
|
||||
more physical volumes.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-a ", " \-\-all
|
||||
If PhysicalVolumePath is not specified on the command line all
|
||||
physical volumes are searched for and used.
|
||||
.TP
|
||||
.BR \-\-metadataignore " {" \fIy | \fIn }
|
||||
Ignore or un-ignore metadata areas on this physical volume.
|
||||
If metadata areas on a physical volume are ignored, LVM will
|
||||
not not store metadata in the metadata areas present on this Physical
|
||||
Volume.
|
||||
.TP
|
||||
.BR \-u ", " \-\-uuid
|
||||
Generate new random UUID for specified physical volumes.
|
||||
.TP
|
||||
.BR \-x ", " \-\-allocatable " {" \fIy | \fIn }
|
||||
Enable or disable allocation of physical extents on this physical volume.
|
||||
.SH Example
|
||||
Disallows the allocation of physical extents on this physical volume
|
||||
(possibly because of disk errors, or because it will be removed after
|
||||
freeing it:
|
||||
.sp
|
||||
.B pvchange \-x n /dev/sdk1
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvcreate (8)
|
37
man/pvck.8.in
Normal file
37
man/pvck.8.in
Normal file
@@ -0,0 +1,37 @@
|
||||
.TH PVCK 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvck \(em check physical volume metadata
|
||||
.SH SYNOPSIS
|
||||
.B pvck
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-labelsector
|
||||
.IR sector ]
|
||||
.I PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]
|
||||
.SH DESCRIPTION
|
||||
pvck checks physical volume LVM metadata for consistency.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-labelsector \fIsector
|
||||
By default, 4 sectors of \fBPhysicalVolume\fP are scanned for an LVM label,
|
||||
starting at sector 0. This parameter allows you to specify a different
|
||||
starting sector for the scan and is useful for recovery situations. For
|
||||
example, suppose the partition table is corrupted or lost on /dev/sda,
|
||||
but you suspect there was an LVM partition at approximately 100 MiB. This
|
||||
area of the disk may be scanned by using the \fB\-\-labelsector\fP parameter
|
||||
with a value of 204800 (100 * 1024 * 1024 / 512 = 204800):
|
||||
.sp
|
||||
.B pvck \-\-labelsector 204800 /dev/sda
|
||||
.sp
|
||||
Note that a script can be used with \fB\-\-labelsector\fP to automate the
|
||||
process of finding LVM labels.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvcreate (8),
|
||||
.BR pvscan (8)
|
||||
.BR vgck (8)
|
210
man/pvcreate.8.in
Normal file
210
man/pvcreate.8.in
Normal file
@@ -0,0 +1,210 @@
|
||||
.TH PVCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvcreate \(em initialize a disk or partition for use by LVM
|
||||
.SH SYNOPSIS
|
||||
.B pvcreate
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-f [ f ]| \-\-force
|
||||
.RB [ \-\-force ]]
|
||||
.RB [ \-y | \-\-yes ]
|
||||
.RB [ \-\-labelsector ]
|
||||
.RB [ \-\-bootloaderareasize
|
||||
.IR size ]
|
||||
.RB [ \-M | \-\-metadatatype
|
||||
.IR type ]
|
||||
.RB [ \-\- [ pv ] metadatacopies
|
||||
.IR NumberOfCopies ]
|
||||
.RB [ \-\-metadatasize
|
||||
.IR size ]
|
||||
.RB [ \-\-metadataignore
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-dataalignment
|
||||
.IR alignment ]
|
||||
.RB [ \-\-dataalignmentoffset
|
||||
.IR alignment_offset ]
|
||||
.RB [ \-\-restorefile
|
||||
.IR file ]
|
||||
.RB [ \-\-norestorefile ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-setphysicalvolumesize
|
||||
.IR size ]
|
||||
.RB [ \-u | \-\-uuid
|
||||
.IR uuid ]
|
||||
.RB [ \-Z | \-\-zero
|
||||
.RI { y | n }]
|
||||
.I PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]
|
||||
.SH DESCRIPTION
|
||||
pvcreate initializes
|
||||
.I PhysicalVolume
|
||||
for later use by the Logical Volume Manager (LVM). Each
|
||||
.I PhysicalVolume
|
||||
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
|
||||
.B 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:
|
||||
.sp
|
||||
.BI "dd if=/dev/zero of=" PhysicalVolume " bs=512 count=1"
|
||||
.sp
|
||||
Continue with
|
||||
.BR vgcreate (8)
|
||||
to create a new volume group on
|
||||
.IR PhysicalVolume ,
|
||||
or
|
||||
.BR vgextend (8)
|
||||
to add
|
||||
.I PhysicalVolume
|
||||
to an existing volume group.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Force the creation without any confirmation. You can not recreate
|
||||
(reinitialize) a physical volume belonging to an existing volume group.
|
||||
In an emergency you can override this behaviour with \fB-ff\fP.
|
||||
.TP
|
||||
.BR \-u ", " \-\-uuid " " \fIuuid
|
||||
Specify the uuid for the device.
|
||||
Without this option, \fBpvcreate\fP(8) generates a random uuid.
|
||||
All of your physical volumes must have unique uuids.
|
||||
You need to use this option before restoring a backup of LVM metadata
|
||||
onto a replacement device - see \fBvgcfgrestore\fP(8). As such, use of
|
||||
\fB\-\-restorefile\fP is compulsory unless the \fB\-\-norestorefile\fP is
|
||||
used.
|
||||
.TP
|
||||
.BR \-y ", " \-\-yes
|
||||
Answer yes to all questions.
|
||||
.TP
|
||||
.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
|
||||
Whether or not the first 4 sectors (2048 bytes) of the device should be
|
||||
wiped.
|
||||
If this option is not given, the
|
||||
default is to wipe these sectors unless either or both of the
|
||||
\fB\-\-restorefile\fP or \fB\-\-uuid\fP options were specified.
|
||||
.SH NEW METADATA OPTIONS
|
||||
LVM2 introduces a new format for storing metadata on disk.
|
||||
This new format is more efficient and resilient than the format the
|
||||
original version of LVM used and offers the advanced user greater
|
||||
flexibility and control.
|
||||
.P
|
||||
The new format may be selected on the command line with \fB\-M2\fP or by
|
||||
setting \fBformat = "lvm2"\fP in the \fBglobal\fP section of \fBlvm.conf\fP(5).
|
||||
Each physical volume in the same volume group must use the same format, but
|
||||
different volume groups on a machine may use different formats
|
||||
simultaneously: the tools can handle both formats.
|
||||
Additional formats can be added as shared libraries.
|
||||
.P
|
||||
Additional tools for manipulating the locations and sizes of metadata areas
|
||||
will be written in due course. Use the verbose/debug options on the tools
|
||||
to see where the metadata areas are placed.
|
||||
.TP
|
||||
.B \-\-metadatasize \fIsize
|
||||
The approximate amount of space to be set aside for each metadata area.
|
||||
(The size you specify may get rounded.)
|
||||
.TP
|
||||
.B \-\-dataalignment \fIalignment
|
||||
Align the start of the data to a multiple of this number.
|
||||
You should also specify an appropriate \fIPhysicalExtentSize\fP when creating
|
||||
the Volume Group with \fBvgcreate\fP.
|
||||
.sp
|
||||
To see the location of the first Physical Extent of an existing Physical Volume
|
||||
use \fBpvs \-o +pe_start\fP . It will be a multiple of the requested
|
||||
alignment. In addition it may be shifted by \fIalignment_offset\fP from
|
||||
\fIdata_alignment_offset_detection\fP (if enabled in \fBlvm.conf\fP(5)) or
|
||||
\fB\-\-dataalignmentoffset\fP.
|
||||
.TP
|
||||
.B \-\-dataalignmentoffset \fIalignment_offset
|
||||
Shift the start of the data area by this additional \fIalignment_offset\fP.
|
||||
.TP
|
||||
.BR \-\- [ pv ] metadatacopies " " \fINumberOfCopies
|
||||
The number of metadata areas to set aside on each PV. Currently
|
||||
this can be 0, 1 or 2.
|
||||
If set to 2, two copies of the volume group metadata
|
||||
are held on the PV, one at the front of the PV and one at the end.
|
||||
If set to 1 (the default), one copy is kept at the front of the PV
|
||||
(starting in the 5th sector).
|
||||
If set to 0, no copies are kept on this PV - you might wish to use this
|
||||
with VGs containing large numbers of PVs. But if you do this and
|
||||
then later use \fBvgsplit\fP(8) you must ensure that each VG is still going
|
||||
to have a suitable number of copies of the metadata after the split!
|
||||
.TP
|
||||
.BR \-\-metadataignore " {" \fIy | \fIn }
|
||||
Ignore or un-ignore metadata areas on this physical volume.
|
||||
The default is "n". This setting can be changed with \fBpvchange\fP.
|
||||
If metadata areas on a physical volume are ignored, LVM will
|
||||
not store metadata in the metadata areas present on this Physical
|
||||
Volume. Metadata areas cannot be created or extended after Logical
|
||||
Volumes have been allocated on the device. If you do not want to store
|
||||
metadata on this device, it is still wise always to allocate a metadata
|
||||
area in case you need it in the future and to use this option to instruct
|
||||
LVM2 to ignore it.
|
||||
.TP
|
||||
.B \-\-restorefile \fIfile
|
||||
In conjunction with \fB\-\-uuid\fP, this extracts the location and size
|
||||
of the data on the PV from the file (produced by \fBvgcfgbackup\fP)
|
||||
and ensures that the metadata that the program produces is consistent
|
||||
with the contents of the file i.e. the physical extents will be in
|
||||
the same place and not get overwritten by new metadata. This provides
|
||||
a mechanism to upgrade the metadata format or to add/remove metadata
|
||||
areas. Use with care. See also \fBvgconvert\fP(8).
|
||||
.TP
|
||||
.B \-\-norestorefile
|
||||
In conjunction with \fB\-\-uuid\fP, this allows a \fIuuid\fP to be specified
|
||||
without also requiring that a backup of the metadata be provided.
|
||||
.TP
|
||||
.B \-\-labelsector \fIsector
|
||||
By default the PV is labelled with an LVM2 identifier in its second
|
||||
sector (sector 1). This lets you use a different sector near the
|
||||
start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS
|
||||
in the source). Use with care.
|
||||
.TP
|
||||
.B \-\-bootloaderareasize \fIsize
|
||||
Create a separate bootloader area of specified size besides PV's data
|
||||
area. The bootloader area is an area of reserved space on the PV from
|
||||
which LVM2 will not allocate any extents and it's kept untouched. This is
|
||||
primarily aimed for use with bootloaders to embed their own data or metadata.
|
||||
The start of the bootloader area is always aligned, see also \fB\-\-dataalignment\fP
|
||||
and \fB\-\-dataalignmentoffset\fP. The bootloader area size may eventually
|
||||
end up increased due to the alignment, but it's never less than the
|
||||
size that is requested. To see the bootloader area start and size of
|
||||
an existing Physical Volume use \fBpvs \-o +pv_ba_start,pv_ba_size\fP.
|
||||
.TP
|
||||
.B \-\-setphysicalvolumesize \fIsize
|
||||
Overrides the automatically-detected size of the PV. Use with care.
|
||||
.SH Examples
|
||||
Initialize partition #4 on the third SCSI disk and the entire fifth
|
||||
SCSI disk for later use by LVM:
|
||||
.sp
|
||||
.B pvcreate /dev/sdc4 /dev/sde
|
||||
|
||||
If the 2nd SCSI disk 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:
|
||||
.sp
|
||||
.B pvcreate \-\-dataalignmentoffset 7s /dev/sdb
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm.conf (5),
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgextend (8),
|
||||
.BR lvcreate (8),
|
||||
.BR cfdisk (8),
|
||||
.BR fdisk (8),
|
||||
.BR losetup (8),
|
||||
.BR mdadm (8),
|
||||
.BR vgcfgrestore (8),
|
||||
.BR vgconvert (8)
|
109
man/pvdisplay.8.in
Normal file
109
man/pvdisplay.8.in
Normal file
@@ -0,0 +1,109 @@
|
||||
.TH PVDISPLAY 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvdisplay \- display attributes of a physical volume
|
||||
.SH SYNOPSIS
|
||||
.B pvdisplay
|
||||
.RB [ \-c | \-\-colon ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-maps ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-s | \-\-short ]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-\-units
|
||||
.IR hsbkmgtHKMGT ]
|
||||
.RB [ \-v [ v ]| \-\-verbose
|
||||
.RB [ \-\-verbose ]]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ PhysicalVolumePath ...]
|
||||
.br
|
||||
|
||||
.br
|
||||
.B pvdisplay
|
||||
.BR \-C | \-\-columns
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-commandprofile
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-v [ v ]| \-\-verbose
|
||||
.RB [ \-\-verbose ]]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ PhysicalVolumePath ...]
|
||||
.SH DESCRIPTION
|
||||
pvdisplay allows you to see the attributes of one or more physical volumes
|
||||
like size, physical extent size, space used for the volume group descriptor
|
||||
area and so on.
|
||||
.P
|
||||
\fBpvs\fP(8) is an alternative that provides the same information
|
||||
in the style of \fBps\fP(1).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-C ", " \-\-columns
|
||||
Display output in columns, the equivalent of \fBpvs\fP(8). See
|
||||
\fBpvs\fP(8) for a description of other options with this form of
|
||||
\fBpvdisplay\fP.
|
||||
.TP
|
||||
.BR \-c ", " \-\-colon
|
||||
Generate colon separated output for easier parsing in scripts or programs.
|
||||
N.B. \fBpvs\fP(8) provides considerably more control over the output.
|
||||
.nf
|
||||
|
||||
The values are:
|
||||
|
||||
\(bu physical volume device name
|
||||
\(bu volume group name
|
||||
\(bu physical volume size in sectors
|
||||
\(bu internal physical volume number (obsolete)
|
||||
\(bu physical volume status
|
||||
\(bu physical volume (not) allocatable
|
||||
\(bu current number of logical volumes on this physical volume
|
||||
\(bu physical extent size in kilobytes
|
||||
\(bu total number of physical extents
|
||||
\(bu free number of physical extents
|
||||
\(bu allocated number of physical extents
|
||||
|
||||
.fi
|
||||
.TP
|
||||
.BR \-s ", " \-\-short
|
||||
Only display the size of the given physical volumes.
|
||||
.TP
|
||||
.BR \-m ", " \-\-maps
|
||||
Display the mapping of physical extents to logical volumes and
|
||||
logical extents.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvs (8),
|
||||
.BR pvcreate (8),
|
||||
.BR lvcreate (8),
|
||||
.BR vgcreate (8)
|
187
man/pvmove.8.in
Normal file
187
man/pvmove.8.in
Normal file
@@ -0,0 +1,187 @@
|
||||
.TH PVMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvmove \(em move physical extents
|
||||
.SH SYNOPSIS
|
||||
.B pvmove
|
||||
.RB [ \-\-abort ]
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-\-atomic ]
|
||||
.RB [ \-b | \-\-background ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-i | \-\-interval
|
||||
.IR Seconds ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-n | \-\-name
|
||||
.IR LogicalVolume ]
|
||||
.RI [ SourcePhysicalVolume [ :PE [ \-PE ]...]
|
||||
.RI [ DestinationPhysicalVolume [ :PE [ \-PE ]...]...]]
|
||||
.SH DESCRIPTION
|
||||
pvmove allows you to move the allocated physical extents (PEs) on
|
||||
.I SourcePhysicalVolume
|
||||
to one or more other physical volumes (PVs).
|
||||
You can optionally specify a source
|
||||
.I LogicalVolume
|
||||
in which case only extents used by that LV will be moved to
|
||||
free (or specified) extents on
|
||||
.IR DestinationPhysicalVolume (s).
|
||||
If no
|
||||
.I DestinationPhysicalVolume
|
||||
is specified, the normal allocation rules for the Volume Group are used.
|
||||
|
||||
If pvmove gets interrupted for any reason (e.g. the machine crashes)
|
||||
then run pvmove again without any PhysicalVolume arguments to
|
||||
restart any moves that were in progress from the last checkpoint.
|
||||
Alternatively use \fBpvmove \-\-abort\fP at any time to abort. The
|
||||
resulting location of logical volumes after an abort is issued depends
|
||||
on whether the
|
||||
.B \-\-atomic
|
||||
option was used when starting the pvmove process.
|
||||
|
||||
You can run more than one pvmove at once provided they are moving data
|
||||
off different SourcePhysicalVolumes, but additional pvmoves will ignore
|
||||
any Logical Volumes already in the process of being changed, so some
|
||||
data might not get moved.
|
||||
|
||||
\fBpvmove\fP works as follows:
|
||||
|
||||
1. A temporary 'pvmove' Logical Volume is created to store
|
||||
details of all the data movements required.
|
||||
|
||||
2. Every Logical Volume in the Volume Group is searched
|
||||
for contiguous data that need moving
|
||||
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
|
||||
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.
|
||||
|
||||
3. The Volume Group metadata is updated on disk.
|
||||
|
||||
4. The first segment of the pvmove Logical Volume is activated and starts
|
||||
to mirror the first part of the data. Only one segment is mirrored at once
|
||||
as this is usually more efficient.
|
||||
|
||||
5. A daemon repeatedly checks progress at the specified time interval.
|
||||
When it detects that the first temporary mirror is in-sync,
|
||||
it breaks that mirror so that only the new location for that data gets used
|
||||
and writes a checkpoint into the Volume Group metadata on disk.
|
||||
Then it activates the mirror for the next segment of the pvmove LV.
|
||||
|
||||
6. When there are no more segments left to be mirrored,
|
||||
the temporary Logical Volume is removed and the Volume Group metadata
|
||||
is updated so that the Logical Volumes reflect the new data locations.
|
||||
|
||||
Note that this new process cannot support the original LVM1
|
||||
type of on-disk metadata. Metadata can be converted using \fBvgconvert\fP(8).
|
||||
|
||||
If the
|
||||
.B \-\-atomic
|
||||
option is used, a slightly different approach is used for the move. Again,
|
||||
a temporary 'pvmove' logical volume is created to store the details of all
|
||||
the data movements required. This temporary LV contains all the segments of
|
||||
the various LVs that need to be moved. However this time, an identical
|
||||
logical volume is allocated that contains the same number of segments and
|
||||
a mirror is created to copy the contents from the first temporary LV to the
|
||||
second. When a complete copy is accomplished, the temporary logical volumes
|
||||
are removed, leaving behind the segments on the destination physical volume.
|
||||
If an abort is issued during the move, all logical volumes being moved will
|
||||
remain on the source physical volume.
|
||||
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-abort
|
||||
Abort any moves in progress. If the
|
||||
.B \-\-atomic
|
||||
option was used to start the pvmove, all logical volumes will remain on
|
||||
the source physical volume. Otherwise, those segments that have completed
|
||||
the move will stay on the destination physical volume, while those that
|
||||
have not will remain on the source physical volume.
|
||||
.TP
|
||||
.B \-\-atomic
|
||||
Make the entire operation atomic. That is, ensure that all affected logical
|
||||
volumes are moved to the destination physical volume together; unless the move
|
||||
has been aborted. If the move has been aborted, all logical volumes will
|
||||
remain on the source physical volume.
|
||||
.TP
|
||||
.B \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.TP
|
||||
.BR \-b ", " \-\-background
|
||||
Run the daemon in the background.
|
||||
.TP
|
||||
.BR \-i ", " \-\-interval " " \fISeconds
|
||||
Report progress as a percentage at regular intervals.
|
||||
.TP
|
||||
.BR \-n ", " \-\-name " " \fILogicalVolume
|
||||
Move only the extents belonging to
|
||||
.I LogicalVolume
|
||||
from
|
||||
.I SourcePhysicalVolume
|
||||
instead of all allocated extents to the destination physical volume(s).
|
||||
|
||||
.SH Examples
|
||||
To move all Physical Extents that are used by simple Logical Volumes on
|
||||
/dev/sdb1 to free Physical Extents elsewhere in the Volume Group use:
|
||||
.sp
|
||||
.B pvmove /dev/sdb1
|
||||
.P
|
||||
Additionally, a specific destination device /dev/sdc1
|
||||
can be specified like this:
|
||||
.sp
|
||||
.B pvmove /dev/sdb1 /dev/sdc1
|
||||
.P
|
||||
To perform the action only on extents belonging to the single Logical Volume
|
||||
lvol1 do this:
|
||||
.sp
|
||||
.B pvmove \-n lvol1 /dev/sdb1 /dev/sdc1
|
||||
.P
|
||||
Rather than moving the contents of the entire device, it is possible to
|
||||
move a range of Physical Extents - for example numbers 1000 to 1999
|
||||
inclusive on /dev/sdb1 - like this:
|
||||
.sp
|
||||
.B pvmove /dev/sdb1:1000\-1999
|
||||
.P
|
||||
A range can also be specified as start+length, so
|
||||
.sp
|
||||
.B pvmove /dev/sdb1:1000+1000
|
||||
.P
|
||||
also refers to 1000 Physical Extents starting from Physical Extent number 1000.
|
||||
(Counting starts from 0, so this refers to the 1001st to the 2000th inclusive.)
|
||||
.P
|
||||
To move a range of Physical Extents to a specific location (which must have
|
||||
sufficient free extents) use the form:
|
||||
.sp
|
||||
.B pvmove /dev/sdb1:1000\-1999 /dev/sdc1
|
||||
.sp
|
||||
or
|
||||
.sp
|
||||
.B pvmove /dev/sdb1:1000\-1999 /dev/sdc1:0\-999
|
||||
.P
|
||||
If the source and destination are on the same disk, the
|
||||
.B anywhere
|
||||
allocation policy would be needed, like this:
|
||||
.sp
|
||||
.B pvmove \-\-alloc anywhere /dev/sdb1:1000\-1999 /dev/sdb1:0\-999
|
||||
.P
|
||||
The part of a specific Logical Volume present within in a range of Physical
|
||||
Extents can also be picked out and moved, like this:
|
||||
.sp
|
||||
.B pvmove \-n lvol1 /dev/sdb1:1000\-1999 /dev/sdc1
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgconvert (8)
|
||||
.BR pvs (8)
|
@@ -1,47 +0,0 @@
|
||||
.SH NOTES
|
||||
.
|
||||
\fBpvmove\fP works as follows:
|
||||
|
||||
1. A temporary 'pvmove' LV is created to store details of all the data
|
||||
movements required.
|
||||
|
||||
2. Every LV in the VG is searched for contiguous data that need moving
|
||||
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
|
||||
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.
|
||||
|
||||
3. The VG metadata is updated on disk.
|
||||
|
||||
4. The first segment of the pvmove LV is activated and starts to mirror
|
||||
the first part of the data. Only one segment is mirrored at once as this
|
||||
is usually more efficient.
|
||||
|
||||
5. A daemon repeatedly checks progress at the specified time interval.
|
||||
When it detects that the first temporary mirror is in sync, it breaks that
|
||||
mirror so that only the new location for that data gets used and writes a
|
||||
checkpoint into the VG metadata on disk. Then it activates the mirror for
|
||||
the next segment of the pvmove LV.
|
||||
|
||||
6. When there are no more segments left to be mirrored, the temporary LV
|
||||
is removed and the VG metadata is updated so that the LVs reflect the new
|
||||
data locations.
|
||||
|
||||
Note that this new process cannot support the original LVM1
|
||||
type of on-disk metadata. Metadata can be converted using
|
||||
\fBvgconvert\fP(8).
|
||||
|
||||
If the \fB\-\-atomic\fP option is used, a slightly different approach is
|
||||
used for the move. Again, a temporary 'pvmove' LV is created to store the
|
||||
details of all the data movements required. This temporary LV contains
|
||||
all the segments of the various LVs that need to be moved. However, in
|
||||
this case, an identical LV is allocated that contains the same number of
|
||||
segments and a mirror is created to copy the contents from the first
|
||||
temporary LV to the second. After a complete copy is made, the temporary
|
||||
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.
|
||||
|
37
man/pvremove.8.in
Normal file
37
man/pvremove.8.in
Normal file
@@ -0,0 +1,37 @@
|
||||
.TH PVREMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvremove \(em remove a physical volume
|
||||
.SH SYNOPSIS
|
||||
.B pvremove
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-f [ f ]| \-\-force
|
||||
.RB [ \-\-force ]]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-y | \-\-yes ]
|
||||
.I PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]
|
||||
.SH DESCRIPTION
|
||||
pvremove wipes the label on a device so that LVM will no longer
|
||||
recognise it as a physical volume.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-ff ", " \-\-force " " \-\-force
|
||||
Force the removal of a physical volume belonging to an existing volume group.
|
||||
Normally \fBvgreduce\fP(8) should be used instead of this command.
|
||||
You cannot remove a physical volume which in use by some active logical volume.
|
||||
.TP
|
||||
.BR \-y ", " \-\-yes
|
||||
Answer yes to all questions.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvcreate (8),
|
||||
.BR pvdisplay (8),
|
||||
.BR vgreduce (8)
|
56
man/pvresize.8.in
Normal file
56
man/pvresize.8.in
Normal file
@@ -0,0 +1,56 @@
|
||||
.TH PVRESIZE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvresize \(em resize a disk or partition in use by LVM2
|
||||
.SH SYNOPSIS
|
||||
.B pvresize
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-setphysicalvolumesize
|
||||
.IR size ]
|
||||
.I PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]
|
||||
.SH DESCRIPTION
|
||||
pvresize resizes
|
||||
.I PhysicalVolume
|
||||
which may already be in a volume group and have active logical volumes
|
||||
allocated on it.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BI \-\-setphysicalvolumesize " size"
|
||||
Overrides the automatically-detected size of the PV. Use with care, or
|
||||
prior to reducing the physical size of the device.
|
||||
.SH EXAMPLES
|
||||
Expand the PV on /dev/sda1 after enlarging the partition with fdisk:
|
||||
.sp
|
||||
.B pvresize /dev/sda1
|
||||
.sp
|
||||
Shrink the PV on /dev/sda1 prior to shrinking the partition with fdisk
|
||||
(ensure that the PV size is appropriate for your intended new partition
|
||||
size):
|
||||
.sp
|
||||
.B pvresize \-\-setphysicalvolumesize 40G /dev/sda1
|
||||
.sp
|
||||
.SH RESTRICTIONS
|
||||
pvresize will refuse to shrink
|
||||
.I PhysicalVolume
|
||||
if it has allocated extents after where its new end would be. In the future,
|
||||
it should relocate these elsewhere in the volume group if there is sufficient
|
||||
free space, like
|
||||
.B pvmove
|
||||
does.
|
||||
.sp
|
||||
.B pvresize
|
||||
won't currently work correctly on LVM1 volumes.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvmove (8),
|
||||
.BR lvresize (8),
|
||||
.BR fdisk (8)
|
153
man/pvs.8.in
Normal file
153
man/pvs.8.in
Normal file
@@ -0,0 +1,153 @@
|
||||
.TH PVS 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvs \(em report information about physical volumes
|
||||
.SH SYNOPSIS
|
||||
.B pvs
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-nameprefixes ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-rows ]
|
||||
.RB [ \-\-segments ]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-\-unquoted ]
|
||||
.RB [ \-v|\-\-verbose ]
|
||||
.RB [ \-\-version]
|
||||
.RI [ PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]]
|
||||
.SH DESCRIPTION
|
||||
pvs produces formatted output about physical volumes.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-all
|
||||
Include information in the output about devices that have not been
|
||||
initialized with \fBpvcreate\fP(8).
|
||||
.TP
|
||||
.B \-\-aligned
|
||||
Use with \fB\-\-separator\fP to align the output columns.
|
||||
.TP
|
||||
.B \-\-binary
|
||||
Use binary values "0" or "1" instead of descriptive literal values
|
||||
for columns that have exactly two valid values to report (not counting
|
||||
the "unknown" value which denotes that the value could not be determined).
|
||||
.TP
|
||||
.B \-\-configreport \fI ReportName
|
||||
Make any subsequent \fB\-o, \-\-options\fP, \fB\-O, \-\-sort\fP or
|
||||
\fB\-S, \-\-select\fP to apply for \fIReportName\fP where \fIReportName\fP
|
||||
is either 'pv' for command's main report or 'log' for log report.
|
||||
If \fB\-\-configreport\fP option is not used to identify a report, then
|
||||
command's main report is assumed. The log report is available only if
|
||||
enabled by \fBlog/report_command_log\fP \fBlvm.conf\fP(5) setting or
|
||||
if \fB\-\-logonly\fP option is used.
|
||||
.TP
|
||||
.B \-\-logonly
|
||||
Suppress the pvs report itself and display only log report on output.
|
||||
.TP
|
||||
.B \-\-nameprefixes
|
||||
Add an "LVM2_" prefix plus the field name to the output. Useful
|
||||
with \fB\-\-noheadings\fP to produce a list of field=value pairs that can
|
||||
be used to set environment variables (for example, in \fBudev\fP(7) rules).
|
||||
.TP
|
||||
.B \-\-noheadings
|
||||
Suppress the headings line that is normally the first line of output.
|
||||
Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-nosuffix
|
||||
Suppress the suffix on output sizes. Use with \fB\-\-units\fP
|
||||
(except h and H) if processing the output.
|
||||
.TP
|
||||
.BR \-o ", " \-\-options
|
||||
Comma-separated ordered list of columns.
|
||||
.IP
|
||||
Precede the list with '\fI+\fP' to append to the current list
|
||||
of columns, '\fI-\fP' to remove from the current list of columns
|
||||
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
|
||||
be repeated, providing several lists. These lists are evaluated
|
||||
from left to right.
|
||||
.IP
|
||||
Use \fB-o pv_all\fP to select all physical volume columns,
|
||||
and \fB-o pvseg_all\fP to select all Physical Volume segment columns.
|
||||
.IP
|
||||
Use \fB-o help\fP to view the full list of columns available.
|
||||
.IP
|
||||
Column names include: pv_fmt, pv_uuid, dev_size, pv_name, pv_mda_free,
|
||||
pv_mda_size, pv_ba_start, pv_ba_size, pe_start, pv_size, pv_free, pv_used,
|
||||
pv_attr, pv_pe_count, pv_pe_alloc_count, pv_tags, pv_mda_count,
|
||||
pv_mda_used_count, pvseg_start, and pvseg_size
|
||||
.IP
|
||||
With \fB\-\-segments\fP, any "pvseg_" prefixes are optional; otherwise any
|
||||
"pv_" prefixes are optional. Columns mentioned in \fBvgs\fP(8) can also
|
||||
be chosen. The pv_attr bits are: (a)llocatable, e(x)ported, (m)issing,
|
||||
(u)sed (but not allocatable), (d)uplicate.
|
||||
.TP
|
||||
.B \-\-segments
|
||||
Produces one line of output for each contiguous allocation of space on each
|
||||
Physical Volume, showing the start (pvseg_start) and length (pvseg_size) in
|
||||
units of physical extents.
|
||||
.TP
|
||||
.BR \-S ", " \-\-select " " \fISelection
|
||||
Display only rows that match Selection criteria. All rows are displayed with
|
||||
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
|
||||
matches the Selection and 0 otherwise. The Selection criteria are defined
|
||||
by specifying column names and their valid values (that can include reserved
|
||||
values) while making use of supported comparison operators. See \fBlvm\fP(8)
|
||||
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
|
||||
about constructing the Selection criteria. As a quick help and to see full
|
||||
list of column names that can be used in Selection including the list of
|
||||
reserved values and the set of supported selection operators, check the
|
||||
output of \fBpvs -S help\fP command.
|
||||
.TP
|
||||
.BR \-O ", " \-\-sort
|
||||
Comma-separated ordered list of columns to sort by. Replaces the default
|
||||
selection. Precede any column with '\fI\-\fP' for a reverse sort on that
|
||||
column.
|
||||
.TP
|
||||
.B \-\-rows
|
||||
Output columns as rows.
|
||||
.TP
|
||||
.B \-\-separator \fISeparator
|
||||
String to use to separate each column. Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-unbuffered
|
||||
Produce output immediately without sorting or aligning the columns properly.
|
||||
.TP
|
||||
.B \-\-units \fIhHbBsSkKmMgGtTpPeE
|
||||
All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
|
||||
(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.
|
||||
Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify
|
||||
custom units e.g. \-\-units 3M
|
||||
.TP
|
||||
.B \-\-unquoted
|
||||
When used with \fB\-\-nameprefixes\fP, output values in the field=value
|
||||
pairs are not quoted.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvdisplay (8),
|
||||
.BR lvs (8),
|
||||
.BR vgs (8)
|
@@ -1,11 +0,0 @@
|
||||
.SH NOTES
|
||||
.
|
||||
The pv_attr bits are:
|
||||
.IP 1 3
|
||||
(d)uplicate, (a)llocatable, (u)sed
|
||||
.IP 2 3
|
||||
e(x)ported
|
||||
.IP 3 3
|
||||
(m)issing
|
||||
|
||||
|
@@ -1,4 +1,44 @@
|
||||
.SH NOTES
|
||||
.TH PVSCAN 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
pvscan \(em scan all disks for physical volumes
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B pvscan
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-e | \-\-exported ]
|
||||
.RB [ \-n | \-\-novolumegroup ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-s | \-\-short ]
|
||||
.RB [ \-u | \-\-uuid ]
|
||||
.BR
|
||||
|
||||
.B pvscan
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.B \-\-cache
|
||||
.RB [ \-a | \-\-activate " " \fIay ]
|
||||
.RB [ \-b | \-\-background ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-major
|
||||
.I major
|
||||
.B \-\-minor
|
||||
.I minor
|
||||
|
|
||||
.IR DevicePath
|
||||
|
|
||||
.IR major:minor ]...
|
||||
|
||||
.SH DESCRIPTION
|
||||
pvscan scans all supported LVM block devices in the system for physical
|
||||
volumes.
|
||||
|
||||
.SS Scanning with lvmetad
|
||||
|
||||
@@ -32,6 +72,8 @@ scanning, an ordinary pvscan (without \-\-cache) will simply read metadata
|
||||
from lvmetad like other LVM commands. It does not do anything beyond
|
||||
displaying the current state of the cache.
|
||||
|
||||
.I Notes
|
||||
|
||||
.IP \[bu] 2
|
||||
When given specific device name arguments, pvscan \-\-cache will only
|
||||
read the named devices.
|
||||
@@ -88,6 +130,8 @@ fully integrated with the event-driven system services.)
|
||||
When a VG or LV is not auto-activated, traditional activation using
|
||||
vgchange or lvchange -a|--activate is needed.
|
||||
|
||||
.I Notes
|
||||
|
||||
.IP \[bu] 2
|
||||
pvscan auto-activation can be only done in combination with \-\-cache.
|
||||
|
||||
@@ -101,3 +145,34 @@ is used, the auto_activation_volume_list is applied.
|
||||
Auto-activation is not yet supported for LVs that are part of partial or
|
||||
clustered volume groups.
|
||||
|
||||
.P
|
||||
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-e ", " \-\-exported
|
||||
Only show physical volumes belonging to exported volume groups.
|
||||
.TP
|
||||
.BR \-n ", " \-\-novolumegroup
|
||||
Only show physical volumes not belonging to any volume group.
|
||||
.TP
|
||||
.BR \-s ", " \-\-short
|
||||
Short listing format.
|
||||
.TP
|
||||
.BR \-u ", " \-\-uuid
|
||||
Show UUIDs in addition to device names.
|
||||
.TP
|
||||
.BR \-a ", " \-\-activate " " \fIay
|
||||
Automatically activate any logical volumes that are possible to activate
|
||||
with the addition of the new devices.
|
||||
.TP
|
||||
.BR \-b ", " \-\-background
|
||||
Run the command in the background.
|
||||
.TP
|
||||
.BR \-\-cache " [" \-\-major " " \fImajor " " \-\-minor " " \fIminor " | " \fIDevicePath " | " \fImajor:minor " ]..."
|
||||
Scan one or more devices and send the metadata to lvmetad.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvmconfig (8),
|
||||
.BR lvmetad (8)
|
36
man/vgcfgbackup.8.in
Normal file
36
man/vgcfgbackup.8.in
Normal file
@@ -0,0 +1,36 @@
|
||||
.TH VGCFGBACKUP 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgcfgbackup \(em backup volume group descriptor area
|
||||
.SH SYNOPSIS
|
||||
.B vgcfgbackup
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-f | \-\-file
|
||||
.IR Filename ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgcfgbackup allows you to backup the metadata of your volume groups.
|
||||
If you don't name any volume groups on the command line, all of them
|
||||
will be backed up.
|
||||
.sp
|
||||
In a default installation, each volume group gets backed up into a separate
|
||||
file bearing the name of the volume group in the directory
|
||||
\fI#DEFAULT_BACKUP_DIR#\fP.
|
||||
You can write the backup to an alternative file using \fB\-f\fP. In this case
|
||||
if you are backing up more than one volume group the filename is
|
||||
treated as a template, and %s gets replaced by the volume group name.
|
||||
.sp
|
||||
NB. This DOESN'T backup user/system data in logical
|
||||
volume(s)! Backup \fI#DEFAULT_SYS_DIR#\fP regularly too.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcfgrestore (8)
|
58
man/vgcfgrestore.8.in
Normal file
58
man/vgcfgrestore.8.in
Normal file
@@ -0,0 +1,58 @@
|
||||
.TH VGCFGRESTORE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgcfgrestore \(em restore volume group descriptor area
|
||||
.SH SYNOPSIS
|
||||
.B vgcfgrestore
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-f | \-\-file
|
||||
.RI < filename >]
|
||||
.RB [ \-\-force ]
|
||||
.RB [ \-l [ l ]| \-\-list ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-M | \-\-metadatatype
|
||||
.IR 1 | 2 ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI \fIVolumeGroupName\fP
|
||||
.SH DESCRIPTION
|
||||
vgcfgrestore allows you to restore the metadata of \fIVolumeGroupName\fP
|
||||
from a text backup file produced by \fBvgcfgbackup\fP.
|
||||
You can specify a backup file 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
|
||||
backup and archive files of \fIVolumeGroupName\fP.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-l ", " \-\-list\fP
|
||||
List files pertaining to \fIVolumeGroupName\fP
|
||||
List metadata backup and archive files pertaining to \fIVolumeGroupName\fP.
|
||||
May be used with the \fB\-f\fP option. Does not restore \fIVolumeGroupName\fP.
|
||||
.TP
|
||||
.BR \-f ", " \-\-file " " \fIfilename
|
||||
Name of LVM metadata backup file
|
||||
Specifies a metadata backup or archive file to be used for restoring
|
||||
VolumeGroupName. Often this file has been created with \fBvgcfgbackup\fP.
|
||||
.TP
|
||||
.B \-\-force
|
||||
Necessary to restore metadata with thin pool volumes.
|
||||
.br
|
||||
\fBWARNING: Use with extreme caution.
|
||||
Most changes to thin metadata cannot be reverted.
|
||||
You may lose data if you restore metadata that does not match the thin pool
|
||||
kernel metadata precisely.\fP
|
||||
.SH REPLACING PHYSICAL VOLUMES
|
||||
\fBvgdisplay \-\-partial \-\-verbose\fP will show you 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 volume
|
||||
group's metadata.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8)
|
346
man/vgchange.8.in
Normal file
346
man/vgchange.8.in
Normal file
@@ -0,0 +1,346 @@
|
||||
.TH VGCHANGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgchange \(em change attributes of a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgchange
|
||||
.RB [ \-\-addtag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-a | \-\-activate
|
||||
.RI [ a | e | s | l ]
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-activationmode
|
||||
.IB { complete | degraded | partial } ]
|
||||
.RB [ \-K | \-\-ignoreactivationskip ]
|
||||
.RB [ \-\-monitor
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-poll
|
||||
.RI { y | n }]
|
||||
.RB [ \-c | \-\-clustered
|
||||
.RI { y | n }]
|
||||
.RB [ \-u | \-\-uuid ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-\-deltag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-detachprofile ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoremonitoring ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-sysinit ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-lock\-start ]
|
||||
.RB [ \-\-lock\-stop ]
|
||||
.RB [ \-\-lock\-type
|
||||
.IR LockType ]
|
||||
.RB [ \-l | \-\-logicalvolume
|
||||
.IR MaxLogicalVolumes ]
|
||||
.RB [ \-p | \-\-maxphysicalvolumes
|
||||
.IR MaxPhysicalVolumes ]
|
||||
.RB [ \-\-metadataprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\- [ vg ] metadatacopies
|
||||
.IR NumberOfCopies | unmanaged | all ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-s | \-\-physicalextentsize
|
||||
.IR PhysicalExtentSize [ bBsSkKmMgGtTpPeE ]]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-\-systemid
|
||||
.IR SystemID ]
|
||||
.RB [ \-\-refresh ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ \-x | \-\-resizeable
|
||||
.RI { y | n }]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgchange allows you to change the attributes of one or more
|
||||
volume groups. Its main purpose is to activate and deactivate
|
||||
.IR VolumeGroupName ,
|
||||
or all volume groups if none is specified. Only active volume groups
|
||||
are subject to changes and allow access to their logical volumes.
|
||||
[Not yet implemented: During volume group activation, if
|
||||
.B vgchange
|
||||
recognizes snapshot logical volumes which were dropped because they ran
|
||||
out of space, it displays a message informing the administrator that such
|
||||
snapshots should be removed (see
|
||||
.BR lvremove (8)).
|
||||
]
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-A ", " \-\-autobackup " {" \fIy | \fIn }
|
||||
Controls automatic backup of metadata after the change. See
|
||||
.BR vgcfgbackup (8).
|
||||
Default is yes.
|
||||
.TP
|
||||
.BR \-a ", " \-\-activate " [" \fIa | \fIe | \fIs | \fIl ]{ \fIy | \fIn }
|
||||
Controls the availability of the logical volumes in the volume
|
||||
group for input/output.
|
||||
In other words, makes the logical volumes known/unknown to the kernel.
|
||||
If autoactivation option is used (\-aay), each logical volume in
|
||||
the volume group is activated only if it matches an item in the
|
||||
activation/auto_activation_volume_list set in lvm.conf. If this
|
||||
list is not set, then all volumes are considered for activation.
|
||||
The \-aay option should be also used during system boot so it's
|
||||
possible to select which volumes to activate using the
|
||||
activation/auto_activation_volume_list settting.
|
||||
.IP
|
||||
Activation of a logical volume creates a symbolic link
|
||||
/dev/VolumeGroupName/LogicalVolumeName pointing to the device node.
|
||||
This link is removed on deactivation.
|
||||
All software and scripts should access the device through
|
||||
this symbolic link and present this as the name of the device.
|
||||
The location and name of the underlying device node may depend on
|
||||
the distribution and configuration (e.g. udev) and might change
|
||||
from release to release.
|
||||
.IP
|
||||
In a clustered VG, clvmd is used for activation, and the
|
||||
following options are possible:
|
||||
|
||||
With \-aey, clvmd activates the LV in exclusive mode
|
||||
(with an exclusive lock), allowing a single node to activate the LV.
|
||||
|
||||
With \-asy, clvmd activates the LV in shared mode
|
||||
(with a shared lock), allowing multiple nodes to activate the LV concurrently.
|
||||
If the LV type prohibits shared access, such as an LV with a snapshot,
|
||||
the 's' option is ignored and an exclusive lock is used.
|
||||
|
||||
With \-ay (no mode specified), clvmd activates the LV in shared mode
|
||||
if the LV type allows concurrent access, such as a linear LV.
|
||||
Otherwise, clvmd activates the LV in exclusive mode.
|
||||
|
||||
With \-aey, \-asy, and \-ay, clvmd attempts to activate the LV
|
||||
on all nodes. If exclusive mode is used, then only one of the
|
||||
nodes will be successful.
|
||||
|
||||
With \-an, clvmd attempts to deactivate the LV on all nodes.
|
||||
|
||||
With \-aly, clvmd activates the LV only on the local node, and \-aln
|
||||
deactivates only on the local node. If the LV type allows concurrent
|
||||
access, then shared mode is used, otherwise exclusive.
|
||||
|
||||
LVs with snapshots are always activated exclusively because they can only
|
||||
be used on one node at once.
|
||||
|
||||
For local VGs, \-ay, \-aey, and \-asy are all equivalent.
|
||||
.IP
|
||||
In a shared VG, lvmlockd is used for locking if LVM is compiled with lockd
|
||||
support, and the following options are possible:
|
||||
|
||||
With \-aey, the command activates the LV in exclusive mode, allowing a
|
||||
single host to activate the LV (the host running the command). Before
|
||||
activating the LV, the command uses lvmlockd to acquire an exclusive lock
|
||||
on the LV. If the lock cannot be acquired, the LV is not activated and an
|
||||
error is reported. This would happen if the LV is active on another host.
|
||||
|
||||
With \-asy, the command activates the LV in shared mode, allowing multiple
|
||||
hosts to activate the LV concurrently. Before activating the LV, the
|
||||
command uses lvmlockd to acquire a shared lock on the LV. If the lock
|
||||
cannot be acquired, the LV is not activated and an error is reported.
|
||||
This would happen if the LV is active exclusively on another host. If the
|
||||
LV type prohibits shared access, such as a snapshot, the command will
|
||||
report an error and fail.
|
||||
|
||||
With \-an, the command deactivates the LV on the host running the command.
|
||||
After deactivating the LV, the command uses lvmlockd to release the
|
||||
current lock on the LV.
|
||||
|
||||
With lvmlockd, an unspecified mode is always exclusive, \-ay defaults to
|
||||
\-aey.
|
||||
|
||||
.TP
|
||||
.BR \-\-activationmode " {" \fIcomplete | \fIdegraded | \fIpartial }
|
||||
The activation mode determines whether logical volumes are allowed to
|
||||
activate when there are physical volumes missing (e.g. due to a device
|
||||
failure). \fIcomplete\fP is the most restrictive; allowing only those
|
||||
logical volumes to be activated that are not affected by the missing
|
||||
PVs. \fIdegraded\fP allows RAID logical volumes to be activated even if
|
||||
they have PVs missing. (Note that the "mirror" segment type is not
|
||||
considered a RAID logical volume. The "raid1" segment type should
|
||||
be used instead.) Finally, \fIpartial\fP allows any logical volume to
|
||||
be activated even if portions are missing due to a missing or failed
|
||||
PV. This last option should only be used when performing recovery or
|
||||
repair operations. \fIdegraded\fP is the default mode. To change it, modify
|
||||
.B activation_mode
|
||||
in
|
||||
.BR lvm.conf (5).
|
||||
.TP
|
||||
.BR \-K ", " \-\-ignoreactivationskip
|
||||
Ignore the flag to skip Logical Volumes during activation.
|
||||
.TP
|
||||
.BR \-c ", " \-\-clustered " {" \fIy | \fIn }
|
||||
If clustered locking is enabled, this indicates whether this
|
||||
Volume Group is shared with other nodes in the cluster or whether
|
||||
it contains only local disks that are not visible on the other nodes.
|
||||
If the cluster infrastructure is unavailable on a particular node at a
|
||||
particular time, you may still be able to use Volume Groups that
|
||||
are not marked as clustered.
|
||||
.TP
|
||||
.BR \-\-detachprofile
|
||||
Detach any metadata configuration profiles attached to given
|
||||
Volume Groups. See \fBlvm.conf\fP(5) for more information
|
||||
about \fBmetadata profiles\fP.
|
||||
.TP
|
||||
.BR \-u ", " \-\-uuid
|
||||
Generate new random UUID for specified Volume Groups.
|
||||
.TP
|
||||
.BR \-\-monitor " {" \fIy | \fIn }
|
||||
Start or stop monitoring a mirrored or snapshot logical volume with
|
||||
dmeventd, if it is installed.
|
||||
If a device used by a monitored mirror reports an I/O error,
|
||||
the failure is handled according to
|
||||
.B mirror_image_fault_policy
|
||||
and
|
||||
.B mirror_log_fault_policy
|
||||
set in
|
||||
.BR lvm.conf (5).
|
||||
.TP
|
||||
.BR \-\-poll " {" \fIy | \fIn }
|
||||
Without polling a logical volume's backgrounded transformation process
|
||||
will never complete. If there is an incomplete pvmove or lvconvert (for
|
||||
example, on rebooting after a crash), use \fB\-\-poll y\fP to restart the
|
||||
process from its last checkpoint. However, it may not be appropriate to
|
||||
immediately poll a logical volume when it is activated, use
|
||||
\fB\-\-poll n\fP to defer and then \fB\-\-poll y\fP to restart the process.
|
||||
.TP
|
||||
.BR \-\-sysinit
|
||||
Indicates that vgchange(8) is being invoked from early system initialisation
|
||||
scripts (e.g. rc.sysinit or an initrd), before writeable filesystems are
|
||||
available. As such, some functionality needs to be disabled and this option
|
||||
acts as a shortcut which selects an appropriate set of options. Currently
|
||||
this is equivalent to using
|
||||
.BR \-\-ignorelockingfailure ,
|
||||
.BR \-\-ignoremonitoring ,
|
||||
.B \-\-poll n
|
||||
and setting \fBLVM_SUPPRESS_LOCKING_FAILURE_MESSAGES\fP
|
||||
environment variable.
|
||||
|
||||
If \fB\-\-sysinit\fP is used in conjunction with lvmetad(8) enabled and running,
|
||||
autoactivation is preferred over manual activation via direct vgchange call.
|
||||
Logical volumes are autoactivated according to auto_activation_volume_list
|
||||
set in lvm.conf(5).
|
||||
.TP
|
||||
.BR \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.TP
|
||||
.BR \-\-ignoremonitoring
|
||||
Make no attempt to interact with dmeventd unless
|
||||
.BR \-\-monitor
|
||||
is specified.
|
||||
Do not use this if dmeventd is already monitoring a device.
|
||||
.TP
|
||||
.BR \-\-lock\-start
|
||||
Start the lockspace of a shared VG in lvmlockd. lvmlockd locks becomes
|
||||
available for the VG, allowing LVM to use the VG. See
|
||||
.BR lvmlockd (8).
|
||||
.TP
|
||||
.BR \-\-lock\-stop
|
||||
Stop the lockspace of a shared VG in lvmlockd. lvmlockd locks become
|
||||
unavailable for the VG, preventing LVM from using the VG. See
|
||||
.BR lvmlockd (8).
|
||||
.TP
|
||||
.BR \-\-lock\-type " " \fILockType
|
||||
Change the VG lock type to or from a shared lock type used with lvmlockd. See
|
||||
.BR lvmlockd (8).
|
||||
.TP
|
||||
.BR \-l ", " \-\-logicalvolume " " \fIMaxLogicalVolumes
|
||||
Changes the maximum logical volume number of an existing inactive
|
||||
volume group.
|
||||
.TP
|
||||
.BR \-p ", " \-\-maxphysicalvolumes " " \fIMaxPhysicalVolumes
|
||||
Changes the maximum number of physical volumes that can belong
|
||||
to this volume group.
|
||||
For volume groups with metadata in lvm1 format, the limit is 255.
|
||||
If the metadata uses lvm2 format, the value 0 removes this restriction:
|
||||
there is then no limit. If you have a large number of physical volumes in
|
||||
a volume group with metadata in lvm2 format, for tool performance reasons,
|
||||
you should consider some use of \fB\-\-pvmetadatacopies 0\fP as described in
|
||||
\fBpvcreate(8)\fP, and/or use \fB\-\-vgmetadatacopies\fP.
|
||||
.TP
|
||||
.BR \-\-metadataprofile " " \fIProfileName
|
||||
Uses and attaches ProfileName configuration profile to the volume group
|
||||
metadata. Whenever the volume group is processed next time, the profile
|
||||
is automatically applied. The profile is inherited by all logical volumes
|
||||
in the volume group unless the logical volume itself has its own profile
|
||||
attached. See \fBlvm.conf\fP(5) for more information about \fBmetadata profiles\fP.
|
||||
.TP
|
||||
.BR \-\- [ vg ] metadatacopies " " \fINumberOfCopies | \fIunmanaged | \fIall
|
||||
Sets the desired number of metadata copies in the volume group. If set to
|
||||
a non-zero value, LVM will automatically manage the 'metadataignore'
|
||||
flags on the physical volumes (see \fBpvchange\fP or \fBpvcreate \-\-metadataignore\fP) in order
|
||||
to achieve \fINumberOfCopies\fP copies of metadata. If set to \fIunmanaged\fP,
|
||||
LVM will not automatically manage the 'metadataignore' flags. If set to
|
||||
\fIall\fP, LVM will first clear all of the 'metadataignore' flags on all
|
||||
metadata areas in the volume group, then set the value to \fIunmanaged\fP.
|
||||
The \fBvgmetadatacopies\fP option is useful for volume groups containing
|
||||
large numbers of physical volumes with metadata as it may be used to
|
||||
minimize metadata read and write overhead.
|
||||
.TP
|
||||
.BR \-s ", " \-\-physicalextentsize " " \fIPhysicalExtentSize [ \fIBbBsSkKmMgGtTpPeE ]
|
||||
Changes the physical extent size on physical volumes of this volume group.
|
||||
A size suffix (k for kilobytes up to t for terabytes) is optional, megabytes
|
||||
is the default if no suffix is present. For LVM2 format, the value must be a
|
||||
power of 2 of at least 1 sector (where the sector size is the largest sector
|
||||
size of the PVs currently used in the VG) or, if not a power of 2, at least
|
||||
128KiB. For the older LVM1 format, it must be a power of 2 of at least 8KiB.
|
||||
The default is 4 MiB.
|
||||
|
||||
Before increasing the physical extent size, you might need to use lvresize,
|
||||
pvresize and/or pvmove so that everything fits. For example, every
|
||||
contiguous range of extents used in a logical volume must start and
|
||||
end on an extent boundary.
|
||||
|
||||
If the volume group metadata uses lvm1 format, extents can vary in size from
|
||||
8KiB to 16GiB and there is a limit of 65534 extents in each logical volume.
|
||||
The default of 4 MiB leads to a maximum logical volume size of around 256GiB.
|
||||
|
||||
If the volume group metadata uses lvm2 format those restrictions do not apply,
|
||||
but having a large number of extents will slow down the tools but have no
|
||||
impact on I/O performance to the logical volume. The smallest PE is 1KiB.
|
||||
|
||||
The 2.4 kernel has a limitation of 2TiB per block device.
|
||||
.TP
|
||||
.BR \-\-systemid " " \fISystemID
|
||||
Changes the system ID of the VG. Using this option requires caution
|
||||
because the VG may become foreign to the host running the command,
|
||||
leaving the host unable to access it. See
|
||||
.BR lvmsystemid (7).
|
||||
.TP
|
||||
.BR \-\-refresh
|
||||
If any logical volume in the volume group is active, reload its metadata.
|
||||
This is not necessary in normal operation, but may be useful
|
||||
if something has gone wrong or if you're doing clustering
|
||||
manually without a clustered lock manager.
|
||||
.TP
|
||||
.BR \-x ", " \-\-resizeable " {" \fIy | \fIn }
|
||||
Enables or disables the extension/reduction of this volume group
|
||||
with/by physical volumes.
|
||||
.SH Examples
|
||||
To activate all known volume groups in the system:
|
||||
.sp
|
||||
.B vgchange \-a y
|
||||
|
||||
To change the maximum number of logical volumes of inactive volume group
|
||||
vg00 to 128.
|
||||
.sp
|
||||
.B vgchange \-l 128 /dev/vg00
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvchange (8),
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8)
|
22
man/vgck.8.in
Normal file
22
man/vgck.8.in
Normal file
@@ -0,0 +1,22 @@
|
||||
.TH VGCK 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgck \(em check volume group metadata
|
||||
.SH SYNOPSIS
|
||||
.B vgck
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgck checks LVM metadata for each named volume group for consistency.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgchange (8),
|
||||
.BR vgscan (8)
|
48
man/vgconvert.8.in
Normal file
48
man/vgconvert.8.in
Normal file
@@ -0,0 +1,48 @@
|
||||
.TH VGCONVERT 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgconvert \- convert volume group metadata format
|
||||
.SH SYNOPSIS
|
||||
.B vgconvert
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-labelsector ]
|
||||
.RB [ \-\-bootloaderareasize
|
||||
.IR size ]
|
||||
.RB [ \-M | \-\-metadatatype
|
||||
.IR type ]
|
||||
.RB [ \-\-pvmetadatacopies
|
||||
.IR NumberOfCopies ]
|
||||
.RB [ \-\-metadatasize
|
||||
.IR size ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-version ]
|
||||
.I VolumeGroupName
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgconvert converts
|
||||
.I VolumeGroupName
|
||||
metadata from one format to another provided that the metadata
|
||||
fits into the same space.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) and \fBpvcreate\fP(8) for options.
|
||||
.SH Examples
|
||||
Convert volume group vg1 from LVM1 metadata format to the new LVM2
|
||||
metadata format.
|
||||
.sp
|
||||
.B vgconvert \-M2 vg1
|
||||
.SH RECOVERY
|
||||
Use \fBpvscan\fP(8) to see which PVs lost their metadata.
|
||||
Run \fBpvcreate\fP(8) with the \fB\-\-uuid\fP and \fB\-\-restorefile\fP
|
||||
options on each such PV to reformat it as it was, using the archive
|
||||
file that \fBvgconvert\fP(8) created at the start of the procedure.
|
||||
Finally run \fBvgcfgrestore\fP(8) with that archive file to restore
|
||||
the original metadata.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvcreate (8),
|
||||
.BR vgcfgrestore (8)
|
187
man/vgcreate.8.in
Normal file
187
man/vgcreate.8.in
Normal file
@@ -0,0 +1,187 @@
|
||||
.TH VGCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgcreate \(em create a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgcreate
|
||||
.RB [ \-\-addtag
|
||||
.IR Tag ]
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-c | \-\-clustered
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-l | \-\-maxlogicalvolumes
|
||||
.IR MaxLogicalVolumes ]
|
||||
.RB [ \-M | \-\-metadatatype
|
||||
.IR type ]
|
||||
.RB [ \-\-metadataprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-p | \-\-maxphysicalvolumes
|
||||
.IR MaxPhysicalVolumes ]
|
||||
.RB [ \-\- [ vg ] metadatacopies
|
||||
.IR NumberOfCopies | unmanaged | all ]
|
||||
.RB [ \-s | \-\-physicalextentsize
|
||||
.IR PhysicalExtentSize [ bBsSkKmMgGtTpPeE ]]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-shared ]
|
||||
.RB [ \-\-systemid
|
||||
.IR SystemID ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RB [ "PHYSICAL DEVICE OPTIONS" ]
|
||||
.I VolumeGroupName PhysicalDevicePath
|
||||
.RI [ PhysicalDevicePath ...]
|
||||
.SH DESCRIPTION
|
||||
vgcreate creates a new volume group called
|
||||
.I VolumeGroupName
|
||||
using the block special device \fIPhysicalDevicePath\fP.
|
||||
.sp
|
||||
If \fIPhysicalDevicePath\fP was not previously configured for LVM with
|
||||
\fBpvcreate\fP(8), the device will be initialized with the same
|
||||
default values used with \fBpvcreate\fP(8). If non-default
|
||||
\fPpvcreate\fP values are desired, they may be given on the
|
||||
commandline with the same options as \fBpvcreate\fP(8). See
|
||||
.B PHYSICAL DEVICE OPTIONS
|
||||
for available options. Note that the restore-related options such as
|
||||
.BR \-\-restorefile ", " \-\-uuid " and " \-\-physicalvolumesize
|
||||
are not available. If a restore operation is needed, use
|
||||
\fBpvcreate\fP(8) and \fBvgcfgrestore\fP(8).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-c ", " \-\-clustered " {" \fIy | \fIn }
|
||||
If clustered locking is enabled, this defaults to \fBy\fP indicating that
|
||||
this Volume Group is shared with other nodes in the cluster.
|
||||
|
||||
If the new Volume Group contains only local disks that are not visible
|
||||
on the other nodes, you must specify \fB\-\-clustered\ n\fP.
|
||||
If the cluster infrastructure is unavailable on a particular node at a
|
||||
particular time, you may still be able to use such Volume Groups.
|
||||
.TP
|
||||
.BR \-l ", " \-\-maxlogicalvolumes " " \fIMaxLogicalVolumes
|
||||
Sets the maximum number of logical volumes allowed in this
|
||||
volume group.
|
||||
The setting can be changed with \fBvgchange\fP(8).
|
||||
For volume groups with metadata in lvm1 format, the limit
|
||||
and default value is 255.
|
||||
If the metadata uses lvm2 format, the default value is 0
|
||||
which removes this restriction: there is then no limit.
|
||||
.TP
|
||||
.BR \-p ", " \-\-maxphysicalvolumes " " \fIMaxPhysicalVolumes
|
||||
Sets the maximum number of physical volumes that can belong
|
||||
to this volume group.
|
||||
The setting can be changed with \fBvgchange\fP.
|
||||
For volume groups with metadata in lvm1 format, the limit
|
||||
and default value is 255.
|
||||
If the metadata uses lvm2 format, the value 0 removes this restriction:
|
||||
there is then no limit. If you have a large number of physical volumes in
|
||||
a volume group with metadata in lvm2 format, for tool performance reasons,
|
||||
you should consider some use of \fB\-\-pvmetadatacopies 0\fP as described in
|
||||
\fBpvcreate\fP(8), and/or use \fB\-\-vgmetadatacopies\fP.
|
||||
.TP
|
||||
.BR \-\- [ vg ] metadatacopies " " \fINumberOfCopies | \fIunmanaged | \fIall
|
||||
Sets the desired number of metadata copies in the volume group. If set to
|
||||
a non-zero value, LVM will automatically manage the 'metadataignore'
|
||||
flags on the physical volumes (see \fBpvcreate\fP(8) or
|
||||
\fBpvchange \-\-metadataignore\fP) in order
|
||||
to achieve \fINumberOfCopies\fP copies of metadata. If set to \fIunmanaged\fP,
|
||||
LVM will not automatically manage the 'metadataignore' flags. If set to
|
||||
\fIall\fP, LVM will first clear all of the 'metadataignore' flags on all
|
||||
metadata areas in the volume group, then set the value to \fIunmanaged\fP.
|
||||
The \fBvgmetadatacopies\fP option is useful for volume groups containing
|
||||
large numbers of physical volumes with metadata as it may be used to
|
||||
minimize metadata read and write overhead.
|
||||
The default value is \fIunmanaged\fP.
|
||||
.TP
|
||||
.BR \-\-metadataprofile " " \fIProfileName
|
||||
Uses and attaches the ProfileName configuration profile to the volume group
|
||||
metadata. Whenever the volume group is processed next time, the profile is
|
||||
automatically applied. The profile is inherited by all logical volumes in
|
||||
the volume group unless the logical volume itself has its own profile attached.
|
||||
See \fBlvm.conf\fP(5) for more information about \fBmetadata profiles\fP.
|
||||
.TP
|
||||
.BR \-s ", " \-\-physicalextentsize " " \fIPhysicalExtentSize [ \fIbBsSkKmMgGtTpPeE ]
|
||||
Sets the physical extent size on physical volumes of this volume group.
|
||||
A size suffix (k for kilobytes up to t for terabytes) is optional, megabytes
|
||||
is the default if no suffix is present. For LVM2 format, the value must be a
|
||||
power of 2 of at least 1 sector (where the sector size is the largest sector
|
||||
size of the PVs currently used in the VG) or, if not a power of 2, at least
|
||||
128KiB. For the older LVM1 format, it must be a power of 2 of at least 8KiB.
|
||||
The default is 4 MiB.
|
||||
Once this value has been set, it is difficult to change it without recreating
|
||||
the volume group which would involve backing up and restoring data on any
|
||||
logical volumes. However, if no extents need moving for the new
|
||||
value to apply, it can be altered using \fBvgchange \-s\fP.
|
||||
|
||||
If the volume group metadata uses lvm1 format, extents can vary in size from
|
||||
8KiB to 16GiB and there is a limit of 65534 extents in each logical volume. The
|
||||
default of 4 MiB leads to a maximum logical volume size of around 256GiB.
|
||||
|
||||
If the volume group metadata uses lvm2 format those restrictions do not apply,
|
||||
but having a large number of extents will slow down the tools but have no
|
||||
impact on I/O performance to the logical volume. The smallest PE is 1KiB
|
||||
|
||||
The 2.4 kernel has a limitation of 2TiB per block device.
|
||||
|
||||
.TP
|
||||
.B \-\-shared
|
||||
Create a shared VG using lvmlockd if LVM is compiled with lockd support.
|
||||
lvmlockd will select lock type sanlock or dlm depending on which lock
|
||||
manager is running. This allows multiple hosts to share a VG on shared
|
||||
devices. lvmlockd and a lock manager must be configured and running. See
|
||||
.BR lvmlockd (8).
|
||||
|
||||
.TP
|
||||
.BR \-\-systemid " " \fISystemID
|
||||
Specifies the system ID that will be given to the new VG, overriding the
|
||||
system ID of the host running the command. A VG is normally created
|
||||
without this option, in which case the new VG is given the system ID of
|
||||
the host creating it. Using this option requires caution because the
|
||||
system ID of the new VG may not match the system ID of the host running
|
||||
the command, leaving the VG inaccessible to the host. See
|
||||
.BR lvmsystemid (7).
|
||||
|
||||
.SH PHYSICAL DEVICE OPTIONS
|
||||
The following options are available for initializing physical devices in the
|
||||
volume group. These options are further described in the \fBpvcreate\fP(8)
|
||||
man page.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
.TP
|
||||
.BR \-y ", " \-\-yes
|
||||
.TP
|
||||
.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
|
||||
.TP
|
||||
.B \-\-labelsector \fIsector
|
||||
.TP
|
||||
.B \-\-metadatasize \fIsize
|
||||
.TP
|
||||
.B \-\-pvmetadatacopies \fIcopies
|
||||
.TP
|
||||
.B \-\-dataalignment \fIalignment
|
||||
.TP
|
||||
.B \-\-dataalignmentoffset \fIalignment_offset
|
||||
.SH Examples
|
||||
Creates a volume group named "test_vg" using physical volumes "/dev/sdk1"
|
||||
and "/dev/sdl1" with default physical extent size of 4MiB:
|
||||
.sp
|
||||
.B vgcreate test_vg /dev/sdk1 /dev/sdl1
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvdisplay (8),
|
||||
.BR pvcreate (8),
|
||||
.BR vgdisplay (8),
|
||||
.BR vgextend (8),
|
||||
.BR vgreduce (8),
|
||||
.BR lvcreate (8),
|
||||
.BR lvdisplay (8),
|
||||
.BR lvextend (8),
|
||||
.BR lvreduce (8)
|
123
man/vgdisplay.8.in
Normal file
123
man/vgdisplay.8.in
Normal file
@@ -0,0 +1,123 @@
|
||||
.TH VGDISPLAY 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgdisplay \(em display attributes of volume groups
|
||||
.SH SYNOPSIS
|
||||
.B vgdisplay
|
||||
.RB [ \-A | \-\-activevolumegroups ]
|
||||
.RB [ \-c | \-\-colon ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-s | \-\-short ]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.br
|
||||
|
||||
.br
|
||||
.B vgdisplay
|
||||
.BR \-C | \-\-columns
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgdisplay allows you to see the attributes of
|
||||
.I VolumeGroupName
|
||||
(or all volume groups if none is given) with it's physical and logical
|
||||
volumes and their sizes etc.
|
||||
.P
|
||||
\fBvgs\fP(8) is an alternative that provides the same information
|
||||
in the style of \fBps\fP(1).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-A ", " \-\-activevolumegroups
|
||||
Only select the active volume groups. The volume group is considered active
|
||||
if at least one of its logical volumes is active.
|
||||
.TP
|
||||
.BR \-C ", " \-\-columns
|
||||
Display output in columns, the equivalent of \fBvgs\fP(8).
|
||||
Options listed are the same as options given in \fPvgs\fP(8).
|
||||
.TP
|
||||
.BR \-c ", " \-\-colon
|
||||
Generate colon separated output for easier parsing in scripts or programs.
|
||||
N.B. \fBvgs\fP(8) provides considerably more control over the output.
|
||||
.nf
|
||||
|
||||
The values are:
|
||||
|
||||
1 volume group name
|
||||
2 volume group access
|
||||
3 volume group status
|
||||
4 internal volume group number
|
||||
5 maximum number of logical volumes
|
||||
6 current number of logical volumes
|
||||
7 open count of all logical volumes in this volume group
|
||||
8 maximum logical volume size
|
||||
9 maximum number of physical volumes
|
||||
10 current number of physical volumes
|
||||
11 actual number of physical volumes
|
||||
12 size of volume group in kilobytes
|
||||
13 physical extent size
|
||||
14 total number of physical extents for this volume group
|
||||
15 allocated number of physical extents for this volume group
|
||||
16 free number of physical extents for this volume group
|
||||
17 uuid of volume group
|
||||
|
||||
.fi
|
||||
.TP
|
||||
.BR \-s ", " \-\-short
|
||||
Give a short listing showing the existence of volume groups.
|
||||
.TP
|
||||
.BR \-v ", " \-\-verbose
|
||||
Display verbose information containing long listings of physical
|
||||
and logical volumes. If given twice, also display verbose runtime
|
||||
information of vgdisplay's activities.
|
||||
.TP
|
||||
.B \-\-version
|
||||
Display version and exit successfully.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgs (8),
|
||||
.BR pvcreate (8),
|
||||
.BR vgcreate (8),
|
||||
.BR lvcreate (8)
|
37
man/vgexport.8.in
Normal file
37
man/vgexport.8.in
Normal file
@@ -0,0 +1,37 @@
|
||||
.TH VGEXPORT 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgexport \- make volume groups unknown to the system
|
||||
.SH SYNOPSIS
|
||||
.B vgexport
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgexport allows you to make the inactive
|
||||
.IR VolumeGroupName (s)
|
||||
unknown to the system.
|
||||
You can then move all the Physical Volumes in that Volume Group to
|
||||
a different system for later
|
||||
.BR vgimport (8).
|
||||
Most LVM2 tools ignore exported Volume Groups.
|
||||
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).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-a ", " \-\-all
|
||||
Export all inactive Volume Groups.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvscan (8),
|
||||
.BR vgimport (8),
|
||||
.BR vgscan (8),
|
||||
.BR lvmsystemid (7)
|
@@ -1,14 +0,0 @@
|
||||
.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).
|
||||
|
71
man/vgextend.8.in
Normal file
71
man/vgextend.8.in
Normal file
@@ -0,0 +1,71 @@
|
||||
.TH VGEXTEND 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgextend \(em add physical volumes to a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgextend
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-restoremissing ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ "PHYSICAL DEVICE OPTIONS" ]
|
||||
.I VolumeGroupName PhysicalDevicePath
|
||||
.RI [ PhysicalDevicePath ...]
|
||||
.SH DESCRIPTION
|
||||
vgextend allows you to add one or more initialized physical volumes
|
||||
(see \fBpvcreate\fP(8)) to an existing volume group to extend it in size. Moreover, it allows you to
|
||||
re-add a physical volume that has gone missing previously, due to a transient
|
||||
device failure, without re-initialising it. Use
|
||||
\fBvgextend \-\-restoremissing\fP to that effect.
|
||||
.sp
|
||||
If \fIPhysicalDevicePath\fP was not previously configured for LVM with
|
||||
\fBpvcreate\fP(8), the device will be initialized with the same
|
||||
default values used with \fBpvcreate\fP(8). If non-default
|
||||
\fPpvcreate\fP(8) values are desired, they may be given on the
|
||||
commandline with the same options as \fPpvcreate\fP(8). See
|
||||
.B PHYSICAL DEVICE OPTIONS
|
||||
for available options. Note that the restore-related options such as
|
||||
.BR \-\-restorefile ", " \-\-uuid " and " \-\-physicalvolumesize
|
||||
are not available. If a restore operation
|
||||
is needed, use \fBpvcreate\fP(8) and \fBvgcfgrestore\fP(8).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.SH PHYSICAL DEVICE OPTIONS
|
||||
The following options are available for initializing physical devices in the
|
||||
volume group. These options are further described in the
|
||||
\fBpvcreate\fP(8) man page.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
.TP
|
||||
.BR \-y ", " \-\-yes
|
||||
.TP
|
||||
.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
|
||||
.TP
|
||||
.B \-\-labelsector \fIsector
|
||||
.TP
|
||||
.B \-\-metadatasize \fIsize
|
||||
.TP
|
||||
.BR \-\-metadataignore " {" \fIy | \fIn }
|
||||
.TP
|
||||
.B \-\-pvmetadatacopies \fIcopies
|
||||
.TP
|
||||
.B \-\-dataalignment \fIalignment
|
||||
.TP
|
||||
.B \-\-dataalignmentoffset \fIalignment_offset
|
||||
.SH Examples
|
||||
Extends the existing volume group "vg00" by the new physical volumes
|
||||
(see \fBpvcreate\fP(8)) "/dev/sda4" and "/dev/sdn1".
|
||||
.sp
|
||||
.B vgextend vg00 /dev/sda4 /dev/sdn1
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgreduce (8),
|
||||
.BR pvcreate (8)
|
38
man/vgimport.8.in
Normal file
38
man/vgimport.8.in
Normal file
@@ -0,0 +1,38 @@
|
||||
.TH VGIMPORT 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgimport \(em make exported volume groups known to the system
|
||||
.SH SYNOPSIS
|
||||
.B vgimport
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgimport allows you to make a Volume Group that was previously
|
||||
exported using
|
||||
.BR vgexport (8)
|
||||
known to the system again, perhaps after moving its Physical Volumes
|
||||
from a different machine.
|
||||
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).
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-a ", " \-\-all
|
||||
Import all exported Volume Groups.
|
||||
.TP
|
||||
.BR \-\-force
|
||||
Import exported Volume Groups even if there are missing Physical Volumes.
|
||||
This option should only be used if the missing devices are known to have
|
||||
failed and they cannot be restored.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR pvscan (8),
|
||||
.BR vgexport (8),
|
||||
.BR vgscan (8),
|
||||
.BR lvmsystemid (7)
|
@@ -1,9 +0,0 @@
|
||||
.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).
|
46
man/vgimportclone.8.in
Normal file
46
man/vgimportclone.8.in
Normal file
@@ -0,0 +1,46 @@
|
||||
.TH VGIMPORTCLONE 8 "LVM TOOLS #VERSION#" "Red Hat, Inc." \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgimportclone \(em import and rename duplicated volume group (e.g. a hardware snapshot)
|
||||
.SH SYNOPSIS
|
||||
.B vgimportclone
|
||||
.RB [ \-n | \-\-basevgname
|
||||
.IR VolumeGroupName ]
|
||||
.RB [ \-i | \-\-import ]
|
||||
.I PhysicalVolume
|
||||
.RI [ PhysicalVolume ...]
|
||||
.SH DESCRIPTION
|
||||
vgimportclone is used to import a duplicated VG (e.g. hardware snapshot).
|
||||
Duplicate VG(s) and PV(s) are not able to be used until they are made
|
||||
to coexist with the origin VG(s) and PV(s).
|
||||
vgimportclone renames the VG associated with the specified PV(s) and
|
||||
changes the associated VG and PV UUIDs.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-n ", " \-\-basevgname " " \fIVolumeGroupName
|
||||
By default the snapshot VG will be renamed to the original name plus a
|
||||
numeric suffix to avoid duplicate naming (e.g. 'test_vg' would be renamed
|
||||
to 'test_vg1'). This option will override the base VG name that is
|
||||
used for all VG renames. If a VG already exists with the specified name
|
||||
a numeric suffix will be added (like the previous example) to make it unique.
|
||||
.TP
|
||||
.BR \-i ", " \-\-import
|
||||
Import exported Volume Groups. Otherwise VGs that have been exported
|
||||
will not be changed (nor will their associated PVs).
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.B LVM_BINARY
|
||||
The LVM2 binary to use. Defaults to "lvm".
|
||||
.SH Examples
|
||||
The origin VG "vg00" has origin PVs "/dev/sda" and "/dev/sdb"
|
||||
and the respective snapshot PVs are "/dev/sdc" and "/dev/sdd".
|
||||
To rename the VG associated with "/dev/sdc" and "/dev/sdd"
|
||||
from "vg00" to "vg00_snap"
|
||||
(and to change associated VG and PV UUIDs) do:
|
||||
.sp
|
||||
.B vgimportclone \-\-basevgname vg00_snap /dev/sdc /dev/sdd
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgrename (8)
|
||||
|
@@ -1,9 +0,0 @@
|
||||
.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.
|
||||
|
41
man/vgmerge.8.in
Normal file
41
man/vgmerge.8.in
Normal file
@@ -0,0 +1,41 @@
|
||||
.TH VGMERGE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgmerge \(em merge two volume groups
|
||||
.SH SYNOPSIS
|
||||
.B vgmerge
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-l | \-\-list ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.I DestinationVolumeGroupName
|
||||
.I SourceVolumeGroupName
|
||||
.SH DESCRIPTION
|
||||
vgmerge merges two existing volume groups. The inactive
|
||||
\fISourceVolumeGroupName\fP will be merged into
|
||||
the \fIDestinationVolumeGroupName\fP if physical extent sizes
|
||||
are equal and physical and logical volume summaries of both volume groups
|
||||
fit into \fIDestinationVolumeGroupName\fP's limits.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-l ", " \-\-list
|
||||
Display merged \fIDestinationVolumeGroupName\fP like \fBvgdisplay \-v\fP.
|
||||
.TP
|
||||
.BR \-t ", " \-\-test
|
||||
Do a test run WITHOUT making any real changes.
|
||||
.SH Examples
|
||||
Merge the inactive volume group named "my_vg"
|
||||
into the active or inactive volume group named "databases" giving verbose
|
||||
runtime information:
|
||||
.sp
|
||||
.B vgmerge \-v databases my_vg
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgextend (8),
|
||||
.BR vgreduce (8)
|
30
man/vgmknodes.8.in
Normal file
30
man/vgmknodes.8.in
Normal file
@@ -0,0 +1,30 @@
|
||||
.TH VGMKNODES 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgmknodes \(em recreate volume group directory and logical volume special files
|
||||
.SH SYNOPSIS
|
||||
.B vgmknodes
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-\-refresh ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [[ VolumeGroupName | LogicalVolumePath ]...]
|
||||
.SH DESCRIPTION
|
||||
Checks the LVM2 special files in /dev that are needed for active
|
||||
logical volumes and creates any missing ones and removes unused ones.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-\-refresh
|
||||
If any logical volume in the volume group is active, reload its metadata.
|
||||
This is not necessary in normal operation, but may be useful
|
||||
if something has gone wrong or if you're doing clustering
|
||||
manually without a clustered lock manager.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgscan (8),
|
||||
.BR dmsetup (8)
|
49
man/vgreduce.8.in
Normal file
49
man/vgreduce.8.in
Normal file
@@ -0,0 +1,49 @@
|
||||
.TH VGREDUCE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgreduce \(em reduce a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgreduce
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-removemissing ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.I VolumeGroupName
|
||||
.RI [ PhysicalVolumePath ...]
|
||||
.SH DESCRIPTION
|
||||
vgreduce allows you to remove one or more unused physical volumes
|
||||
from a volume group.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-a ", " \-\-all
|
||||
Removes all empty physical volumes if none are given on command line.
|
||||
.TP
|
||||
.B \-\-removemissing
|
||||
Removes all missing physical volumes from the volume group, if there are no
|
||||
logical volumes allocated on those. This resumes normal operation of the volume
|
||||
group (new logical volumes may again be created, changed and so on).
|
||||
|
||||
If this is not possible (there are logical volumes referencing the missing
|
||||
physical volumes) and you cannot or do not want to remove them manually, you
|
||||
can run this option with \fB\-\-force\fP to have \fBvgreduce\fP
|
||||
remove any partial LVs.
|
||||
|
||||
Any logical volumes and dependent snapshots that were partly on the
|
||||
missing disks get removed completely. This includes those parts
|
||||
that lie on disks that are still present.
|
||||
|
||||
If your logical volumes spanned several disks including the ones that are
|
||||
lost, you might want to try to salvage data first by activating your
|
||||
logical volumes with \fB\-\-partial\fP as described in \fBlvm\fP(8).
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgextend (8)
|
46
man/vgremove.8.in
Normal file
46
man/vgremove.8.in
Normal file
@@ -0,0 +1,46 @@
|
||||
.TH VGREMOVE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgremove \(em remove a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgremove
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-f | \-\-force ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-noudevsync ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RI [ VolumeGroupName ...]
|
||||
.SH DESCRIPTION
|
||||
vgremove allows you to remove one or more volume groups.
|
||||
If one or more physical volumes in the volume group are lost,
|
||||
consider \fBvgreduce \-\-removemissing\fP to make the volume group
|
||||
metadata consistent again.
|
||||
.sp
|
||||
If there are logical volumes that exist in the volume group,
|
||||
a prompt will be given to confirm removal. You can override
|
||||
the prompt with \fB\-f\fP.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
Force the removal of any logical volumes on the volume group
|
||||
without confirmation.
|
||||
To remove also damaged pool volumes use \-ff.
|
||||
.TP
|
||||
.BR \-\-noudevsync
|
||||
Disable udev synchronisation. The
|
||||
process will not wait for notification from udev.
|
||||
It will continue irrespective of any possible udev processing
|
||||
in the background. You should only use this if udev is not running
|
||||
or has rules that ignore the devices LVM2 creates.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR lvremove (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgreduce (8)
|
58
man/vgrename.8.in
Normal file
58
man/vgrename.8.in
Normal file
@@ -0,0 +1,58 @@
|
||||
.TH VGRENAME 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgrename \(em rename a volume group
|
||||
.SH SYNOPSIS
|
||||
.B vgrename
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.IR OldVolumeGroup { Path | Name | UUID }
|
||||
.IR NewVolumeGroup { Path | Name }
|
||||
.SH DESCRIPTION
|
||||
vgrename renames an existing (see
|
||||
.BR vgcreate (8))
|
||||
volume group from
|
||||
.IR OldVolumeGroup { Name | Path | UUID }
|
||||
to
|
||||
.IR NewVolumeGroup { Name | Path }.
|
||||
|
||||
All the Volume Groups visible to a system need to have different
|
||||
names. Otherwise many LVM2 commands will refuse to run or give
|
||||
warning messages.
|
||||
|
||||
This situation could arise when disks are moved between machines. If
|
||||
a disk is connected and it contains a Volume Group with the same name
|
||||
as the Volume Group containing your root filesystem the machine might
|
||||
not even boot correctly. However, the two Volume Groups should have
|
||||
different UUIDs (unless the disk was cloned) so you can rename
|
||||
one of the conflicting Volume Groups with
|
||||
\fBvgrename\fP.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.SH Examples
|
||||
Renames existing volume group vg02 to my_volume_group:
|
||||
.sp
|
||||
.B vgrename /dev/vg02 /dev/my_volume_group
|
||||
|
||||
or
|
||||
.sp
|
||||
.B vgrename vg02 my_volume_group
|
||||
|
||||
Changes the name of the Volume Group with UUID
|
||||
.br
|
||||
Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to VolGroup00_tmp:
|
||||
.sp
|
||||
.B vgrename Zvlifi\-Ep3t\-e0Ng\-U42h\-o0ye\-KHu1\-nl7Ns4 VolGroup00_tmp
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgchange (8),
|
||||
.BR vgcreate (8),
|
||||
.BR lvrename (8)
|
161
man/vgs.8.in
Normal file
161
man/vgs.8.in
Normal file
@@ -0,0 +1,161 @@
|
||||
.TH VGS 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgs \(em report information about volume groups
|
||||
.SH SYNOPSIS
|
||||
.B vgs
|
||||
.RB [ \-a | \-\-all ]
|
||||
.RB [ \-\-aligned ]
|
||||
.RB [ \-\-binary ]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [[ \-\-configreport
|
||||
.IR ReportName ]
|
||||
.RB [ \-o | \-\-options
|
||||
.RI [ + | \- | # ] Field1 [, Field2 ...]
|
||||
.RB [ \-O | \-\-sort
|
||||
.RI [ + | \- ] Key1 [, Key2 ...]]
|
||||
.RB [ \-S | \-\-select
|
||||
.IR Selection ]
|
||||
.RB ...]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-ignoreskippedcluster ]
|
||||
.RB [ \-\-logonly ]
|
||||
.RB [ \-\-nameprefixes ]
|
||||
.RB [ \-\-noheadings ]
|
||||
.RB [ \-\-nosuffix ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-\-rows ]
|
||||
.RB [ \-\-separator
|
||||
.IR Separator ]
|
||||
.RB [ \-\-unbuffered ]
|
||||
.RB [ \-\-units
|
||||
.IR hHbBsSkKmMgGtTpPeE ]
|
||||
.RB [ \-\-unquoted ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.RB [ \-\-version ]
|
||||
.RI [ VolumeGroupName
|
||||
.RI [ VolumeGroupName ...]]
|
||||
.SH DESCRIPTION
|
||||
vgs produces formatted output about volume groups.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-all
|
||||
List all volume groups. Equivalent to not specifying any volume groups.
|
||||
.TP
|
||||
.B \-\-aligned
|
||||
Use with \fB\-\-separator\fP to align the output columns.
|
||||
.TP
|
||||
.B \-\-binary
|
||||
Use binary values "0" or "1" instead of descriptive literal values
|
||||
for columns that have exactly two valid values to report (not counting
|
||||
the "unknown" value which denotes that the value could not be determined).
|
||||
.TP
|
||||
.B \-\-configreport \fI ReportName
|
||||
Make any subsequent \fB\-o, \-\-options\fP, \fB\-O, \-\-sort\fP or
|
||||
\fB\-S, \-\-select\fP to apply for \fIReportName\fP where \fIReportName\fP
|
||||
is either 'vg' for command's main report or 'log' for log report.
|
||||
If \fB\-\-configreport\fP option is not used to identify a report, then
|
||||
command's main report is assumed. The log report is available only if
|
||||
enabled by \fBlog/report_command_log\fP \fBlvm.conf\fP(5) setting or
|
||||
if \fB\-\-logonly\fP option is used.
|
||||
.TP
|
||||
.B \-\-logonly
|
||||
Suppress the vgs report itself and display only log report on output.
|
||||
.TP
|
||||
.B \-\-nameprefixes
|
||||
Add an "LVM2_" prefix plus the field name to the output. Useful
|
||||
with \fB\-\-noheadings\fP to produce a list of field=value pairs that can
|
||||
be used to set environment variables (for example, in \fBudev\fP(7) rules).
|
||||
.TP
|
||||
.B \-\-noheadings
|
||||
Suppress the headings line that is normally the first line of output.
|
||||
Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-nosuffix
|
||||
Suppress the suffix on output sizes. Use with \fB\-\-units\fP
|
||||
(except h and H) if processing the output.
|
||||
.TP
|
||||
.BR \-o ", " \-\-options
|
||||
Comma-separated ordered list of columns.
|
||||
.IP
|
||||
Precede the list with '\fI+\fP' to append to the current list
|
||||
of columns, '\fI-\fP' to remove from the current list of columns
|
||||
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
|
||||
be repeated, providing several lists. These lists are evaluated
|
||||
from left to right.
|
||||
.IP
|
||||
Use \fB\-o vg_all\fP to select all volume group columns.
|
||||
.IP
|
||||
Use \fB\-o help\fP to view the full list of columns available.
|
||||
.IP
|
||||
Column names include: vg_fmt, vg_uuid, vg_name, vg_attr, vg_size, vg_free,
|
||||
vg_sysid, vg_extent_size, vg_extent_count, vg_free_count, vg_profile, max_lv,
|
||||
max_pv, pv_count, lv_count, snap_count, vg_seqno, vg_tags, vg_mda_count,
|
||||
vg_mda_free, and vg_mda_size, vg_mda_used_count.
|
||||
.IP
|
||||
Any "vg_" prefixes are optional. Columns mentioned in either \fBpvs\fP(8)
|
||||
or \fBlvs\fP(8) can also be chosen, but columns cannot be taken from both
|
||||
at the same time.
|
||||
.IP
|
||||
The vg_attr bits are:
|
||||
.RS
|
||||
.IP 1 3
|
||||
Permissions: (w)riteable, (r)ead-only
|
||||
.IP 2 3
|
||||
Resi(z)eable
|
||||
.IP 3 3
|
||||
E(x)ported
|
||||
.IP 4 3
|
||||
(p)artial: one or more physical volumes belonging to the volume group
|
||||
are missing from the system
|
||||
.IP 5 3
|
||||
Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere
|
||||
.IP 6 3
|
||||
(c)lustered, (s)hared
|
||||
.RE
|
||||
.TP
|
||||
.BR \-O ", " \-\-sort
|
||||
Comma-separated ordered list of columns to sort by. Replaces the default
|
||||
selection. Precede any column with '\fI\-\fP' for a reverse sort on that
|
||||
column.
|
||||
.TP
|
||||
.B \-\-rows
|
||||
Output columns as rows.
|
||||
.TP
|
||||
.BR \-S ", " \-\-select " " \fISelection
|
||||
Display only rows that match Selection criteria. All rows are displayed with
|
||||
the additional "selected" column (\fB-o selected\fP) showing 1 if the row
|
||||
matches the Selection and 0 otherwise. The Selection criteria are defined
|
||||
by specifying column names and their valid values (that can include reserved
|
||||
values) while making use of supported comparison operators. See \fBlvm\fP(8)
|
||||
and \fB\-S\fP, \fB\-\-select\fP description for more detailed information
|
||||
about constructing the Selection criteria. As a quick help and to see full
|
||||
list of column names that can be used in Selection including the list of
|
||||
reserved values and the set of supported selection operators, check the
|
||||
output of \fBvgs -S help\fP command.
|
||||
.TP
|
||||
.B \-\-separator \fISeparator
|
||||
String to use to separate each column. Useful if grepping the output.
|
||||
.TP
|
||||
.B \-\-unbuffered
|
||||
Produce output immediately without sorting or aligning the columns properly.
|
||||
.TP
|
||||
.B \-\-units \fIhHbBsSkKmMgGtTpPeE
|
||||
All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors,
|
||||
(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.
|
||||
Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify
|
||||
custom units e.g. \-\-units 3M
|
||||
.TP
|
||||
.B \-\-unquoted
|
||||
When used with \fB\-\-nameprefixes\fP, output values in the field=value
|
||||
pairs are not quoted.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgdisplay (8),
|
||||
.BR pvs (8),
|
||||
.BR lvs (8)
|
@@ -1,17 +0,0 @@
|
||||
.SH NOTES
|
||||
.
|
||||
The vg_attr bits are:
|
||||
.IP 1 3
|
||||
Permissions: (w)riteable, (r)ead-only
|
||||
.IP 2 3
|
||||
Resi(z)eable
|
||||
.IP 3 3
|
||||
E(x)ported
|
||||
.IP 4 3
|
||||
(p)artial: one or more physical volumes belonging to the volume group
|
||||
are missing from the system
|
||||
.IP 5 3
|
||||
Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere
|
||||
.IP 6 3
|
||||
(c)lustered, (s)hared
|
||||
|
43
man/vgscan.8.in
Normal file
43
man/vgscan.8.in
Normal file
@@ -0,0 +1,43 @@
|
||||
.TH VGSCAN 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgscan \(em scan all disks for volume groups and rebuild caches
|
||||
.SH SYNOPSIS
|
||||
.B vgscan
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-? | \-\-help ]
|
||||
.RB [ \-\-ignorelockingfailure ]
|
||||
.RB [ \-\-mknodes ]
|
||||
.RB [ \-\-notifydbus ]
|
||||
.RB [ \-P | \-\-partial ]
|
||||
.RB [ \-\-reportformat
|
||||
.RB { basic | json }]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.SH DESCRIPTION
|
||||
vgscan scans all SCSI, (E)IDE disks, multiple devices and a bunch
|
||||
of other disk devices in the system looking for LVM physical volumes
|
||||
and volume groups. Define a filter in \fBlvm.conf\fP(5) to restrict
|
||||
the scan to avoid a CD ROM, for example.
|
||||
.LP
|
||||
In LVM2, vgscans take place automatically; but you might still need to
|
||||
run one explicitly after changing hardware.
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.TP
|
||||
.B \-\-mknodes
|
||||
Also checks the LVM special files in /dev that are needed for active
|
||||
logical volumes and creates any missing ones and removes unused ones.
|
||||
.TP
|
||||
.B \-\-notifydbus
|
||||
Send a notification to D-Bus. The command will exit with an error
|
||||
if LVM is not built with support for D-Bus notification, or if the
|
||||
notify_dbus config setting is disabled.
|
||||
.TP
|
||||
.B \-\-cache
|
||||
Scan devices for LVM physical volumes and volume groups and instruct
|
||||
the lvmetad daemon to update its cached state accordingly.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgchange (8)
|
80
man/vgsplit.8.in
Normal file
80
man/vgsplit.8.in
Normal file
@@ -0,0 +1,80 @@
|
||||
.TH VGSPLIT 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
|
||||
.SH NAME
|
||||
vgsplit \(em split a volume group into two
|
||||
.SH SYNOPSIS
|
||||
.B vgsplit
|
||||
.RB [ \-\-alloc
|
||||
.IR AllocationPolicy ]
|
||||
.RB [ \-A | \-\-autobackup
|
||||
.RI { y | n }]
|
||||
.RB [ \-c | \-\-clustered
|
||||
.RI { y | n }]
|
||||
.RB [ \-\-commandprofile
|
||||
.IR ProfileName ]
|
||||
.RB [ \-d | \-\-debug ]
|
||||
.RB [ \-h | \-\-help ]
|
||||
.RB [ \-l | \-\-maxlogicalvolumes
|
||||
.IR MaxLogicalVolumes ]
|
||||
.RB [ \-M | \-\-metadatatype
|
||||
.IR type ]
|
||||
.RB [ \-p | \-\-maxphysicalvolumes
|
||||
.IR MaxPhysicalVolumes ]
|
||||
.RB [ \-\- [ vg ] metadatacopies
|
||||
.IR NumberOfCopies | unmanaged | all ]
|
||||
.RB [ \-n | \-\-name
|
||||
.IR LogicalVolumeName ]
|
||||
.RB [ \-t | \-\-test ]
|
||||
.RB [ \-v | \-\-verbose ]
|
||||
.I SourceVolumeGroupName DestinationVolumeGroupName
|
||||
.RI [ PhysicalVolumePath ...]
|
||||
.SH DESCRIPTION
|
||||
vgsplit moves one or more physical volumes from
|
||||
\fISourceVolumeGroupName\fP into \fIDestinationVolumeGroupName\fP.
|
||||
The physical volumes moved can be specified either explicitly via
|
||||
\fIPhysicalVolumePath\fP, or implicitly by \fB\-n\fP
|
||||
\fILogicalVolumeName\fP, in which case only physical volumes
|
||||
underlying the specified logical volume will be moved.
|
||||
|
||||
If \fIDestinationVolumeGroupName\fP does not exist, a new volume
|
||||
group will be created. The default attributes
|
||||
for the new volume group can be specified with
|
||||
.BR \-\-alloc ,
|
||||
.BR \-\-clustered ,
|
||||
.BR \-\-maxlogicalvolumes ,
|
||||
.BR \-\-metadatatype ,
|
||||
.B \-\-maxphysicalvolumes \fRand
|
||||
.BR \-\- [ vg ] metadatacopies
|
||||
(see \fBvgcreate\fP(8) for a description of these options). If any
|
||||
of these options are not given, default attribute(s) are taken from
|
||||
\fISourceVolumeGroupName\fP. If a non-LVM2 metadata type (e.g. lvm1) is
|
||||
being used, you should use the \fB\-M\fP option to specify the metadata
|
||||
type directly.
|
||||
|
||||
If
|
||||
.I DestinationVolumeGroupName
|
||||
does exist, it will be checked for compatibility with
|
||||
.I SourceVolumeGroupName
|
||||
before the physical volumes are moved. Specifying any of the above default
|
||||
volume group attributes with an existing destination volume group is an error,
|
||||
and no split will occur.
|
||||
|
||||
Logical volumes cannot be split between volume groups. \fBvgsplit\fP(8) only
|
||||
moves complete physical volumes: To move part of a physical volume, use
|
||||
\fBpvmove\fP(8). Each existing logical volume must be entirely on the physical
|
||||
volumes forming either the source or the destination volume group. For this
|
||||
reason, \fBvgsplit\fP(8) may fail with an error if a split would result in a
|
||||
logical volume being split across volume groups.
|
||||
|
||||
A vgsplit into an existing volume group retains the existing volume group's
|
||||
value of \fPvgmetadatacopies\fP (see \fBvgcreate\fP(8) and \fBlvm.conf\fP(5) for further
|
||||
explanation of \fPvgmetadatacopies\fP). To change the value of
|
||||
\fBvgmetadatacopies\fP, use \fBvgchange\fP(8).
|
||||
|
||||
.SH OPTIONS
|
||||
See \fBlvm\fP(8) for common options.
|
||||
.SH SEE ALSO
|
||||
.BR lvm (8),
|
||||
.BR vgcreate (8),
|
||||
.BR vgextend (8),
|
||||
.BR vgreduce (8),
|
||||
.BR vgmerge (8)
|
@@ -1,18 +0,0 @@
|
||||
.SH NOTES
|
||||
.
|
||||
.IP \[bu] 3
|
||||
vgsplit moves one or more PVs from a source VG to a destination VG. The
|
||||
PVs can be specified explicitly or implicitly by naming an LV, in which
|
||||
case on PVs underlying the LV are moved.
|
||||
|
||||
.IP \[bu] 3
|
||||
If the destination VG does not exist, a new VG is created (command options
|
||||
can be used to specify properties of the new VG.)
|
||||
|
||||
.IP \[bu] 3
|
||||
LVs cannot be split between VGs; each LV must be entirely on the PVs in
|
||||
the source or destination VG.
|
||||
|
||||
.IP \[bu] 3
|
||||
vgsplit can only move complete PVs. (See pvmove for moving part of a PV.)
|
||||
|
@@ -1413,10 +1413,10 @@ have_raid() {
|
||||
}
|
||||
|
||||
have_raid4 () {
|
||||
local r=1
|
||||
local r=0
|
||||
|
||||
have_raid 1 8 0 && r=0
|
||||
have_raid 1 9 1 && r=1
|
||||
have_raid 1 8 0 && r=1
|
||||
have_raid 1 9 1 && r=0
|
||||
|
||||
return $r
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ lvcreate -L3 -n cow $vg
|
||||
not lvconvert -s cow $vg/$lv1
|
||||
|
||||
# Use cached LV with 'striped' cow volume
|
||||
lvconvert -y -s $vg/$lv1 $vg/cow
|
||||
lvconvert -y -s $vg/$lv1 cow
|
||||
check lv_field $vg/cow segtype linear
|
||||
check lv_field $vg/$lv1 segtype cache
|
||||
|
||||
|
@@ -60,7 +60,7 @@ check lv_field $vg/$lv2 cache_settings "random_threshold=56,sequential_threshold
|
||||
# Check swap of cache pool metadata
|
||||
lvconvert --yes --type cache-pool --poolmetadata $lv4 $vg/$lv3
|
||||
UUID=$(get lv_field $vg/$lv5 uuid)
|
||||
lvconvert --yes --swapmetadata --poolmetadata $lv5 $vg/$lv3
|
||||
lvconvert --yes --cachepool $vg/$lv3 --poolmetadata $lv5
|
||||
check lv_field $vg/${lv3}_cmeta uuid "$UUID"
|
||||
|
||||
|
||||
@@ -108,30 +108,30 @@ lvcreate -an -Zn -L 8 -n $lv4 $vg
|
||||
invalid lvconvert --type cache --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
|
||||
# Cannot mix with thins
|
||||
not lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
|
||||
not lvconvert --type cache --thin --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
invalid lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
|
||||
invalid lvconvert --type cache --thin --poolmetadata $vg/$lv2 $vg/$lv1
|
||||
|
||||
# Undefined cached volume
|
||||
not lvconvert --type cache --cachepool $vg/$lv1
|
||||
not lvconvert --cache --cachepool $vg/$lv1
|
||||
invalid lvconvert --type cache --cachepool $vg/$lv1
|
||||
invalid lvconvert --cache --cachepool $vg/$lv1
|
||||
|
||||
# Single vg is required
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
|
||||
not lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
invalid lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
|
||||
invalid lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
|
||||
invalid lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
|
||||
invalid lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
|
||||
not lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
invalid lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
|
||||
# Invalid syntax, vg is unknown
|
||||
not lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
invalid lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
|
||||
# Invalid chunk size is <32KiB >1GiB
|
||||
not lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
not lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
invalid lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
invalid lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
# Invalid chunk size is bigger then data size, needs to open VG
|
||||
not lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
fail lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
@@ -142,7 +142,7 @@ lvcreate --type cache-pool -an -v -L 2 -n cpool $vg
|
||||
lvcreate -H -L 4 -n corigin --cachepool $vg/cpool
|
||||
|
||||
# unsupported yet
|
||||
not lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
fail lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
#grep "Cannot convert internal LV" out
|
||||
|
||||
lvremove -f $vg
|
||||
@@ -154,13 +154,13 @@ lvcreate --type cache-pool -L10 $vg/$lv1
|
||||
lvcreate --cache -L20 $vg/$lv1
|
||||
lvcreate -L10 -n $lv2 $vg
|
||||
|
||||
not lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
not lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
not lvconvert --yes --type cache-pool $vg/$lv1
|
||||
not lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
fail lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
fail lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
fail lvconvert --yes --type cache-pool $vg/$lv1
|
||||
fail lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
not aux have_raid 1 0 0 || fail lvconvert --yes --type raid1 -m1 $vg/$lv1
|
||||
not lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
not lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
fail lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
fail lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
not aux have_thin 1 0 0 || fail lvconvert --yes -T --thinpool $vg/$lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
@@ -85,9 +85,12 @@ offset=$(( offset + 2 ))
|
||||
# update in case mirror ever gets faster and allows parallel read
|
||||
aux delay_dev "$dev2" 0 2000 ${offset}:1
|
||||
lvcreate -aey -l5 -Zn -Wn --type mirror --regionsize 16K -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
|
||||
# FIXME: add a new explicit option to define the polling behavior
|
||||
# done here with 'lvconvert vg/lv'. That option can specify
|
||||
# that the command succeeds even if the LV doesn't need polling.
|
||||
should not lvconvert -m-1 $vg/$lv1 "$dev1"
|
||||
aux enable_dev "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
lvconvert -m2 $vg/$lv1 "$dev1" "$dev2" "$dev4" "$dev3:0" # If the above "should" failed...
|
||||
|
||||
aux wait_for_sync $vg $lv1
|
||||
@@ -113,7 +116,7 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# Next convert should fail b/c we can't have 2 at once
|
||||
should not lvconvert -m+1 $vg/$lv1 "$dev5"
|
||||
aux enable_dev "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
lvconvert -m2 $vg/$lv1 # In case the above "should" actually failed
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
@@ -156,7 +159,7 @@ lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE
|
||||
lvchange -an $vg/$lv1
|
||||
lvconvert -m+1 $vg/$lv1 "$dev4"
|
||||
lvchange -aey $vg/$lv1
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
lvremove -ff $vg
|
||||
@@ -168,7 +171,7 @@ lvremove -ff $vg
|
||||
lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE"
|
||||
LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
lvconvert -m-1 $vg/$lv1 "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -179,7 +182,7 @@ lvremove -ff $vg
|
||||
lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE"
|
||||
LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+2 -b $vg/$lv1 "$dev4" "$dev5"
|
||||
lvconvert -m-1 $vg/$lv1 "$dev4"
|
||||
lvconvert --startpoll $vg/$lv1 || true # wait
|
||||
should lvconvert $vg/$lv1 # wait
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -192,9 +195,9 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# FIXME: Extra wait here for mirror upconvert synchronization
|
||||
# otherwise we may fail her on parallel upconvert and downconvert
|
||||
# lvconvert-mirror-updown.sh tests this errornous case separately
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
lvconvert -m-1 $vg/$lv1 "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
@@ -207,9 +210,9 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4"
|
||||
# FIXME: Extra wait here for mirror upconvert synchronization
|
||||
# otherwise we may fail her on parallel upconvert and downconvert
|
||||
# lvconvert-mirror-updown.sh tests this errornous case separately
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
lvconvert -m-1 $vg/$lv1 "$dev2"
|
||||
lvconvert --startpoll $vg/$lv1 || true
|
||||
should lvconvert $vg/$lv1
|
||||
|
||||
check mirror $vg $lv1 "$dev3"
|
||||
check mirror_no_temporaries $vg $lv1
|
||||
|
90
test/shell/lvconvert-raid-regionsize.sh
Normal file
90
test/shell/lvconvert-raid-regionsize.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
. lib/inittest
|
||||
|
||||
aux have_raid 1 9 0 || skip
|
||||
|
||||
aux prepare_vg 6
|
||||
|
||||
function _test_regionsize
|
||||
{
|
||||
local type=$1
|
||||
local regionsize=$2
|
||||
local regionsize_str=$3
|
||||
local vg=$4
|
||||
local lv=$5
|
||||
|
||||
lvconvert --type $type --yes -R $regionsize $vg/$lv
|
||||
[ $? -ne 0 ] && return 1
|
||||
check lv_field $vg/$lv regionsize "$regionsize_str"
|
||||
fsck -fn /dev/mapper/$vg-$lv
|
||||
}
|
||||
|
||||
function _test_regionsizes
|
||||
{
|
||||
# FIXME: have to provide raid type or region size ain't set until cli validation merged
|
||||
local type=$1
|
||||
|
||||
# Test RAID regionsize changes
|
||||
_test_regionsize $type 128K "128.00k" $vg $lv1
|
||||
_test_regionsize $type 256K "256.00k" $vg $lv1
|
||||
not _test_regionsize $type 1K "1.00k" $vg $lv1
|
||||
_test_regionsize $type 1m "1.00m" $vg $lv1
|
||||
not _test_regionsize $type 1G "1.00g" $vg $lv1
|
||||
not _test_regionsize $type 16K "16.00k" $vg $lv1
|
||||
}
|
||||
|
||||
# Create 3-way raid1
|
||||
lvcreate --yes -aey --type raid1 -m 2 -R64K -L 64M -n $lv1 $vg
|
||||
check lv_field $vg/$lv1 segtype "raid1"
|
||||
check lv_field $vg/$lv1 stripes 3
|
||||
check lv_field $vg/$lv1 regionsize "64.00k"
|
||||
echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
_test_regionsizes raid1
|
||||
|
||||
# Clean up
|
||||
lvremove --yes $vg
|
||||
|
||||
# Create 5-way raid6
|
||||
lvcreate --yes -aey --type raid6 -i 3 --stripesize 128K -R 256K -L 64M -n $lv1 $vg
|
||||
check lv_field $vg/$lv1 segtype "raid6"
|
||||
check lv_field $vg/$lv1 stripes 5
|
||||
check lv_field $vg/$lv1 stripesize "128.00k"
|
||||
check lv_field $vg/$lv1 regionsize "256.00k"
|
||||
echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
_test_regionsizes raid6
|
||||
|
||||
# Clean up
|
||||
lvremove --yes $vg
|
||||
|
||||
# Create 6-way raid01
|
||||
lvcreate --yes -aey --type raid10 -i 3 -m 1 --stripesize 128K -R 256K -L 64M -n $lv1 $vg
|
||||
check lv_field $vg/$lv1 segtype "raid10"
|
||||
check lv_field $vg/$lv1 stripes 6
|
||||
check lv_field $vg/$lv1 stripesize "128.00k"
|
||||
check lv_field $vg/$lv1 regionsize "256.00k"
|
||||
echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
_test_regionsizes raid10
|
||||
|
||||
vgremove -ff $vg
|
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA2110-1301 USA
|
||||
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
@@ -44,13 +44,20 @@ function _lvconvert
|
||||
local stripes=$3
|
||||
local vg=$4
|
||||
local lv=$5
|
||||
local dont_wait=$6
|
||||
local region_size=$6
|
||||
local wait_and_check=1
|
||||
local R=""
|
||||
|
||||
lvconvert -y --ty $req_level $vg/$lv
|
||||
[ -n "$region_size" ] && R="-R $region_size"
|
||||
[ "${level:0:7}" = "striped" ] && wait_and_check=0
|
||||
[ "${level:0:5}" = "raid0" ] && wait_and_check=0
|
||||
|
||||
|
||||
lvconvert -y --ty $req_level $R $vg/$lv
|
||||
[ $? -ne 0 ] && return $?
|
||||
check lv_field $vg/$lv segtype "$level"
|
||||
check lv_field $vg/$lv stripes $stripes
|
||||
if [ -z "$dont_wait" ]
|
||||
if [ "$wait_and_check" -eq 1 ]
|
||||
then
|
||||
fsck -fn /dev/mapper/$vg-$lv
|
||||
aux wait_for_sync $vg $lv
|
||||
@@ -60,8 +67,8 @@ function _lvconvert
|
||||
|
||||
function _invalid_raid5_conversions
|
||||
{
|
||||
local lv=$1
|
||||
local vg=$2
|
||||
local vg=$1
|
||||
local lv=$2
|
||||
|
||||
not _lvconvert striped 4 $vg $lv1
|
||||
not _lvconvert raid0 raid0 4 $vg $lv1
|
||||
@@ -78,14 +85,15 @@ function _invalid_raid5_conversions
|
||||
not _lvconvert raid6 raid6_n_6 6 $vg $lv1
|
||||
}
|
||||
|
||||
# Delay 1st leg so that rebuilding status characters
|
||||
# Delayst leg so that rebuilding status characters
|
||||
# can be read before resync finished too quick.
|
||||
# aux delay_dev "$dev1" 0 1
|
||||
# aux delay_dev "$dev1" 1
|
||||
|
||||
# Create 3-way mirror
|
||||
lvcreate --yes -aey --type mirror -m 2 -L 64M -n $lv1 $vg
|
||||
lvcreate --yes -aey --type mirror -R 64K -m 2 -L 64M -n $lv1 $vg
|
||||
check lv_field $vg/$lv1 segtype "mirror"
|
||||
check lv_field $vg/$lv1 stripes 3
|
||||
check lv_field $vg/$lv1 regionsize "64.00k"
|
||||
echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
@@ -99,15 +107,18 @@ aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
# Takeover 4-way mirror to raid1
|
||||
lvconvert --yes --type raid1 $vg/$lv1
|
||||
lvconvert --yes --type raid1 -R 64k $vg/$lv1
|
||||
check lv_field $vg/$lv1 segtype "raid1"
|
||||
check lv_field $vg/$lv1 stripes 4
|
||||
check lv_field $vg/$lv1 regionsize "64.00k"
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
## Convert 4-way raid1 to 5-way
|
||||
lvconvert -m 4 $vg/$lv1
|
||||
lvconvert -m 4 -R 128K $vg/$lv1
|
||||
check lv_field $vg/$lv1 segtype "raid1"
|
||||
check lv_field $vg/$lv1 stripes 5
|
||||
# FIXME: once lv_raid_chanage_image_count() supports region_size changes
|
||||
not check lv_field $vg/$lv1 regionsize "128.00k"
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
@@ -128,9 +139,10 @@ check lv_field $vg/$lv1 stripes 2
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
|
||||
# Convert 2-way raid1 to mirror
|
||||
lvconvert --yes --type mirror $vg/$lv1
|
||||
lvconvert --yes --type mirror -R 32K $vg/$lv1
|
||||
check lv_field $vg/$lv1 segtype "mirror"
|
||||
check lv_field $vg/$lv1 stripes 2
|
||||
check lv_field $vg/$lv1 regionsize "32.00k"
|
||||
aux wait_for_sync $vg $lv1
|
||||
fsck -fn /dev/mapper/$vg-$lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
@@ -151,79 +163,81 @@ _lvcreate raid4 3 4 64M $vg $lv1
|
||||
aux wait_for_sync $vg $lv1
|
||||
|
||||
# Convert raid4 -> striped
|
||||
_lvconvert striped striped 3 $vg $lv1 1
|
||||
_lvconvert striped striped 3 $vg $lv1
|
||||
|
||||
# Convert striped -> raid4
|
||||
_lvconvert raid4 raid4 4 $vg $lv1
|
||||
_lvconvert raid4 raid4 4 $vg $lv1 64k
|
||||
check lv_field $vg/$lv1 regionsize "64.00k"
|
||||
|
||||
# Convert raid4 -> raid5_n
|
||||
_lvconvert raid5 raid5_n 4 $vg $lv1 1
|
||||
_lvconvert raid5 raid5_n 4 $vg $lv1 128k
|
||||
check lv_field $vg/$lv1 regionsize "128.00k"
|
||||
|
||||
# Convert raid5_n -> striped
|
||||
_lvconvert striped striped 3 $vg $lv1 1
|
||||
_lvconvert striped striped 3 $vg $lv1
|
||||
|
||||
# Convert striped -> raid5_n
|
||||
_lvconvert raid5_n raid5_n 4 $vg $lv1
|
||||
|
||||
# Convert raid5_n -> raid4
|
||||
_lvconvert raid4 raid4 4 $vg $lv1 1
|
||||
_lvconvert raid4 raid4 4 $vg $lv1
|
||||
|
||||
# Convert raid4 -> raid0
|
||||
_lvconvert raid0 raid0 3 $vg $lv1 1
|
||||
_lvconvert raid0 raid0 3 $vg $lv1
|
||||
|
||||
# Convert raid0 -> raid5_n
|
||||
_lvconvert raid5_n raid5_n 4 $vg $lv1
|
||||
|
||||
# Convert raid5_n -> raid0_meta
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1 1
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1
|
||||
|
||||
# Convert raid0_meta -> raid5_n
|
||||
_lvconvert raid5 raid5_n 4 $vg $lv1
|
||||
|
||||
# Convert raid4 -> raid0_meta
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1 1
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1
|
||||
|
||||
# Convert raid0_meta -> raid4
|
||||
_lvconvert raid4 raid4 4 $vg $lv1
|
||||
|
||||
# Convert raid4 -> raid0
|
||||
_lvconvert raid0 raid0 3 $vg $lv1 1
|
||||
_lvconvert raid0 raid0 3 $vg $lv1
|
||||
|
||||
# Convert raid0 -> raid4
|
||||
_lvconvert raid4 raid4 4 $vg $lv1
|
||||
|
||||
# Convert raid4 -> striped
|
||||
_lvconvert striped striped 3 $vg $lv1 1
|
||||
_lvconvert striped striped 3 $vg $lv1
|
||||
|
||||
# Convert striped -> raid6_n_6
|
||||
_lvconvert raid6_n_6 raid6_n_6 5 $vg $lv1
|
||||
|
||||
# Convert raid6_n_6 -> striped
|
||||
_lvconvert striped striped 3 $vg $lv1 1
|
||||
_lvconvert striped striped 3 $vg $lv1
|
||||
|
||||
# Convert striped -> raid6_n_6
|
||||
_lvconvert raid6 raid6_n_6 5 $vg $lv1
|
||||
|
||||
# Convert raid6_n_6 -> raid5_n
|
||||
_lvconvert raid5_n raid5_n 4 $vg $lv1 1
|
||||
_lvconvert raid5_n raid5_n 4 $vg $lv1
|
||||
|
||||
# Convert raid5_n -> raid6_n_6
|
||||
_lvconvert raid6_n_6 raid6_n_6 5 $vg $lv1
|
||||
|
||||
# Convert raid6_n_6 -> raid4
|
||||
_lvconvert raid4 raid4 4 $vg $lv1 1
|
||||
_lvconvert raid4 raid4 4 $vg $lv1
|
||||
|
||||
# Convert raid4 -> raid6_n_6
|
||||
_lvconvert raid6 raid6_n_6 5 $vg $lv1
|
||||
|
||||
# Convert raid6_n_6 -> raid0
|
||||
_lvconvert raid0 raid0 3 $vg $lv1 1
|
||||
_lvconvert raid0 raid0 3 $vg $lv1
|
||||
|
||||
# Convert raid0 -> raid6_n_6
|
||||
_lvconvert raid6_n_6 raid6_n_6 5 $vg $lv1
|
||||
|
||||
# Convert raid6_n_6 -> raid0_meta
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1 1
|
||||
_lvconvert raid0_meta raid0_meta 3 $vg $lv1
|
||||
|
||||
# Convert raid0_meta -> raid6_n_6
|
||||
_lvconvert raid6 raid6_n_6 5 $vg $lv1
|
||||
@@ -239,7 +253,7 @@ not _lvconvert raid6_rs_6 raid6_rs_6 6 $vg $lv1
|
||||
not _lvconvert raid6_la_6 raid6_la_6 6 $vg $lv1
|
||||
not _lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
_lvconvert raid6_ls_6 raid6_ls_6 6 $vg $lv1
|
||||
_lvconvert raid5_ls raid5_ls 5 $vg $lv1 1
|
||||
_lvconvert raid5_ls raid5_ls 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
_lvcreate raid5_ls 4 5 64M $vg $lv1
|
||||
@@ -249,7 +263,7 @@ not _lvconvert raid6_rs_6 raid6_rs_6 6 $vg $lv1
|
||||
not _lvconvert raid6_la_6 raid6_la_6 6 $vg $lv1
|
||||
not _lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
_lvconvert raid6_ls_6 raid6_ls_6 6 $vg $lv1
|
||||
_lvconvert raid5_ls raid5_ls 5 $vg $lv1 1
|
||||
_lvconvert raid5_ls raid5_ls 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
_lvcreate raid5_rs 4 5 64M $vg $lv1
|
||||
@@ -259,7 +273,7 @@ not _lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
not _lvconvert raid6_la_6 raid6_la_6 6 $vg $lv1
|
||||
not _lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
_lvconvert raid6_rs_6 raid6_rs_6 6 $vg $lv1
|
||||
_lvconvert raid5_rs raid5_rs 5 $vg $lv1 1
|
||||
_lvconvert raid5_rs raid5_rs 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
_lvcreate raid5_la 4 5 64M $vg $lv1
|
||||
@@ -269,7 +283,7 @@ not _lvconvert raid6_ls_6 raid6_ls_6 6 $vg $lv1
|
||||
not _lvconvert raid6_rs_6 raid6_rs_6 6 $vg $lv1
|
||||
not _lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
_lvconvert raid6_la_6 raid6_la_6 6 $vg $lv1
|
||||
_lvconvert raid5_la raid5_la 5 $vg $lv1 1
|
||||
_lvconvert raid5_la raid5_la 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
_lvcreate raid5_ra 4 5 64M $vg $lv1
|
||||
@@ -279,7 +293,7 @@ not _lvconvert raid6_ls_6 raid6_ls_6 6 $vg $lv1
|
||||
not _lvconvert raid6_rs_6 raid6_rs_6 6 $vg $lv1
|
||||
not _lvconvert raid6_la_6 raid6_la_6 6 $vg $lv1
|
||||
_lvconvert raid6_ra_6 raid6_ra_6 6 $vg $lv1
|
||||
_lvconvert raid5_ra raid5_ra 5 $vg $lv1 1
|
||||
_lvconvert raid5_ra raid5_ra 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
else
|
||||
|
@@ -20,7 +20,7 @@ aux raid456_replace_works || skip
|
||||
aux lvmconf 'allocation/maximise_cling = 0' \
|
||||
'allocation/mirror_logs_require_separate_pvs = 1'
|
||||
|
||||
aux prepare_vg 8
|
||||
aux prepare_vg 8 80
|
||||
|
||||
function delay
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ lvchange -an $vg/$lv2 $vg/$lv1 $vg/pool $vg/repair
|
||||
|
||||
# Manual repair steps:
|
||||
# Test swapping - swap out thin-pool's metadata with our repair volume
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
|
||||
lvchange -ay $vg/repair
|
||||
|
||||
@@ -74,7 +74,7 @@ not "$LVM_TEST_THIN_DUMP_CMD" "$DM_DEV_DIR/$vg/repair" | tee dump
|
||||
lvchange -an $vg
|
||||
|
||||
# Swap repaired metadata back
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/fixed $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
|
||||
|
||||
# Check pool still preserves its original settings
|
||||
check lv_field $vg/pool chunksize "128.00k"
|
||||
@@ -87,7 +87,7 @@ vgchange -ay $vg
|
||||
vgchange -an $vg
|
||||
|
||||
# Put back 'broken' metadata
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
|
||||
# Check --repair usage
|
||||
lvconvert -v --repair $vg/pool
|
||||
@@ -98,7 +98,7 @@ lvchange -ay $vg/pool
|
||||
vgchange -an $vg
|
||||
|
||||
# Restore damaged metadata
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/pool_meta0 $vg/pool
|
||||
lvconvert -y -f --poolmetadata $vg/pool_meta0 --thinpool $vg/pool
|
||||
|
||||
# Check lvremove -ff works even with damaged pool
|
||||
lvremove -ff $vg
|
||||
|
@@ -30,8 +30,8 @@ aux wait_for_sync $vg $lv2
|
||||
lvchange -an $vg/$lv1
|
||||
|
||||
# conversion fails for internal volumes
|
||||
not lvconvert --thinpool $vg/${lv1}_rimage_0
|
||||
not lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0
|
||||
invalid lvconvert --thinpool $vg/${lv1}_rimage_0
|
||||
invalid lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0
|
||||
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
|
@@ -58,13 +58,13 @@ lvchange -an $vg/$lv1
|
||||
# conversion fails for mirror segment type
|
||||
fail lvconvert --thinpool $vg/$lv1
|
||||
# cannot use same LV
|
||||
not lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2
|
||||
|
||||
prepare_lvs
|
||||
|
||||
# conversion fails for internal volumes
|
||||
# can't use --readahead with --poolmetadata
|
||||
not lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512
|
||||
invalid lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
prepare_lvs
|
||||
@@ -81,9 +81,9 @@ grep "Pool zeroing and large" err
|
||||
UUID=$(get lv_field $vg/$lv2 uuid)
|
||||
# Fail is pool is active
|
||||
# TODO maybe detect inactive pool and deactivate
|
||||
fail lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1
|
||||
fail lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2
|
||||
lvchange -an $vg
|
||||
lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1
|
||||
lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2
|
||||
check lv_field $vg/${lv1}_tmeta uuid "$UUID"
|
||||
lvremove -f $vg
|
||||
|
||||
@@ -96,20 +96,20 @@ lvcreate -L1M -n $lv3 $vg
|
||||
# chunk size is bigger then size of thin pool data
|
||||
fail lvconvert --yes -c 1G --thinpool $vg/$lv3
|
||||
# stripes can't be used with poolmetadata
|
||||
not lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# too small metadata (<2M)
|
||||
fail lvconvert --yes -c 64 --thinpool $vg/$lv1 --poolmetadata $vg/$lv3
|
||||
# too small chunk size fails
|
||||
not lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# too big chunk size fails
|
||||
not lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# negative chunk size fails
|
||||
not lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
# non multiple of 64KiB fails
|
||||
not lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
invalid lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
|
||||
|
||||
# cannot use same LV for pool and convertion
|
||||
not lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3
|
||||
invalid lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3
|
||||
|
||||
# Warning about smaller then suggested
|
||||
lvconvert --yes -c 256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 2>&1 | tee err
|
||||
@@ -129,7 +129,7 @@ if test "$TSIZE" = 64T; then
|
||||
lvcreate -L24T -n $lv1 $vg
|
||||
# Warning about bigger then needed (24T data and 16G -> 128K chunk)
|
||||
lvconvert --yes -c 64 --thinpool $vg/$lv1 2>&1 | tee err
|
||||
grep "too small" err
|
||||
grep "WARNING: Chunk size is too small" err
|
||||
lvremove -f $vg
|
||||
fi
|
||||
|
||||
|
@@ -56,7 +56,7 @@ fail lvcreate -l 1 --cachepool pool8 $vg
|
||||
|
||||
# no size specified
|
||||
invalid lvcreate --cachepool pool $vg 2>&1 | tee err
|
||||
# grep "specify either size or extents" err
|
||||
grep "specify either size or extents" err
|
||||
|
||||
# Check nothing has been created yet
|
||||
check vg_field $vg lv_count 0
|
||||
|
@@ -38,7 +38,7 @@ lvchange -an $vg
|
||||
|
||||
lvcreate -L2M -n $lv1 $vg
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
# Cannot resize if set to 0%
|
||||
not lvextend --use-policies --config 'activation{thin_pool_autoextend_percent = 0}' $vg/pool 2>&1 | tee err
|
||||
|
@@ -78,7 +78,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
# Not alllowed when thin-pool metadata free space is <75% for 2M meta
|
||||
fail lvcreate -V20 $vg/pool
|
||||
@@ -91,7 +91,7 @@ lvchange -an $vg/pool
|
||||
fake_metadata_ 7400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2"
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv2 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2
|
||||
lvchange -ay $vg/pool
|
||||
# Check generated metadata consume more then 88%
|
||||
test "$(meta_percent_)" -gt "88"
|
||||
@@ -138,7 +138,7 @@ lvchange -an $vg/thin $vg/thin2 $vg/pool
|
||||
# Transaction_id is lower by 1 and there are no messages -> ERROR
|
||||
fake_metadata_ 10 0 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@@ -147,7 +147,7 @@ check inactive $vg pool_tmeta
|
||||
# Transaction_id is higher by 1
|
||||
fake_metadata_ 10 3 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@@ -158,7 +158,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
vgchange -ay $vg
|
||||
|
||||
@@ -173,7 +173,7 @@ fake_metadata_ 350 2 >data
|
||||
lvchange -ay $vg/$lv1
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvchange -ay $vg/pool $vg/$lv1
|
||||
lvs -a $vg
|
||||
|
||||
|
@@ -54,7 +54,7 @@ mkdir test_mnt
|
||||
|
||||
setup_merge_ $vg1 $lv1
|
||||
mount "$(lvdev_ $vg1 $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg1/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg1/$(snap_lv_name_ $lv1)
|
||||
umount test_mnt
|
||||
vgchange -an $vg1
|
||||
|
||||
|
@@ -16,8 +16,8 @@ SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
aux have_raid 1 3 0 || skip
|
||||
|
||||
levels="5 6"
|
||||
aux have_raid4 && levels="4 5 6"
|
||||
levels="5 6 10"
|
||||
aux have_raid4 && levels="0 0_meta 4 $levels"
|
||||
|
||||
aux prepare_pvs 6 80
|
||||
|
||||
@@ -39,9 +39,10 @@ for deactivate in true false; do
|
||||
|
||||
#check raid_images_contiguous $vg $lv1
|
||||
|
||||
# Extend and reduce 3-striped RAID 4/5/6
|
||||
# Extend and reduce 3-striped RAID 4/5/6/10
|
||||
for i in $levels ; do
|
||||
lvcreate --type raid$i -i 3 -l 3 -n $lv2 $vg
|
||||
check lv_field $vg/$lv2 "seg_size" "768.00k"
|
||||
|
||||
test $deactivate && {
|
||||
aux wait_for_sync $vg $lv2
|
||||
@@ -49,10 +50,12 @@ for deactivate in true false; do
|
||||
}
|
||||
|
||||
lvresize -l +3 $vg/$lv2
|
||||
check lv_field $vg/$lv2 "seg_size" "1.50m"
|
||||
|
||||
#check raid_images_contiguous $vg $lv1
|
||||
|
||||
should lvresize -y -l -3 $vg/$lv2
|
||||
should check lv_field $vg/$lv2 "seg_size" "768.00k"
|
||||
|
||||
#check raid_images_contiguous $vg $lv1
|
||||
|
||||
|
@@ -32,7 +32,7 @@ snap_and_merge() {
|
||||
SLEEP_PID=$(aux hold_device_open $vg $lv1 20)
|
||||
|
||||
# initiate background merge
|
||||
lvconvert -b --mergesnapshot $vg/$lv2
|
||||
lvconvert -b --merge $vg/$lv2
|
||||
|
||||
lvs -a -o+lv_merging,lv_merge_failed $vg
|
||||
get lv_field $vg/$lv1 lv_attr | grep "Owi-ao"
|
||||
|
@@ -51,15 +51,15 @@ mkdir test_mnt
|
||||
# test full merge of a single LV
|
||||
setup_merge_ $vg $lv1
|
||||
|
||||
# make sure lvconvert --mergesnapshot requires explicit LV listing
|
||||
not lvconvert --mergesnapshot
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
# make sure lvconvert --merge requires explicit LV listing
|
||||
not lvconvert --merge
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
|
||||
# test that an actively merging snapshot may not be removed
|
||||
setup_merge_ $vg $lv1
|
||||
lvconvert -i+100 --mergesnapshot --background $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert -i+100 --merge --background $vg/$(snap_lv_name_ $lv1)
|
||||
not lvremove -f $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
@@ -67,7 +67,7 @@ lvremove -f $vg/$lv1
|
||||
# "onactivate merge" test
|
||||
setup_merge_ $vg $lv1
|
||||
mount "$(lvdev_ $vg $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
# -- refresh LV while FS is still mounted (merge must not start),
|
||||
# verify 'snapshot-origin' target is still being used
|
||||
lvchange --refresh $vg/$lv1
|
||||
@@ -88,7 +88,7 @@ lvremove -f $vg/$lv1
|
||||
# to make sure preload of origin's metadata is _not_ performed
|
||||
setup_merge_ $vg $lv1
|
||||
mount "$(lvdev_ $vg $lv1)" test_mnt
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
# -- refresh LV while FS is still mounted (merge must not start),
|
||||
# verify 'snapshot-origin' target is still being used
|
||||
lvchange --refresh $vg/$lv1
|
||||
@@ -99,7 +99,7 @@ lvremove -f $vg/$lv1
|
||||
|
||||
# test multiple snapshot merge; tests copy out that is driven by merge
|
||||
setup_merge_ $vg $lv1 1
|
||||
lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1)
|
||||
lvconvert --merge $vg/$(snap_lv_name_ $lv1)
|
||||
lvremove -f $vg/$lv1
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ setup_merge_ $vg $lv1
|
||||
setup_merge_ $vg $lv2
|
||||
lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv1)
|
||||
lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv2)
|
||||
lvconvert --mergesnapshot @this_is_a_test
|
||||
lvconvert --merge @this_is_a_test
|
||||
lvs $vg | tee out
|
||||
not grep $(snap_lv_name_ $lv1) out
|
||||
not grep $(snap_lv_name_ $lv2) out
|
||||
|
@@ -71,7 +71,7 @@ aux prepare_thin_metadata 490 1 | tee data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
|
||||
lvchange -ay $vg
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user