From 2c56f60db49d6af15c0f51d735d4047d8ce254ff Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 28 Apr 2011 17:33:34 +0000 Subject: Set pv_min_size to 2048KB to exclude floppy drives. Previously was 512. --- doc/example.conf.in | 16 +++++++++++----- lib/commands/toolcontext.c | 2 +- lib/config/defaults.h | 1 + lib/misc/lvm-globals.h | 1 - 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/example.conf.in b/doc/example.conf.in index ff7ef9de..3682b5e3 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -6,6 +6,9 @@ # # To put this file in a different directory and override @DEFAULT_SYS_DIR@ set # the environment variable LVM_SYSTEM_DIR before running the tools. +# +# N.B. Take care that each setting only appears once if uncommenting +# example settings in this file. # This section allows you to configure which block devices should @@ -155,12 +158,15 @@ devices { # Allow use of pvcreate --uuid without requiring --restorefile. require_restorefile_with_uuid = 1 - # Minimal size (in KB) of the block device which can be used as a PV. - # In clustered environment all nodes have to use the same value. + # Minimum size (in KB) of block devices which can be used as PVs. + # In a clustered environment all nodes must use the same value. # Any value smaller than 512KB is ignored. - # Example: Ignore devices smaller than 2MB (i.e. floppy drives). - # pv_min_size = 2048 - pv_min_size = 512 + + # Ignore devices smaller than 2MB such as floppy drives. + pv_min_size = 2048 + + # The original built-in setting was 512 up to and including version 2.02.84. + # pv_min_size = 512 # Issue discards to a logical volumes's underlying physical volume(s) when # the logical volume is no longer using the physical volumes' space (e.g. diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 67a7771c..8b020d1a 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -325,7 +325,7 @@ static int _process_config(struct cmd_context *cmd) pv_min_kb, DEFAULT_PV_MIN_SIZE_KB); pv_min_kb = DEFAULT_PV_MIN_SIZE_KB; } - /* lvm internally works with device size in 512b sectors */ + /* LVM stores sizes internally in units of 512-byte sectors. */ init_pv_min_size((uint64_t)pv_min_kb * (1024 >> SECTOR_SHIFT)); return 1; diff --git a/lib/config/defaults.h b/lib/config/defaults.h index 8cfcc2ed..452de3d9 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -39,6 +39,7 @@ #define DEFAULT_DATA_ALIGNMENT_OFFSET_DETECTION 1 #define DEFAULT_DATA_ALIGNMENT_DETECTION 1 #define DEFAULT_ISSUE_DISCARDS 0 +#define DEFAULT_PV_MIN_SIZE_KB 2048 #define DEFAULT_LOCKING_LIB "liblvm2clusterlock.so" #define DEFAULT_FALLBACK_TO_LOCAL_LOCKING 1 diff --git a/lib/misc/lvm-globals.h b/lib/misc/lvm-globals.h index 6694da65..7cfd9723 100644 --- a/lib/misc/lvm-globals.h +++ b/lib/misc/lvm-globals.h @@ -18,7 +18,6 @@ #define VERBOSE_BASE_LEVEL _LOG_WARN #define SECURITY_LEVEL 0 -#define DEFAULT_PV_MIN_SIZE_KB 512 /* 512 KB */ void init_verbose(int level); void init_test(int level); -- cgit