xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-support/lvm2/files/lvm.conf (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# This is an example configuration file for the LVM2 system.
2*4882a593Smuzhiyun# It contains the default settings that would be used if there was no
3*4882a593Smuzhiyun# /etc/lvm/lvm.conf file.
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun# Refer to 'man lvm.conf' for further information including the file layout.
6*4882a593Smuzhiyun#
7*4882a593Smuzhiyun# To put this file in a different directory and override /etc/lvm set
8*4882a593Smuzhiyun# the environment variable LVM_SYSTEM_DIR before running the tools.
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun# This section allows you to configure which block devices should
12*4882a593Smuzhiyun# be used by the LVM system.
13*4882a593Smuzhiyundevices {
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun    # Where do you want your volume groups to appear ?
16*4882a593Smuzhiyun    dir = "/dev"
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    # An array of directories that contain the device nodes you wish
19*4882a593Smuzhiyun    # to use with LVM2.
20*4882a593Smuzhiyun    scan = [ "/dev" ]
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun    # A filter that tells LVM2 to only use a restricted set of devices.
23*4882a593Smuzhiyun    # The filter consists of an array of regular expressions.  These
24*4882a593Smuzhiyun    # expressions can be delimited by a character of your choice, and
25*4882a593Smuzhiyun    # prefixed with either an 'a' (for accept) or 'r' (for reject).
26*4882a593Smuzhiyun    # The first expression found to match a device name determines if
27*4882a593Smuzhiyun    # the device will be accepted or rejected (ignored).  Devices that
28*4882a593Smuzhiyun    # don't match any patterns are accepted.
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun    # Be careful if there there are symbolic links or multiple filesystem
31*4882a593Smuzhiyun    # entries for the same device as each name is checked separately against
32*4882a593Smuzhiyun    # the list of patterns.  The effect is that if any name matches any 'a'
33*4882a593Smuzhiyun    # pattern, the device is accepted; otherwise if any name matches any 'r'
34*4882a593Smuzhiyun    # pattern it is rejected; otherwise it is accepted.
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun    # Don't have more than one filter line active at once: only one gets used.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun    # Run vgscan after you change this parameter to ensure that
39*4882a593Smuzhiyun    # the cache file gets regenerated (see below).
40*4882a593Smuzhiyun    # If it doesn't do what you expect, check the output of 'vgscan -vvvv'.
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun    # By default we accept every block device:
44*4882a593Smuzhiyun    filter = [ "a/.*/" ]
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun    # Exclude the cdrom drive
47*4882a593Smuzhiyun    # filter = [ "r|/dev/cdrom|" ]
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun    # When testing I like to work with just loopback devices:
50*4882a593Smuzhiyun    # filter = [ "a/loop/", "r/.*/" ]
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    # Or maybe all loops and ide drives except hdc:
53*4882a593Smuzhiyun    # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun    # Use anchors if you want to be really specific
56*4882a593Smuzhiyun    # filter = [ "a|^/dev/hda8$|", "r/.*/" ]
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    # The results of the filtering are cached on disk to avoid
59*4882a593Smuzhiyun    # rescanning dud devices (which can take a very long time).  By
60*4882a593Smuzhiyun    # default this cache file is hidden in the /etc/lvm directory.
61*4882a593Smuzhiyun    # It is safe to delete this file: the tools regenerate it.
62*4882a593Smuzhiyun    cache = "/etc/lvm/.cache"
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun    # You can turn off writing this cache file by setting this to 0.
65*4882a593Smuzhiyun    write_cache_state = 1
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun    # Advanced settings.
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun    # List of pairs of additional acceptable block device types found
70*4882a593Smuzhiyun    # in /proc/devices with maximum (non-zero) number of partitions.
71*4882a593Smuzhiyun    # types = [ "fd", 16 ]
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun    # If sysfs is mounted (2.6 kernels) restrict device scanning to
74*4882a593Smuzhiyun    # the block devices it believes are valid.
75*4882a593Smuzhiyun    # 1 enables; 0 disables.
76*4882a593Smuzhiyun    sysfs_scan = 1
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun    # By default, LVM2 will ignore devices used as components of
79*4882a593Smuzhiyun    # software RAID (md) devices by looking for md superblocks.
80*4882a593Smuzhiyun    # 1 enables; 0 disables.
81*4882a593Smuzhiyun    md_component_detection = 1
82*4882a593Smuzhiyun}
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun# This section that allows you to configure the nature of the
85*4882a593Smuzhiyun# information that LVM2 reports.
86*4882a593Smuzhiyunlog {
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun    # Controls the messages sent to stdout or stderr.
89*4882a593Smuzhiyun    # There are three levels of verbosity, 3 being the most verbose.
90*4882a593Smuzhiyun    verbose = 0
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun    # Should we send log messages through syslog?
93*4882a593Smuzhiyun    # 1 is yes; 0 is no.
94*4882a593Smuzhiyun    syslog = 1
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun    # Should we log error and debug messages to a file?
97*4882a593Smuzhiyun    # By default there is no log file.
98*4882a593Smuzhiyun    #file = "/var/log/lvm2.log"
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun    # Should we overwrite the log file each time the program is run?
101*4882a593Smuzhiyun    # By default we append.
102*4882a593Smuzhiyun    overwrite = 0
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun    # What level of log messages should we send to the log file and/or syslog?
105*4882a593Smuzhiyun    # There are 6 syslog-like log levels currently in use - 2 to 7 inclusive.
106*4882a593Smuzhiyun    # 7 is the most verbose (LOG_DEBUG).
107*4882a593Smuzhiyun    level = 0
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun    # Format of output messages
110*4882a593Smuzhiyun    # Whether or not (1 or 0) to indent messages according to their severity
111*4882a593Smuzhiyun    indent = 1
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun    # Whether or not (1 or 0) to display the command name on each line output
114*4882a593Smuzhiyun    command_names = 0
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun    # A prefix to use before the message text (but after the command name,
117*4882a593Smuzhiyun    # if selected).  Default is two spaces, so you can see/grep the severity
118*4882a593Smuzhiyun    # of each message.
119*4882a593Smuzhiyun    prefix = "  "
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun    # To make the messages look similar to the original LVM tools use:
122*4882a593Smuzhiyun    #   indent = 0
123*4882a593Smuzhiyun    #   command_names = 1
124*4882a593Smuzhiyun    #   prefix = " -- "
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun    # Set this if you want log messages during activation.
127*4882a593Smuzhiyun    # Don't use this in low memory situations (can deadlock).
128*4882a593Smuzhiyun    # activation = 0
129*4882a593Smuzhiyun}
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun# Configuration of metadata backups and archiving.  In LVM2 when we
132*4882a593Smuzhiyun# talk about a 'backup' we mean making a copy of the metadata for the
133*4882a593Smuzhiyun# *current* system.  The 'archive' contains old metadata configurations.
134*4882a593Smuzhiyun# Backups are stored in a human readeable text format.
135*4882a593Smuzhiyunbackup {
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun    # Should we maintain a backup of the current metadata configuration ?
138*4882a593Smuzhiyun    # Use 1 for Yes; 0 for No.
139*4882a593Smuzhiyun    # Think very hard before turning this off!
140*4882a593Smuzhiyun    backup = 1
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun    # Where shall we keep it ?
143*4882a593Smuzhiyun    # Remember to back up this directory regularly!
144*4882a593Smuzhiyun    backup_dir = "/etc/lvm/backup"
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun    # Should we maintain an archive of old metadata configurations.
147*4882a593Smuzhiyun    # Use 1 for Yes; 0 for No.
148*4882a593Smuzhiyun    # On by default.  Think very hard before turning this off.
149*4882a593Smuzhiyun    archive = 1
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun    # Where should archived files go ?
152*4882a593Smuzhiyun    # Remember to back up this directory regularly!
153*4882a593Smuzhiyun    archive_dir = "/etc/lvm/archive"
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun    # What is the minimum number of archive files you wish to keep ?
156*4882a593Smuzhiyun    retain_min = 10
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun    # What is the minimum time you wish to keep an archive file for ?
159*4882a593Smuzhiyun    retain_days = 30
160*4882a593Smuzhiyun}
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun# Settings for the running LVM2 in shell (readline) mode.
163*4882a593Smuzhiyunshell {
164*4882a593Smuzhiyun
165*4882a593Smuzhiyun    # Number of lines of history to store in ~/.lvm_history
166*4882a593Smuzhiyun    history_size = 100
167*4882a593Smuzhiyun}
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun# Miscellaneous global LVM2 settings
171*4882a593Smuzhiyunglobal {
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun    # The file creation mask for any files and directories created.
174*4882a593Smuzhiyun    # Interpreted as octal if the first digit is zero.
175*4882a593Smuzhiyun    umask = 077
176*4882a593Smuzhiyun
177*4882a593Smuzhiyun    # Allow other users to read the files
178*4882a593Smuzhiyun    #umask = 022
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun    # Enabling test mode means that no changes to the on disk metadata
181*4882a593Smuzhiyun    # will be made.  Equivalent to having the -t option on every
182*4882a593Smuzhiyun    # command.  Defaults to off.
183*4882a593Smuzhiyun    test = 0
184*4882a593Smuzhiyun
185*4882a593Smuzhiyun    # Whether or not to communicate with the kernel device-mapper.
186*4882a593Smuzhiyun    # Set to 0 if you want to use the tools to manipulate LVM metadata
187*4882a593Smuzhiyun    # without activating any logical volumes.
188*4882a593Smuzhiyun    # If the device-mapper kernel driver is not present in your kernel
189*4882a593Smuzhiyun    # setting this to 0 should suppress the error messages.
190*4882a593Smuzhiyun    activation = 1
191*4882a593Smuzhiyun
192*4882a593Smuzhiyun    # If we can't communicate with device-mapper, should we try running
193*4882a593Smuzhiyun    # the LVM1 tools?
194*4882a593Smuzhiyun    # This option only applies to 2.4 kernels and is provided to help you
195*4882a593Smuzhiyun    # switch between device-mapper kernels and LVM1 kernels.
196*4882a593Smuzhiyun    # The LVM1 tools need to be installed with .lvm1 suffices
197*4882a593Smuzhiyun    # e.g. vgscan.lvm1 and they will stop working after you start using
198*4882a593Smuzhiyun    # the new lvm2 on-disk metadata format.
199*4882a593Smuzhiyun    # The default value is set when the tools are built.
200*4882a593Smuzhiyun    # fallback_to_lvm1 = 0
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun    # The default metadata format that commands should use - "lvm1" or "lvm2".
203*4882a593Smuzhiyun    # The command line override is -M1 or -M2.
204*4882a593Smuzhiyun    # Defaults to "lvm1" if compiled in, else "lvm2".
205*4882a593Smuzhiyun    # format = "lvm1"
206*4882a593Smuzhiyun
207*4882a593Smuzhiyun    # Location of proc filesystem
208*4882a593Smuzhiyun    proc = "/proc"
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun    # Type of locking to use. Defaults to file-based locking (1).
211*4882a593Smuzhiyun    # Turn locking off by setting to 0 (dangerous: risks metadata corruption
212*4882a593Smuzhiyun    # if LVM2 commands get run concurrently).
213*4882a593Smuzhiyun    locking_type = 1
214*4882a593Smuzhiyun
215*4882a593Smuzhiyun    # Local non-LV directory that holds file-based locks while commands are
216*4882a593Smuzhiyun    # in progress.  A directory like /tmp that may get wiped on reboot is OK.
217*4882a593Smuzhiyun    locking_dir = "/tmp/lock/lvm"
218*4882a593Smuzhiyun
219*4882a593Smuzhiyun    # Other entries can go here to allow you to load shared libraries
220*4882a593Smuzhiyun    # e.g. if support for LVM1 metadata was compiled as a shared library use
221*4882a593Smuzhiyun    #   format_libraries = "liblvm2format1.so"
222*4882a593Smuzhiyun    # Full pathnames can be given.
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun    # Search this directory first for shared libraries.
225*4882a593Smuzhiyun    #   library_dir = "/lib"
226*4882a593Smuzhiyun}
227*4882a593Smuzhiyun
228*4882a593Smuzhiyunactivation {
229*4882a593Smuzhiyun    # Device used in place of missing stripes if activating incomplete volume.
230*4882a593Smuzhiyun    # For now, you need to set this up yourself first (e.g. with 'dmsetup')
231*4882a593Smuzhiyun    # For example, you could make it return I/O errors using the 'error'
232*4882a593Smuzhiyun    # target or make it return zeros.
233*4882a593Smuzhiyun    missing_stripe_filler = "/dev/ioerror"
234*4882a593Smuzhiyun
235*4882a593Smuzhiyun    # Size (in KB) of each copy operation when mirroring
236*4882a593Smuzhiyun    mirror_region_size = 512
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun    # How much stack (in KB) to reserve for use while devices suspended
239*4882a593Smuzhiyun    reserved_stack = 256
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun    # How much memory (in KB) to reserve for use while devices suspended
242*4882a593Smuzhiyun    reserved_memory = 8192
243*4882a593Smuzhiyun
244*4882a593Smuzhiyun    # Nice value used while devices suspended
245*4882a593Smuzhiyun    process_priority = -18
246*4882a593Smuzhiyun
247*4882a593Smuzhiyun    # If volume_list is defined, each LV is only activated if there is a
248*4882a593Smuzhiyun    # match against the list.
249*4882a593Smuzhiyun    #   "vgname" and "vgname/lvname" are matched exactly.
250*4882a593Smuzhiyun    #   "@tag" matches any tag set in the LV or VG.
251*4882a593Smuzhiyun    #   "@*" matches if any tag defined on the host is also set in the LV or VG
252*4882a593Smuzhiyun    #
253*4882a593Smuzhiyun    # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
254*4882a593Smuzhiyun}
255*4882a593Smuzhiyun
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun####################
258*4882a593Smuzhiyun# Advanced section #
259*4882a593Smuzhiyun####################
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun# Metadata settings
262*4882a593Smuzhiyun#
263*4882a593Smuzhiyun# metadata {
264*4882a593Smuzhiyun    # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
265*4882a593Smuzhiyun    # You might want to override it from the command line with 0
266*4882a593Smuzhiyun    # when running pvcreate on new PVs which are to be added to large VGs.
267*4882a593Smuzhiyun
268*4882a593Smuzhiyun    # pvmetadatacopies = 1
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun    # Approximate default size of on-disk metadata areas in sectors.
271*4882a593Smuzhiyun    # You should increase this if you have large volume groups or
272*4882a593Smuzhiyun    # you want to retain a large on-disk history of your metadata changes.
273*4882a593Smuzhiyun
274*4882a593Smuzhiyun    # pvmetadatasize = 255
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun    # List of directories holding live copies of text format metadata.
277*4882a593Smuzhiyun    # These directories must not be on logical volumes!
278*4882a593Smuzhiyun    # It's possible to use LVM2 with a couple of directories here,
279*4882a593Smuzhiyun    # preferably on different (non-LV) filesystems, and with no other
280*4882a593Smuzhiyun    # on-disk metadata (pvmetadatacopies = 0). Or this can be in
281*4882a593Smuzhiyun    # addition to on-disk metadata areas.
282*4882a593Smuzhiyun    # The feature was originally added to simplify testing and is not
283*4882a593Smuzhiyun    # supported under low memory situations - the machine could lock up.
284*4882a593Smuzhiyun    #
285*4882a593Smuzhiyun    # Never edit any files in these directories by hand unless you
286*4882a593Smuzhiyun    # you are absolutely sure you know what you are doing! Use
287*4882a593Smuzhiyun    # the supplied toolset to make changes (e.g. vgcfgrestore).
288*4882a593Smuzhiyun
289*4882a593Smuzhiyun    # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
290*4882a593Smuzhiyun#}
291*4882a593Smuzhiyun
292*4882a593Smuzhiyun# Event daemon
293*4882a593Smuzhiyun#
294*4882a593Smuzhiyundmeventd {
295*4882a593Smuzhiyun    # mirror_library is the library used when monitoring a mirror device.
296*4882a593Smuzhiyun    #
297*4882a593Smuzhiyun    # "libdevmapper-event-lvm2mirror.so" attempts to recover from
298*4882a593Smuzhiyun    # failures.  It removes failed devices from a volume group and
299*4882a593Smuzhiyun    # reconfigures a mirror as necessary. If no mirror library is
300*4882a593Smuzhiyun    # provided, mirrors are not monitored through dmeventd.
301*4882a593Smuzhiyun
302*4882a593Smuzhiyun    mirror_library = "@libdir@/device-mapper/libdevmapper-event-lvm2mirror.so"
303*4882a593Smuzhiyun
304*4882a593Smuzhiyun    # snapshot_library is the library used when monitoring a snapshot device.
305*4882a593Smuzhiyun    #
306*4882a593Smuzhiyun    # "libdevmapper-event-lvm2snapshot.so" monitors the filling of
307*4882a593Smuzhiyun    # snapshots and emits a warning through syslog when the use of
308*4882a593Smuzhiyun    # the snapshot exceeds 80%. The warning is repeated when 85%, 90% and
309*4882a593Smuzhiyun    # 95% of the snapshot is filled.
310*4882a593Smuzhiyun
311*4882a593Smuzhiyun    snapshot_library = "@libdir@/device-mapper/libdevmapper-event-lvm2snapshot.so"
312*4882a593Smuzhiyun
313*4882a593Smuzhiyun    # thin_library is the library used when monitoring a thin device.
314*4882a593Smuzhiyun    #
315*4882a593Smuzhiyun    # "libdevmapper-event-lvm2thin.so" monitors the filling of
316*4882a593Smuzhiyun    # pool and emits a warning through syslog when the use of
317*4882a593Smuzhiyun    # the pool exceeds 80%. The warning is repeated when 85%, 90% and
318*4882a593Smuzhiyun    # 95% of the pool is filled.
319*4882a593Smuzhiyun
320*4882a593Smuzhiyun    thin_library = "@libdir@/device-mapper/libdevmapper-event-lvm2thin.so"
321*4882a593Smuzhiyun
322*4882a593Smuzhiyun    # Full path of the dmeventd binary.
323*4882a593Smuzhiyun    #
324*4882a593Smuzhiyun    # executable = "@DMEVENTD_PATH@"
325*4882a593Smuzhiyun}
326*4882a593Smuzhiyun
327