import source from lvm2 2.02.79
[external/device-mapper.git] / doc / example.conf.in
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 # @DEFAULT_SYS_DIR@/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 @DEFAULT_SYS_DIR@ 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.
13 devices {
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 @DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@ 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 = "@DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@"
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     # Default alignment of the start of a data area in MB.  If set to 0,
102     # a value of 64KB will be used.  Set to 1 for 1MiB, 2 for 2MiB, etc.
103     # default_data_alignment = @DEFAULT_DATA_ALIGNMENT@
104
105     # By default, the start of a PV's data area will be a multiple of
106     # the 'minimum_io_size' or 'optimal_io_size' exposed in sysfs.
107     # - minimum_io_size - the smallest request the device can perform
108     #   w/o incurring a read-modify-write penalty (e.g. MD's chunk size)
109     # - optimal_io_size - the device's preferred unit of receiving I/O
110     #   (e.g. MD's stripe width)
111     # minimum_io_size is used if optimal_io_size is undefined (0).
112     # If md_chunk_alignment is enabled, that detects the optimal_io_size.
113     # This setting takes precedence over md_chunk_alignment.
114     # 1 enables; 0 disables.
115     data_alignment_detection = 1
116
117     # Alignment (in KB) of start of data area when creating a new PV.
118     # md_chunk_alignment and data_alignment_detection are disabled if set.
119     # Set to 0 for the default alignment (see: data_alignment_default)
120     # or page size, if larger.
121     data_alignment = 0
122
123     # By default, the start of the PV's aligned data area will be shifted by
124     # the 'alignment_offset' exposed in sysfs.  This offset is often 0 but
125     # may be non-zero; e.g.: certain 4KB sector drives that compensate for
126     # windows partitioning will have an alignment_offset of 3584 bytes
127     # (sector 7 is the lowest aligned logical block, the 4KB sectors start
128     # at LBA -1, and consequently sector 63 is aligned on a 4KB boundary).
129     # But note that pvcreate --dataalignmentoffset will skip this detection.
130     # 1 enables; 0 disables.
131     data_alignment_offset_detection = 1
132
133     # If, while scanning the system for PVs, LVM2 encounters a device-mapper
134     # device that has its I/O suspended, it waits for it to become accessible.
135     # Set this to 1 to skip such devices.  This should only be needed
136     # in recovery situations.
137     ignore_suspended_devices = 0
138
139     # During each LVM operation errors received from each device are counted.
140     # If the counter of a particular device exceeds the limit set here, no
141     # further I/O is sent to that device for the remainder of the respective
142     # operation. Setting the parameter to 0 disables the counters altogether.
143     disable_after_error_count = 0
144
145     # Allow use of pvcreate --uuid without requiring --restorefile.
146     require_restorefile_with_uuid = 1
147 }
148
149 # This section allows you to configure the way in which LVM selects
150 # free space for its Logical Volumes.
151 #allocation {
152 #    When searching for free space to extend an LV, the "cling"
153 #    allocation policy will choose space on the same PVs as the last
154 #    segment of the existing LV.  If there is insufficient space and a
155 #    list of tags is defined here, it will check whether any of them are
156 #    attached to the PVs concerned and then seek to match those PV tags
157 #    between existing extents and new extents.
158 #    Use the special tag "@*" as a wildcard to match any PV tag.
159 #    
160 #    Example: LVs are mirrored between two sites within a single VG.
161 #    PVs are tagged with either @site1 or @site2 to indicate where
162 #    they are situated.
163 #
164 #    cling_tag_list = [ "@site1", "@site2" ]
165 #    cling_tag_list = [ "@*" ]
166 #}
167
168 # This section that allows you to configure the nature of the
169 # information that LVM2 reports.
170 log {
171
172     # Controls the messages sent to stdout or stderr.
173     # There are three levels of verbosity, 3 being the most verbose.
174     verbose = 0
175
176     # Should we send log messages through syslog?
177     # 1 is yes; 0 is no.
178     syslog = 1
179
180     # Should we log error and debug messages to a file?
181     # By default there is no log file.
182     #file = "/var/log/lvm2.log"
183
184     # Should we overwrite the log file each time the program is run?
185     # By default we append.
186     overwrite = 0
187
188     # What level of log messages should we send to the log file and/or syslog?
189     # There are 6 syslog-like log levels currently in use - 2 to 7 inclusive.
190     # 7 is the most verbose (LOG_DEBUG).
191     level = 0
192
193     # Format of output messages
194     # Whether or not (1 or 0) to indent messages according to their severity
195     indent = 1
196
197     # Whether or not (1 or 0) to display the command name on each line output
198     command_names = 0
199
200     # A prefix to use before the message text (but after the command name,
201     # if selected).  Default is two spaces, so you can see/grep the severity
202     # of each message.
203     prefix = "  "
204
205     # To make the messages look similar to the original LVM tools use:
206     #   indent = 0
207     #   command_names = 1
208     #   prefix = " -- "
209
210     # Set this if you want log messages during activation.
211     # Don't use this in low memory situations (can deadlock).
212     # activation = 0
213 }
214
215 # Configuration of metadata backups and archiving.  In LVM2 when we
216 # talk about a 'backup' we mean making a copy of the metadata for the
217 # *current* system.  The 'archive' contains old metadata configurations.
218 # Backups are stored in a human readeable text format.
219 backup {
220
221     # Should we maintain a backup of the current metadata configuration ?
222     # Use 1 for Yes; 0 for No.
223     # Think very hard before turning this off!
224     backup = 1
225
226     # Where shall we keep it ?
227     # Remember to back up this directory regularly!
228     backup_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_BACKUP_SUBDIR@"
229
230     # Should we maintain an archive of old metadata configurations.
231     # Use 1 for Yes; 0 for No.
232     # On by default.  Think very hard before turning this off.
233     archive = 1
234
235     # Where should archived files go ?
236     # Remember to back up this directory regularly!
237     archive_dir = "@DEFAULT_SYS_DIR@/@DEFAULT_ARCHIVE_SUBDIR@"
238
239     # What is the minimum number of archive files you wish to keep ?
240     retain_min = 10
241
242     # What is the minimum time you wish to keep an archive file for ?
243     retain_days = 30
244 }
245
246 # Settings for the running LVM2 in shell (readline) mode.
247 shell {
248
249     # Number of lines of history to store in ~/.lvm_history
250     history_size = 100
251 }
252
253
254 # Miscellaneous global LVM2 settings
255 global {
256
257     # The file creation mask for any files and directories created.
258     # Interpreted as octal if the first digit is zero.
259     umask = 077
260
261     # Allow other users to read the files
262     #umask = 022
263
264     # Enabling test mode means that no changes to the on disk metadata
265     # will be made.  Equivalent to having the -t option on every
266     # command.  Defaults to off.
267     test = 0
268
269     # Default value for --units argument
270     units = "h"
271
272     # Since version 2.02.54, the tools distinguish between powers of
273     # 1024 bytes (e.g. KiB, MiB, GiB) and powers of 1000 bytes (e.g.
274     # KB, MB, GB).
275     # If you have scripts that depend on the old behaviour, set this to 0
276     # temporarily until you update them.
277     si_unit_consistency = 1
278
279     # Whether or not to communicate with the kernel device-mapper.
280     # Set to 0 if you want to use the tools to manipulate LVM metadata 
281     # without activating any logical volumes.
282     # If the device-mapper kernel driver is not present in your kernel
283     # setting this to 0 should suppress the error messages.
284     activation = 1
285
286     # If we can't communicate with device-mapper, should we try running 
287     # the LVM1 tools?
288     # This option only applies to 2.4 kernels and is provided to help you
289     # switch between device-mapper kernels and LVM1 kernels.
290     # The LVM1 tools need to be installed with .lvm1 suffices
291     # e.g. vgscan.lvm1 and they will stop working after you start using
292     # the new lvm2 on-disk metadata format.
293     # The default value is set when the tools are built.
294     # fallback_to_lvm1 = 0
295
296     # The default metadata format that commands should use - "lvm1" or "lvm2".
297     # The command line override is -M1 or -M2.
298     # Defaults to "lvm2".
299     # format = "lvm2"
300
301     # Location of proc filesystem
302     proc = "/proc"
303
304     # Type of locking to use. Defaults to local file-based locking (1).
305     # Turn locking off by setting to 0 (dangerous: risks metadata corruption
306     # if LVM2 commands get run concurrently).
307     # Type 2 uses the external shared library locking_library.
308     # Type 3 uses built-in clustered locking.
309     # Type 4 uses read-only locking which forbids any operations that might 
310     # change metadata.
311     locking_type = 1
312
313     # Set to 0 to fail when a lock request cannot be satisfied immediately.
314     wait_for_locks = 1
315
316     # If using external locking (type 2) and initialisation fails,
317     # with this set to 1 an attempt will be made to use the built-in
318     # clustered locking.
319     # If you are using a customised locking_library you should set this to 0.
320     fallback_to_clustered_locking = 1
321
322     # If an attempt to initialise type 2 or type 3 locking failed, perhaps
323     # because cluster components such as clvmd are not running, with this set
324     # to 1 an attempt will be made to use local file-based locking (type 1).
325     # If this succeeds, only commands against local volume groups will proceed.
326     # Volume Groups marked as clustered will be ignored.
327     fallback_to_local_locking = 1
328
329     # Local non-LV directory that holds file-based locks while commands are
330     # in progress.  A directory like /tmp that may get wiped on reboot is OK.
331     locking_dir = "@DEFAULT_LOCK_DIR@"
332
333     # Whenever there are competing read-only and read-write access requests for
334     # a volume group's metadata, instead of always granting the read-only
335     # requests immediately, delay them to allow the read-write requests to be
336     # serviced.  Without this setting, write access may be stalled by a high
337     # volume of read-only requests.
338     # NB. This option only affects locking_type = 1 viz. local file-based
339     # locking.
340     prioritise_write_locks = 1
341
342     # Other entries can go here to allow you to load shared libraries
343     # e.g. if support for LVM1 metadata was compiled as a shared library use
344     #   format_libraries = "liblvm2format1.so" 
345     # Full pathnames can be given.
346
347     # Search this directory first for shared libraries.
348     #   library_dir = "/lib"
349
350     # The external locking library to load if locking_type is set to 2.
351     #   locking_library = "liblvm2clusterlock.so"
352
353     # Treat any internal errors as fatal errors, aborting the process that
354     # encountered the internal error. Please only enable for debugging.
355     abort_on_internal_errors = 0
356
357     # If set to 1, no operations that change on-disk metadata will be permitted.
358     # Additionally, read-only commands that encounter metadata in need of repair
359     # will still be allowed to proceed exactly as if the repair had been 
360     # performed (except for the unchanged vg_seqno).
361     # Inappropriate use could mess up your system, so seek advice first!
362     metadata_read_only = 0
363 }
364
365 activation {
366     # Set to 0 to disable udev synchronisation (if compiled into the binaries).
367     # Processes will not wait for notification from udev.
368     # They will continue irrespective of any possible udev processing
369     # in the background.  You should only use this if udev is not running
370     # or has rules that ignore the devices LVM2 creates.
371     # The command line argument --nodevsync takes precedence over this setting.
372     # If set to 1 when udev is not running, and there are LVM2 processes
373     # waiting for udev, run 'dmsetup udevcomplete_all' manually to wake them up.
374     udev_sync = 1
375
376     # Set to 0 to disable the udev rules installed by LVM2 (if built with
377     # --enable-udev_rules). LVM2 will then manage the /dev nodes and symlinks
378     # for active logical volumes directly itself.
379     # N.B. Manual intervention may be required if this setting is changed
380     # while any logical volumes are active.
381     udev_rules = 1
382
383     # How to fill in missing stripes if activating an incomplete volume.
384     # Using "error" will make inaccessible parts of the device return
385     # I/O errors on access.  You can instead use a device path, in which 
386     # case, that device will be used to in place of missing stripes.
387     # But note that using anything other than "error" with mirrored 
388     # or snapshotted volumes is likely to result in data corruption.
389     missing_stripe_filler = "error"
390
391     # How much stack (in KB) to reserve for use while devices suspended
392     reserved_stack = 256
393
394     # How much memory (in KB) to reserve for use while devices suspended
395     reserved_memory = 8192
396
397     # Nice value used while devices suspended
398     process_priority = -18
399
400     # If volume_list is defined, each LV is only activated if there is a
401     # match against the list.
402     #   "vgname" and "vgname/lvname" are matched exactly.
403     #   "@tag" matches any tag set in the LV or VG.
404     #   "@*" matches if any tag defined on the host is also set in the LV or VG
405     #
406     # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
407
408     # Size (in KB) of each copy operation when mirroring
409     mirror_region_size = 512
410
411     # Setting to use when there is no readahead value stored in the metadata.
412     #
413     # "none" - Disable readahead.
414     # "auto" - Use default value chosen by kernel.
415     readahead = "auto"
416
417     # 'mirror_image_fault_policy' and 'mirror_log_fault_policy' define
418     # how a device failure affecting a mirror is handled.
419     # A mirror is composed of mirror images (copies) and a log.
420     # A disk log ensures that a mirror does not need to be re-synced
421     # (all copies made the same) every time a machine reboots or crashes.
422     #
423     # In the event of a failure, the specified policy will be used to determine
424     # what happens. This applies to automatic repairs (when the mirror is being
425     # monitored by dmeventd) and to manual lvconvert --repair when
426     # --use-policies is given.
427     #
428     # "remove" - Simply remove the faulty device and run without it.  If
429     #            the log device fails, the mirror would convert to using
430     #            an in-memory log.  This means the mirror will not
431     #            remember its sync status across crashes/reboots and
432     #            the entire mirror will be re-synced.  If a
433     #            mirror image fails, the mirror will convert to a
434     #            non-mirrored device if there is only one remaining good
435     #            copy.
436     #
437     # "allocate" - Remove the faulty device and try to allocate space on
438     #            a new device to be a replacement for the failed device.
439     #            Using this policy for the log is fast and maintains the
440     #            ability to remember sync state through crashes/reboots.
441     #            Using this policy for a mirror device is slow, as it
442     #            requires the mirror to resynchronize the devices, but it
443     #            will preserve the mirror characteristic of the device.
444     #            This policy acts like "remove" if no suitable device and
445     #            space can be allocated for the replacement.
446     #
447     # "allocate_anywhere" - Not yet implemented. Useful to place the log device
448     #            temporarily on same physical volume as one of the mirror
449     #            images. This policy is not recommended for mirror devices
450     #            since it would break the redundant nature of the mirror. This
451     #            policy acts like "remove" if no suitable device and space can
452     #            be allocated for the replacement.
453
454     mirror_log_fault_policy = "allocate"
455     mirror_image_fault_policy = "remove"
456
457     # 'snapshot_autoextend_threshold' and 'snapshot_autoextend_percent' define
458     # how to handle automatic snapshot extension. The former defines when the
459     # snapshot should be extended: when its space usage exceeds this many
460     # percent. The latter defines how much extra space should be allocated for
461     # the snapshot, in percent of its current size.
462     #
463     # For example, if you set snapshot_autoextend_threshold to 70 and
464     # snapshot_autoextend_percent to 20, whenever a snapshot exceeds 70% usage,
465     # it will be extended by another 20%. For a 1G snapshot, using up 700M will
466     # trigger a resize to 1.2G. When the usage exceeds 840M, the snapshot will
467     # be extended to 1.44G, and so on.
468     #
469     # Setting snapshot_autoextend_threshold to 100 disables automatic
470     # extensions. The minimum value is 50 (A setting below 50 will be treated
471     # as 50).
472
473     snapshot_autoextend_threshold = 100
474     snapshot_autoextend_percent = 20
475
476     # While activating devices, I/O to devices being (re)configured is
477     # suspended, and as a precaution against deadlocks, LVM2 needs to pin
478     # any memory it is using so it is not paged out.  Groups of pages that
479     # are known not to be accessed during activation need not be pinned
480     # into memory.  Each string listed in this setting is compared against
481     # each line in /proc/self/maps, and the pages corresponding to any
482     # lines that match are not pinned.  On some systems locale-archive was
483     # found to make up over 80% of the memory used by the process.
484     # mlock_filter = [ "locale/locale-archive", "gconv/gconv-modules.cache" ]
485
486     # Set to 1 to revert to the default behaviour prior to version 2.02.62
487     # which used mlockall() to pin the whole process's memory while activating
488     # devices.
489     use_mlockall = 0
490
491     # Monitoring is enabled by default when activating logical volumes.
492     # Set to 0 to disable monitoring or use the --ignoremonitoring option.
493     monitoring = 1
494
495     # When pvmove or lvconvert must wait for the kernel to finish
496     # synchronising or merging data, they check and report progress
497     # at intervals of this number of seconds.  The default is 15 seconds.
498     # If this is set to 0 and there is only one thing to wait for, there
499     # are no progress reports, but the process is awoken immediately the
500     # operation is complete.
501     polling_interval = 15
502 }
503
504
505 ####################
506 # Advanced section #
507 ####################
508
509 # Metadata settings
510 #
511 # metadata {
512     # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
513     # You might want to override it from the command line with 0 
514     # when running pvcreate on new PVs which are to be added to large VGs.
515
516     # pvmetadatacopies = 1
517
518     # Default number of copies of metadata to maintain for each VG.
519     # If set to a non-zero value, LVM automatically chooses which of
520     # the available metadata areas to use to achieve the requested
521     # number of copies of the VG metadata.  If you set a value larger
522     # than the the total number of metadata areas available then
523     # metadata is stored in them all.
524     # The default value of 0 ("unmanaged") disables this automatic
525     # management and allows you to control which metadata areas
526     # are used at the individual PV level using 'pvchange
527     # --metadataignore y/n'.
528
529     # vgmetadatacopies = 0
530
531     # Approximate default size of on-disk metadata areas in sectors.
532     # You should increase this if you have large volume groups or
533     # you want to retain a large on-disk history of your metadata changes.
534
535     # pvmetadatasize = 255
536
537     # List of directories holding live copies of text format metadata.
538     # These directories must not be on logical volumes!
539     # It's possible to use LVM2 with a couple of directories here,
540     # preferably on different (non-LV) filesystems, and with no other 
541     # on-disk metadata (pvmetadatacopies = 0). Or this can be in
542     # addition to on-disk metadata areas.
543     # The feature was originally added to simplify testing and is not
544     # supported under low memory situations - the machine could lock up.
545     #
546     # Never edit any files in these directories by hand unless you
547     # you are absolutely sure you know what you are doing! Use
548     # the supplied toolset to make changes (e.g. vgcfgrestore).
549
550     # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
551 #}
552
553 # Event daemon
554 #
555 dmeventd {
556     # mirror_library is the library used when monitoring a mirror device.
557     #
558     # "libdevmapper-event-lvm2mirror.so" attempts to recover from
559     # failures.  It removes failed devices from a volume group and
560     # reconfigures a mirror as necessary. If no mirror library is
561     # provided, mirrors are not monitored through dmeventd.
562
563     mirror_library = "libdevmapper-event-lvm2mirror.so"
564
565     # snapshot_library is the library used when monitoring a snapshot device.
566     #
567     # "libdevmapper-event-lvm2snapshot.so" monitors the filling of
568     # snapshots and emits a warning through syslog when the use of
569     # the snapshot exceeds 80%. The warning is repeated when 85%, 90% and
570     # 95% of the snapshot is filled.
571
572     snapshot_library = "libdevmapper-event-lvm2snapshot.so"
573
574     # Full path of the dmeventd binary.
575     #
576     # executable = "@DMEVENTD_PATH@"
577 }