xref: /dragonfly/contrib/lvm2/dist/doc/example.conf (revision 0db87cb7)
1# This is an example configuration file for the LVM2 system.
2# It contains the default settings that would be used if there was no
3# /etc/lvm/lvm.conf file.
4#
5# Refer to 'man lvm.conf' for further information including the file layout.
6#
7# To put this file in a different directory and override /etc/lvm set
8# the environment variable LVM_SYSTEM_DIR before running the tools.
9
10
11# This section allows you to configure which block devices should
12# be used by the LVM system.
13devices {
14
15    # Where do you want your volume groups to appear ?
16    dir = "/dev"
17
18    # An array of directories that contain the device nodes you wish
19    # to use with LVM2.
20    scan = [ "/dev" ]
21
22    # If several entries in the scanned directories correspond to the
23    # same block device and the tools need to display a name for device,
24    # all the pathnames are matched against each item in the following
25    # list of regular expressions in turn and the first match is used.
26    preferred_names = [ ]
27
28    # Try to avoid using undescriptive /dev/dm-N names, if present.
29    # preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
30
31    # A filter that tells LVM2 to only use a restricted set of devices.
32    # The filter consists of an array of regular expressions.  These
33    # expressions can be delimited by a character of your choice, and
34    # prefixed with either an 'a' (for accept) or 'r' (for reject).
35    # The first expression found to match a device name determines if
36    # the device will be accepted or rejected (ignored).  Devices that
37    # don't match any patterns are accepted.
38
39    # Be careful if there there are symbolic links or multiple filesystem
40    # entries for the same device as each name is checked separately against
41    # the list of patterns.  The effect is that if any name matches any 'a'
42    # pattern, the device is accepted; otherwise if any name matches any 'r'
43    # pattern it is rejected; otherwise it is accepted.
44
45    # Don't have more than one filter line active at once: only one gets used.
46
47    # Run vgscan after you change this parameter to ensure that
48    # the cache file gets regenerated (see below).
49    # If it doesn't do what you expect, check the output of 'vgscan -vvvv'.
50
51
52    # By default we accept every block device:
53    filter = [ "a/.*/" ]
54
55    # Exclude the cdrom drive
56    # filter = [ "r|/dev/cdrom|" ]
57
58    # When testing I like to work with just loopback devices:
59    # filter = [ "a/loop/", "r/.*/" ]
60
61    # Or maybe all loops and ide drives except hdc:
62    # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]
63
64    # Use anchors if you want to be really specific
65    # filter = [ "a|^/dev/hda8$|", "r/.*/" ]
66
67    # The results of the filtering are cached on disk to avoid
68    # rescanning dud devices (which can take a very long time).
69    # By default this cache is stored in the /etc/lvm/cache directory
70    # in a file called '.cache'.
71    # It is safe to delete the contents: the tools regenerate it.
72    # (The old setting 'cache' is still respected if neither of
73    # these new ones is present.)
74    cache_dir = "/etc/lvm/cache"
75    cache_file_prefix = ""
76
77    # You can turn off writing this cache file by setting this to 0.
78    write_cache_state = 1
79
80    # Advanced settings.
81
82    # List of pairs of additional acceptable block device types found
83    # in /proc/devices with maximum (non-zero) number of partitions.
84    # types = [ "fd", 16 ]
85
86    # If sysfs is mounted (2.6 kernels) restrict device scanning to
87    # the block devices it believes are valid.
88    # 1 enables; 0 disables.
89    sysfs_scan = 1
90
91    # By default, LVM2 will ignore devices used as components of
92    # software RAID (md) devices by looking for md superblocks.
93    # 1 enables; 0 disables.
94    md_component_detection = 1
95
96    # By default, if a PV is placed directly upon an md device, LVM2
97    # will align its data blocks with the md device's stripe-width.
98    # 1 enables; 0 disables.
99    md_chunk_alignment = 1
100
101    # By default, the start of a PV's data area will be a multiple of
102    # the 'minimum_io_size' or 'optimal_io_size' exposed in sysfs.
103    # - minimum_io_size - the smallest request the device can perform
104    #   w/o incurring a read-modify-write penalty (e.g. MD's chunk size)
105    # - optimal_io_size - the device's preferred unit of receiving I/O
106    #   (e.g. MD's stripe width)
107    # minimum_io_size is used if optimal_io_size is undefined (0).
108    # If md_chunk_alignment is enabled, that detects the optimal_io_size.
109    # This setting takes precedence over md_chunk_alignment.
110    # 1 enables; 0 disables.
111    data_alignment_detection = 1
112
113    # Alignment (in KB) of start of data area when creating a new PV.
114    # If a PV is placed directly upon an md device and md_chunk_alignment or
115    # data_alignment_detection is enabled this parameter is ignored.
116    # Set to 0 for the default alignment of 64KB or page size, if larger.
117    data_alignment = 0
118
119    # By default, the start of the PV's aligned data area will be shifted by
120    # the 'alignment_offset' exposed in sysfs.  This offset is often 0 but
121    # may be non-zero; e.g.: certain 4KB sector drives that compensate for
122    # windows partitioning will have an alignment_offset of 3584 bytes
123    # (sector 7 is the lowest aligned logical block, the 4KB sectors start
124    # at LBA -1, and consequently sector 63 is aligned on a 4KB boundary).
125    # 1 enables; 0 disables.
126    data_alignment_offset_detection = 1
127
128    # If, while scanning the system for PVs, LVM2 encounters a device-mapper
129    # device that has its I/O suspended, it waits for it to become accessible.
130    # Set this to 1 to skip such devices.  This should only be needed
131    # in recovery situations.
132    ignore_suspended_devices = 0
133}
134
135# This section that allows you to configure the nature of the
136# information that LVM2 reports.
137log {
138
139    # Controls the messages sent to stdout or stderr.
140    # There are three levels of verbosity, 3 being the most verbose.
141    verbose = 0
142
143    # Should we send log messages through syslog?
144    # 1 is yes; 0 is no.
145    syslog = 1
146
147    # Should we log error and debug messages to a file?
148    # By default there is no log file.
149    #file = "/var/log/lvm2.log"
150
151    # Should we overwrite the log file each time the program is run?
152    # By default we append.
153    overwrite = 0
154
155    # What level of log messages should we send to the log file and/or syslog?
156    # There are 6 syslog-like log levels currently in use - 2 to 7 inclusive.
157    # 7 is the most verbose (LOG_DEBUG).
158    level = 0
159
160    # Format of output messages
161    # Whether or not (1 or 0) to indent messages according to their severity
162    indent = 1
163
164    # Whether or not (1 or 0) to display the command name on each line output
165    command_names = 0
166
167    # A prefix to use before the message text (but after the command name,
168    # if selected).  Default is two spaces, so you can see/grep the severity
169    # of each message.
170    prefix = "  "
171
172    # To make the messages look similar to the original LVM tools use:
173    #   indent = 0
174    #   command_names = 1
175    #   prefix = " -- "
176
177    # Set this if you want log messages during activation.
178    # Don't use this in low memory situations (can deadlock).
179    # activation = 0
180}
181
182# Configuration of metadata backups and archiving.  In LVM2 when we
183# talk about a 'backup' we mean making a copy of the metadata for the
184# *current* system.  The 'archive' contains old metadata configurations.
185# Backups are stored in a human readeable text format.
186backup {
187
188    # Should we maintain a backup of the current metadata configuration ?
189    # Use 1 for Yes; 0 for No.
190    # Think very hard before turning this off!
191    backup = 1
192
193    # Where shall we keep it ?
194    # Remember to back up this directory regularly!
195    backup_dir = "/etc/lvm/backup"
196
197    # Should we maintain an archive of old metadata configurations.
198    # Use 1 for Yes; 0 for No.
199    # On by default.  Think very hard before turning this off.
200    archive = 1
201
202    # Where should archived files go ?
203    # Remember to back up this directory regularly!
204    archive_dir = "/etc/lvm/archive"
205
206    # What is the minimum number of archive files you wish to keep ?
207    retain_min = 10
208
209    # What is the minimum time you wish to keep an archive file for ?
210    retain_days = 30
211}
212
213# Settings for the running LVM2 in shell (readline) mode.
214shell {
215
216    # Number of lines of history to store in ~/.lvm_history
217    history_size = 100
218}
219
220
221# Miscellaneous global LVM2 settings
222global {
223
224    # The file creation mask for any files and directories created.
225    # Interpreted as octal if the first digit is zero.
226    umask = 077
227
228    # Allow other users to read the files
229    #umask = 022
230
231    # Enabling test mode means that no changes to the on disk metadata
232    # will be made.  Equivalent to having the -t option on every
233    # command.  Defaults to off.
234    test = 0
235
236    # Default value for --units argument
237    units = "h"
238
239    # Since version 2.02.54, the tools distinguish between powers of
240    # 1024 bytes (e.g. KiB, MiB, GiB) and powers of 1000 bytes (e.g.
241    # KB, MB, GB).
242    # If you have scripts that depend on the old behaviour, set this to 0
243    # temporarily until you update them.
244    si_unit_consistency = 1
245
246    # Whether or not to communicate with the kernel device-mapper.
247    # Set to 0 if you want to use the tools to manipulate LVM metadata
248    # without activating any logical volumes.
249    # If the device-mapper kernel driver is not present in your kernel
250    # setting this to 0 should suppress the error messages.
251    activation = 1
252
253    # If we can't communicate with device-mapper, should we try running
254    # the LVM1 tools?
255    # This option only applies to 2.4 kernels and is provided to help you
256    # switch between device-mapper kernels and LVM1 kernels.
257    # The LVM1 tools need to be installed with .lvm1 suffices
258    # e.g. vgscan.lvm1 and they will stop working after you start using
259    # the new lvm2 on-disk metadata format.
260    # The default value is set when the tools are built.
261    # fallback_to_lvm1 = 0
262
263    # The default metadata format that commands should use - "lvm1" or "lvm2".
264    # The command line override is -M1 or -M2.
265    # Defaults to "lvm2".
266    # format = "lvm2"
267
268    # Location of proc filesystem
269    proc = "/proc"
270
271    # Type of locking to use. Defaults to local file-based locking (1).
272    # Turn locking off by setting to 0 (dangerous: risks metadata corruption
273    # if LVM2 commands get run concurrently).
274    # Type 2 uses the external shared library locking_library.
275    # Type 3 uses built-in clustered locking.
276    # Type 4 uses read-only locking which forbids any operations that might
277    # change metadata.
278    locking_type = 1
279
280    # Set to 0 to fail when a lock request cannot be satisfied immediately.
281    wait_for_locks = 1
282
283    # If using external locking (type 2) and initialisation fails,
284    # with this set to 1 an attempt will be made to use the built-in
285    # clustered locking.
286    # If you are using a customised locking_library you should set this to 0.
287    fallback_to_clustered_locking = 1
288
289    # If an attempt to initialise type 2 or type 3 locking failed, perhaps
290    # because cluster components such as clvmd are not running, with this set
291    # to 1 an attempt will be made to use local file-based locking (type 1).
292    # If this succeeds, only commands against local volume groups will proceed.
293    # Volume Groups marked as clustered will be ignored.
294    fallback_to_local_locking = 1
295
296    # Local non-LV directory that holds file-based locks while commands are
297    # in progress.  A directory like /tmp that may get wiped on reboot is OK.
298    locking_dir = "/var/lock/lvm"
299
300    # Whenever there are competing read-only and read-write access requests for
301    # a volume group's metadata, instead of always granting the read-only
302    # requests immediately, delay them to allow the read-write requests to be
303    # serviced.  Without this setting, write access may be stalled by a high
304    # volume of read-only requests.
305    # NB. This option only affects locking_type = 1 viz. local file-based
306    # locking.
307    prioritise_write_locks = 1
308
309    # Other entries can go here to allow you to load shared libraries
310    # e.g. if support for LVM1 metadata was compiled as a shared library use
311    #   format_libraries = "liblvm2format1.so"
312    # Full pathnames can be given.
313
314    # Search this directory first for shared libraries.
315    #   library_dir = "/lib"
316
317    # The external locking library to load if locking_type is set to 2.
318    #   locking_library = "liblvm2clusterlock.so"
319}
320
321activation {
322    # Set to 0 to disable udev syncronisation (if compiled into the binaries).
323    # Processes will not wait for notification from udev.
324    # They will continue irrespective of any possible udev processing
325    # in the background.  You should only use this if udev is not running
326    # or has rules that ignore the devices LVM2 creates.
327    # The command line argument --nodevsync takes precedence over this setting.
328    # If set to 1 when udev is not running, and there are LVM2 processes
329    # waiting for udev, run 'dmsetup udevcomplete_all' manually to wake them up.
330    udev_sync = 1
331
332    # How to fill in missing stripes if activating an incomplete volume.
333    # Using "error" will make inaccessible parts of the device return
334    # I/O errors on access.  You can instead use a device path, in which
335    # case, that device will be used to in place of missing stripes.
336    # But note that using anything other than "error" with mirrored
337    # or snapshotted volumes is likely to result in data corruption.
338    missing_stripe_filler = "error"
339
340    # How much stack (in KB) to reserve for use while devices suspended
341    reserved_stack = 256
342
343    # How much memory (in KB) to reserve for use while devices suspended
344    reserved_memory = 8192
345
346    # Nice value used while devices suspended
347    process_priority = -18
348
349    # If volume_list is defined, each LV is only activated if there is a
350    # match against the list.
351    #   "vgname" and "vgname/lvname" are matched exactly.
352    #   "@tag" matches any tag set in the LV or VG.
353    #   "@*" matches if any tag defined on the host is also set in the LV or VG
354    #
355    # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
356
357    # Size (in KB) of each copy operation when mirroring
358    mirror_region_size = 512
359
360    # Setting to use when there is no readahead value stored in the metadata.
361    #
362    # "none" - Disable readahead.
363    # "auto" - Use default value chosen by kernel.
364    readahead = "auto"
365
366    # 'mirror_image_fault_policy' and 'mirror_log_fault_policy' define
367    # how a device failure affecting a mirror is handled.
368    # A mirror is composed of mirror images (copies) and a log.
369    # A disk log ensures that a mirror does not need to be re-synced
370    # (all copies made the same) every time a machine reboots or crashes.
371    #
372    # In the event of a failure, the specified policy will be used to determine
373    # what happens. This applies to automatic repairs (when the mirror is being
374    # monitored by dmeventd) and to manual lvconvert --repair when
375    # --use-policies is given.
376    #
377    # "remove" - Simply remove the faulty device and run without it.  If
378    #            the log device fails, the mirror would convert to using
379    #            an in-memory log.  This means the mirror will not
380    #            remember its sync status across crashes/reboots and
381    #            the entire mirror will be re-synced.  If a
382    #            mirror image fails, the mirror will convert to a
383    #            non-mirrored device if there is only one remaining good
384    #            copy.
385    #
386    # "allocate" - Remove the faulty device and try to allocate space on
387    #            a new device to be a replacement for the failed device.
388    #            Using this policy for the log is fast and maintains the
389    #            ability to remember sync state through crashes/reboots.
390    #            Using this policy for a mirror device is slow, as it
391    #            requires the mirror to resynchronize the devices, but it
392    #            will preserve the mirror characteristic of the device.
393    #            This policy acts like "remove" if no suitable device and
394    #            space can be allocated for the replacement.
395    #
396    # "allocate_anywhere" - Not yet implemented. Useful to place the log device
397    #            temporarily on same physical volume as one of the mirror
398    #            images. This policy is not recommended for mirror devices
399    #            since it would break the redundant nature of the mirror. This
400    #            policy acts like "remove" if no suitable device and space can
401    #            be allocated for the replacement.
402
403    mirror_log_fault_policy = "allocate"
404    mirror_device_fault_policy = "remove"
405}
406
407
408####################
409# Advanced section #
410####################
411
412# Metadata settings
413#
414# metadata {
415    # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
416    # You might want to override it from the command line with 0
417    # when running pvcreate on new PVs which are to be added to large VGs.
418
419    # pvmetadatacopies = 1
420
421    # Approximate default size of on-disk metadata areas in sectors.
422    # You should increase this if you have large volume groups or
423    # you want to retain a large on-disk history of your metadata changes.
424
425    # pvmetadatasize = 255
426
427    # List of directories holding live copies of text format metadata.
428    # These directories must not be on logical volumes!
429    # It's possible to use LVM2 with a couple of directories here,
430    # preferably on different (non-LV) filesystems, and with no other
431    # on-disk metadata (pvmetadatacopies = 0). Or this can be in
432    # addition to on-disk metadata areas.
433    # The feature was originally added to simplify testing and is not
434    # supported under low memory situations - the machine could lock up.
435    #
436    # Never edit any files in these directories by hand unless you
437    # you are absolutely sure you know what you are doing! Use
438    # the supplied toolset to make changes (e.g. vgcfgrestore).
439
440    # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
441#}
442
443# Event daemon
444#
445dmeventd {
446    # mirror_library is the library used when monitoring a mirror device.
447    #
448    # "libdevmapper-event-lvm2mirror.so" attempts to recover from
449    # failures.  It removes failed devices from a volume group and
450    # reconfigures a mirror as necessary. If no mirror library is
451    # provided, mirrors are not monitored through dmeventd.
452
453    mirror_library = "libdevmapper-event-lvm2mirror.so"
454
455    # snapshot_library is the library used when monitoring a snapshot device.
456    #
457    # "libdevmapper-event-lvm2snapshot.so" monitors the filling of
458    # snapshots and emits a warning through syslog, when the use of
459    # snapshot exceedes 80%. The warning is repeated when 85%, 90% and
460    # 95% of the snapshot are filled.
461
462    snapshot_library = "libdevmapper-event-lvm2snapshot.so"
463}
464