import source from lvm2 2.02.79
[external/device-mapper.git] / man / lvm.conf.5.in
1 .TH LVM.CONF 5 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
2 .SH NAME
3 lvm.conf \- Configuration file for LVM2
4 .SH SYNOPSIS
5 .B #DEFAULT_SYS_DIR#/lvm.conf
6 .SH DESCRIPTION
7 lvm.conf is loaded during the initialisation phase of 
8 \fBlvm\fP (8).  This file can in turn lead to other files
9 being loaded - settings read in later override earlier
10 settings.  File timestamps are checked between commands and if 
11 any have changed, all the files are reloaded.  
12 .LP
13 Use \fBlvm dumpconfig\fP to check what settings are in use.
14 .SH SYNTAX
15 .LP
16 This section describes the configuration file syntax.
17 .LP
18 Whitespace is not significant unless it is within quotes. 
19 This provides a wide choice of acceptable indentation styles.
20 Comments begin with # and continue to the end of the line.
21 They are treated as whitespace.
22 .LP
23 Here is an informal grammar:
24 .TP
25 \fBfile = value*\fP
26 .br
27 A configuration file consists of a set of values.
28 .TP
29 \fBvalue = section | assignment\fP
30 .br
31 A value can either be a new section, or an assignment.
32 .TP
33 \fBsection = identifier '{' value* '}'\fP
34 .br
35 A section is groups associated values together.  
36 .br
37 It is denoted by a name and delimited by curly brackets.
38 .br
39 e.g.    backup {
40 .br
41                 ...
42 .br
43         }
44 .TP
45 \fBassignment = identifier '=' (array | type)\fP
46 .br
47 An assignment associates a type with an identifier.
48 .br
49 e.g.    max_archives = 42
50 .br
51 .TP
52 \fBarray = '[' (type ',')* type ']' | '[' ']'\fP
53 .br
54 Inhomogeneous arrays are supported. 
55 .br
56 Elements must be separated by commas.  
57 .br
58 An empty array is acceptable.
59 .TP
60 \fBtype = integer | float | string\fP
61 \fBinteger = [0-9]*\fP
62 .br
63 \fBfloat = [0-9]*\.[0-9]*\fP
64 .br
65 \fBstring = '"' .* '"'\fP
66 .IP
67 Strings must be enclosed in double quotes.
68
69 .SH SECTIONS
70 .LP
71 The sections that may be present in the file are:
72 .TP
73 \fBdevices\fP \(em Device settings
74 .IP
75 \fBdir\fP \(em Directory in which to create volume group device nodes.
76 Defaults to "/dev".  Commands also accept this as a prefix on volume 
77 group names.
78 .IP
79 \fBscan\fP \(em List of directories to scan recursively for 
80 LVM physical volumes.
81 Devices in directories outside this hierarchy will be ignored.
82 Defaults to "/dev".
83 .IP
84 \fBpreferred_names\fP \(em List of patterns compared in turn against
85 all the pathnames referencing the same device in in the scanned directories.
86 The pathname that matches the earliest pattern in the list is the
87 one used in any output.  As an example, if device-mapper multipathing
88 is used, the following will select multipath device names:
89 .br
90 \fBdevices { preferred_names = [ "^/dev/mapper/mpath" ] }\fP
91 .IP
92 \fBfilter\fP \(em List of patterns to apply to devices found by a scan.
93 Patterns are regular expressions delimited by any character and preceded
94 by \fBa\fP (for accept) or \fBr\fP (for reject).  The list is traversed
95 in order, and the first regex that matches determines if the device
96 will be accepted or rejected (ignored).  Devices that don't match
97 any patterns are accepted. If you want to reject patterns that
98 don't match, end the list with "r/.*/".
99 If there are several names for the same device (e.g. symbolic links
100 in /dev), if any name matches any \fBa\fP pattern, the
101 device is accepted; otherwise if any name matches any \fBr\fP
102 pattern it is rejected; otherwise it is accepted.
103 As an example, to ignore /dev/cdrom you could use:
104 .br
105 \fBdevices { filter=["r|cdrom|"] }\fP 
106 .IP
107 \fBcache_dir\fP \(em Persistent filter cache file directory.
108 Defaults to "#DEFAULT_CACHE_DIR#".
109 .IP
110 \fBwrite_cache_state\fP \(em Set to 0 to disable the writing out of the 
111 persistent filter cache file when \fBlvm\fP exits.
112 Defaults to 1.
113 .IP
114 \fBtypes\fP \(em List of pairs of additional acceptable block device types
115 found in /proc/devices together with maximum (non-zero) number of
116 partitions (normally 16).  By default, LVM2 supports ide, sd, md, loop, 
117 dasd, dac960, nbd, ida, cciss, ubd, ataraid, drbd, power2, i2o_block
118 and iseries/vd.  Block devices with major
119 numbers of different types are ignored by LVM2.  
120 Example: \fBtypes = ["fd", 16]\fP.
121 To create physical volumes on device-mapper volumes
122 created outside LVM2, perhaps encrypted ones from \fBcryptsetup\fP,
123 you'll need \fBtypes = ["device-mapper", 16]\fP.  But if you do this,
124 be careful to avoid recursion within LVM2.  The figure for number 
125 of partitions is not currently used in LVM2 - and might never be.
126 .IP
127 \fBsysfs_scan\fP \(em If set to 1 and your kernel supports sysfs and 
128 it is mounted, sysfs will be used as a quick way of filtering out
129 block devices that are not present.
130 .IP
131 \fBmd_component_detection\fP \(em If set to 1, LVM2 will ignore devices
132 used as components of software RAID (md) devices by looking for md
133 superblocks. This doesn't always work satisfactorily e.g. if a device 
134 has been reused without wiping the md superblocks first.
135 .IP
136 \fBmd_chunk_alignment\fP \(em If set to 1, and a Physical Volume is placed
137 directly upon an md device, LVM2 will align its data blocks with the
138 md device's stripe-width.
139 .IP
140 \fBdata_alignment_detection\fP \(em If set to 1, and your kernel provides
141 topology information in sysfs for the Physical Volume, the start of data
142 area will be aligned on a multiple of the ’minimum_io_size’ or
143 ’optimal_io_size’ exposed in sysfs.  minimum_io_size is the smallest
144 request the device can perform without incurring a read-modify-write
145 penalty (e.g. MD's chunk size).  optimal_io_size is the device's
146 preferred unit of receiving I/O (e.g. MD's stripe width).  minimum_io_size
147 is used if optimal_io_size is undefined (0).  If both \fBmd_chunk_alignment\fP
148 and \fBdata_alignment_detection\fP are enabled the result of
149 \fBdata_alignment_detection\fP is used.
150 .IP
151 \fBdata_alignment\fP \(em Default alignment (in KB) of start of data area
152 when creating a new Physical Volume using the \fBlvm2\fP format.
153 If a Physical Volume is placed directly upon an md device and
154 \fBmd_chunk_alignment\fP or \fBdata_alignment_detection\fP is enabled
155 this parameter is ignored.  Set to 0 to use the default alignment of
156 64KB or the page size, if larger.
157 .IP
158 \fBdata_alignment_offset_detection\fP \(em If set to 1, and your kernel
159 provides topology information in sysfs for the Physical Volume, the
160 start of the aligned data area of the Physical Volume will be shifted
161 by the alignment_offset exposed in sysfs.
162 .sp
163 To see the location of the first Physical Extent of an existing Physical Volume
164 use \fBpvs -o +pe_start\fP .  It will be a multiple of the requested
165 \fBdata_alignment\fP plus the alignment_offset from
166 \fBdata_alignment_offset_detection\fP (if enabled) or the pvcreate
167 commandline.
168 .IP
169 \fBdisable_after_error_count\fP \(em During each LVM operation errors received
170 from each device are counted.  If the counter of a particular device exceeds
171 the limit set here, no further I/O is sent to that device for the remainder of
172 the respective operation. Setting the parameter to 0 disables the counters
173 altogether.
174 .TP
175 \fBallocation\fP \(em Space allocation policies
176 .IP
177 \fBcling_tag_list\fP \(em List of PV tags matched by the \fBcling\fP allocation policy.
178 .IP
179 When searching for free space to extend an LV, the \fBcling\fP
180 allocation policy will choose space on the same PVs as the last
181 segment of the existing LV.  If there is insufficient space and a
182 list of tags is defined here, it will check whether any of them are
183 attached to the PVs concerned and then seek to match those PV tags
184 between existing extents and new extents.
185 .IP 
186 The @ prefix for tags is required.
187 Use the special tag "@*" as a wildcard to match any PV tag and so use 
188 all PV tags for this purpose.
189 .IP
190 For example, LVs are mirrored between two sites within a single VG.
191 PVs are tagged with either @site1 or @site2 to indicate where
192 they are situated and these two PV tags are selected for use with this
193 allocation policy:
194 .IP
195 cling_tag_list = [ "@site1", "@site2" ]
196 .TP
197 \fBlog\fP \(em Default log settings
198 .IP
199 \fBfile\fP \(em Location of log file.  If this entry is not present, no
200 log file is written.
201 .IP
202 \fBoverwrite\fP \(em Set to 1 to overwrite the log file each time a tool
203 is invoked.  By default tools append messages to the log file.
204 .IP
205 \fBlevel\fP \(em Log level (0-9) of messages to write to the file.
206 9 is the most verbose; 0 should produce no output.
207 .IP
208 \fBverbose\fP \(em Default level (0-3) of messages sent to stdout or stderr.
209 3 is the most verbose; 0 should produce the least output.
210 .IP
211 \fBsyslog\fP \(em Set to 1 (the default) to send log messages through syslog.
212 Turn off by setting to 0.  If you set to an integer greater than one,
213 this is used - unvalidated - as the facility.  The default is LOG_USER.  
214 See /usr/include/sys/syslog.h for safe facility values to use.
215 For example, LOG_LOCAL0 might be 128.
216 .IP
217 \fBindent\fP \(em When set to 1 (the default) messages are indented 
218 according to their severity, two spaces per level.  
219 Set to 0 to turn off indentation.
220 .IP
221 \fBcommand_names\fP \(em When set to 1, the command name is used as a
222 prefix for each message.
223 Default is 0 (off).
224 .IP
225 \fBprefix\fP \(em Prefix used for all messages (after the command name).
226 Default is two spaces.
227 .IP
228 \fBactivation\fP \(em Set to 1 to log messages while
229 devices are suspended during activation.  
230 Only set this temporarily while debugging a problem because
231 in low memory situations this setting can cause your machine to lock up.
232 .TP
233 \fBbackup\fP \(em Configuration for metadata backups.
234 .IP
235 \fBarchive_dir\fP \(em Directory used for automatic metadata archives.
236 Backup copies of former metadata for each volume group are archived here.
237 Defaults to "#DEFAULT_ARCHIVE_DIR#".
238 .IP
239 \fBbackup_dir\fP \(em Directory used for automatic metadata backups.
240 A single backup copy of the current metadata for each volume group 
241 is stored here.
242 Defaults to "#DEFAULT_BACKUP_DIR#".
243 .IP
244 \fBarchive\fP \(em Whether or not tools automatically archive existing
245 metadata into \fBarchive_dir\fP before making changes to it.
246 Default is 1 (automatic archives enabled).  
247 Set to 0 to disable.  
248 Disabling this might make metadata recovery difficult or impossible 
249 if something goes wrong.
250 .IP
251 \fBbackup\fP \(em Whether or not tools make an automatic backup 
252 into \fBbackup_dir\fP after changing metadata.  
253 Default is 1 (automatic backups enabled).  Set to 0 to disable.
254 Disabling this might make metadata recovery difficult or impossible 
255 if something goes wrong.
256 .IP
257 \fBretain_min\fP \(em Minimum number of archives to keep.
258 Defaults to 10.
259 .IP
260 \fBretain_days\fP \(em Minimum number of days to keep archive files.
261 Defaults to 30.
262 .TP
263 \fBshell\fP \(em LVM2 built-in readline shell settings
264 .IP
265 \fBhistory_size\fP \(em Maximum number of lines of shell history to retain (default 100) in $HOME/.lvm_history
266 .TP
267 \fBglobal\fP \(em Global settings
268 .IP
269 \fBtest\fP \(em If set to 1, run tools in test mode i.e. no changes to
270 the on-disk metadata will get made.  It's equivalent to having the
271 -t option on every command.
272 .IP
273 \fBactivation\fP \(em Set to 0 to turn off all communication with
274 the device-mapper driver.  Useful if you want to manipulate logical
275 volumes while device-mapper is not present in your kernel.
276 .IP
277 \fBproc\fP \(em Mount point of proc filesystem.
278 Defaults to /proc.
279 .IP
280 \fBumask\fP \(em File creation mask for any files and directories created.
281 Interpreted as octal if the first digit is zero.
282 Defaults to 077.  
283 Use 022 to allow other users to read the files by default.
284 .IP
285 \fBformat\fP \(em The default value of \fB--metadatatype\fP used
286 to determine which format of metadata to use when creating new 
287 physical volumes and volume groups. \fBlvm1\fP or \fBlvm2\fP.
288 .IP
289 \fBfallback_to_lvm1\fP \(em Set this to 1 if you need to 
290 be able to switch between 2.4 kernels using LVM1 and kernels
291 including device-mapper.
292 The LVM2 tools should be installed as normal and
293 the LVM1 tools should be installed with a .lvm1 suffix e.g.
294 vgscan.lvm1.  
295 If an LVM2 tool is then run but unable to communicate
296 with device-mapper, it will automatically invoke the equivalent LVM1 
297 version of the tool.  Note that for LVM1 tools to 
298 manipulate physical volumes and volume groups created by LVM2 you 
299 must use \fB--metadataformat lvm1\fP when creating them.
300 .IP
301 \fBlibrary_dir\fP \(em A directory searched for LVM2's shared libraries
302 ahead of the places \fBdlopen\fP (3) searches.
303 .IP
304 \fBformat_libraries\fP \(em A list of shared libraries to load that contain
305 code to process different formats of metadata. For example, liblvm2formatpool.so
306 is needed to read GFS pool metadata if LVM2 was configured \fB--with-pool=shared\fP.
307 .IP
308 \fBlocking_type\fP \(em What type of locking to use.
309 1 is the default, which use flocks on files in \fBlocking_dir\fP
310 (see below) to
311 avoid conflicting LVM2 commands running concurrently on a single
312 machine. 0 disables locking and risks corrupting your metadata.
313 If set to 2, the tools will load the external \fBlocking_library\fP
314 (see below).
315 If the tools were configured \fB--with-cluster=internal\fP 
316 (the default) then 3 means to use built-in cluster-wide locking.
317 Type 4 enforces read-only metadata and forbids any operations that
318 might want to modify Volume Group metadata.
319 All changes to logical volumes and their states are communicated
320 using locks.
321 .IP
322 \fBwait_for_locks\fP \(em When set to 1, the default, the tools
323 wait if a lock request cannot be satisfied immediately.
324 When set to 0, the operation is aborted instead.
325 .IP
326 \fBlocking_dir\fP \(em The directory LVM2 places its file locks
327 if \fBlocking_type\fP is set to 1.  The default is \fB/var/lock/lvm\fP.
328 .IP
329 \fBlocking_library\fP \(em The name of the external locking
330 library to load if \fBlocking_type\fP is set to 2.
331 The default is \fBliblvm2clusterlock.so\fP.  If you need to write
332 such a library, look at the lib/locking source code directory.
333 .TP
334 \fBtags\fP \(em Host tag settings
335 .IP
336 \fBhosttags\fP \(em If set to 1, create a host tag with the machine name.
337 Setting this to 0 does nothing, neither creating nor destroying any tag.
338 The machine name used is the nodename as returned by \fBuname\fP (2).
339 .IP
340 Additional host tags to be set can be listed here as subsections. 
341 The @ prefix for tags is optional.
342 Each of these host tag subsections can contain a \fBhost_list\fP 
343 array of host names. If any one of these entries matches the machine 
344 name exactly then the host tag gets defined on this particular host, 
345 otherwise it doesn't.
346 .IP
347 After lvm.conf has been processed, LVM2 works through each host
348 tag that has been defined in turn, and if there is a configuration
349 file called lvm_\fB<host_tag>\fP.conf it attempts to load it.
350 Any settings read in override settings found in earlier files.
351 Any additional host tags defined get appended to the search list,
352 so in turn they can lead to further configuration files being processed.
353 Use \fBlvm dumpconfig\fP to check the result of config
354 file processing.
355 .IP
356 The following example always sets host tags \fBtag1\fP and
357 sets \fBtag2\fP on machines fs1 and fs2:
358 .IP
359 tags { tag1 { } tag2 { host_list = [ "fs1", "fs2" ] } }
360 .IP
361 These options are useful if you are replicating configuration files
362 around a cluster.  Use of \fBhosttags = 1\fP means every machine
363 can have static and identical local configuration files yet use 
364 different settings and activate different logical volumes by
365 default.  See also \fBvolume_list\fP below and \fB--addtag\fP 
366 in \fBlvm\fP (8).
367 .TP
368 \fBactivation\fP \(em Settings affecting device-mapper activation
369 .IP
370 \fBmissing_stripe_filler\fP \(em When activating an incomplete logical
371 volume in partial mode, this option dictates how the missing data is
372 replaced.  A value of "error" will cause activation to create error
373 mappings for the missing data, meaning that read access to missing
374 portions of the volume will result in I/O errors. You can instead also
375 use a device path, and in that case this device will be used in place of
376 missing stripes. However, note that using anything other than
377 "error" with mirrored or snapshotted volumes is likely to result in data
378 corruption.  For instructions on how to create a device that always
379 returns zeros, see \fBlvcreate\fP (8).
380 .IP
381 \fBmirror_region_size\fP \(em Unit size in KB for copy operations
382 when mirroring.
383 .IP
384 \fBreadahead\fP \(em Used when there is no readahead value stored 
385 in the volume group metadata.  Set to \fBnone\fP to disable
386 readahead in these circumstances or \fBauto\fP to use the default
387 value chosen by the kernel.
388 .IP
389 \fBreserved_memory\fP, \fBreserved_stack\fP \(em How many KB to reserve 
390 for LVM2 to use while logical volumes are suspended.  If insufficient 
391 memory is reserved before suspension, there is a risk of machine deadlock.
392 .IP
393 \fBprocess_priority\fP \(em The nice value to use while devices are
394 suspended.  This is set to a high priority so that logical volumes
395 are suspended (with I/O generated by other processes to those
396 logical volumes getting queued) for the shortest possible time.
397 .IP
398 \fBvolume_list\fP \(em This acts as a filter through which
399 all requests to activate a logical volume on this machine
400 are passed.  A logical volume is only activated if it matches
401 an item in the list.  Tags must be preceded by @ and are checked
402 against all tags defined in the logical volume and volume group 
403 metadata for a match.
404 @* is short-hand to check every tag set on the host machine (see
405 \fBtags\fP above).
406 Logical volume and volume groups can also be included in the list
407 by name e.g. vg00, vg00/lvol1.
408 .TP
409 \fBmetadata\fP \(em Advanced metadata settings
410 .IP
411 \fBpvmetadatacopies\fP \(em When creating a physical volume using the
412 LVM2 metadata format, this is the default number of copies of metadata
413 to store on each physical volume.  
414 Currently it can be set to 0, 1 or 2.  The default is 1.  
415 If set to 2, one copy is placed at the beginning of the disk
416 and the other is placed at the end.
417 It can be overridden on the command line with \fB--pvmetadatacopies\fP
418 (see \fBpvcreate\fP).
419 If creating a volume group with just one physical volume, it's a
420 good idea to have 2 copies.  If creating a large volume group with
421 many physical volumes, you may decide that 3 copies of the metadata
422 is sufficient, i.e. setting it to 1 on three of the physical volumes,
423 and 0 on the rest.  Every volume group must contain at least one 
424 physical volume with at least 1 copy of the metadata (unless using
425 the text files described below).  The disadvantage of having lots
426 of copies is that every time the tools access the volume group, every
427 copy of the metadata has to be accessed, and this slows down the
428 tools.
429 .IP
430 \fBpvmetadatasize\fP \(em Approximate number of sectors to set aside
431 for each copy of the metadata. Volume groups with large numbers of
432 physical or logical volumes, or volumes groups containing complex 
433 logical volume structures will need additional space for their metadata.
434 The metadata areas are treated as circular buffers, so
435 unused space becomes filled with an archive of the most recent
436 previous versions of the metadata.
437 .IP
438 \fBpvmetadataignore\fP When creating a physical volume using the LVM2
439 metadata format, this states whether metadata areas should be ignored.
440 The default is "n".  If metadata areas on a physical volume are ignored,
441 LVM will not not store metadata in the metadata areas present on newly
442 created Physical Volumes.  The option can be overridden on the command
443 line with \fB--metadataignore\fP (See \fBpvcreate\fP and \fBpvchange\fP).
444 Metadata areas cannot be created or extended after Logical Volumes have
445 been allocated on the device.
446 If you do not want to store metadata on this device, it is still wise
447 always to allocate a metadata area (use a non-zero value for
448 \fB--pvmetadatacopies\fP) in case you need it in the future and to use
449 this option to instruct LVM2 to ignore it.
450 .IP
451 \fBvgmetadatacopies\fP \(em When creating a volume group using the
452 LVM2 metadata format, this is the default number of copies of metadata
453 desired across all the physical volumes in the volume group.  If set to
454 a non-zero value, LVM will automatically set or clear the metadataignore
455 flag on the physical volumes (see \fBpvcreate\fP and \fBpvchange\fP
456 \fB--metadataignore\fP) in order to achieve the desired number of metadata
457 copies.  An LVM command that adds or removes physical volumes (for example,
458 \fBvgextend\fP, \fBvgreduce\fP, \fBvgsplit\fP, or \fBvgmerge\fP), may cause
459 LVM to automatically set or clear the metadataignore flags.  Also, if
460 physical volumes go missing or reappear, or a new number of copies is
461 explicitly set (see \fBvgchange --vgmetadatacopies\fP), LVM may adjust
462 the metadataignore flags.
463 Set \fBvgmetadatacopies\fP to 0 instructs LVM not to set or clear the
464 metadataignore flags automatically.  You may set a value larger than the
465 sum of all metadata areas on all physical volumes.  The value can
466 be overridden on the command line with \fB--vgmetadatacopies\fP for various
467 commands (for example, \fBvgcreate\fP and \fBvgchange\fP), and can be
468 queryied with the \fBvg_mda_copies\fP field of \fBvgs\fP.  This option
469 is useful for volume groups containing large numbers of physical volumes
470 with metadata as it may be used to minimize metadata read and write overhead.
471 .IP
472 \fBdirs\fP \(em List of directories holding live copies of LVM2
473 metadata as text files.  These directories must not be on logical
474 volumes.  It is possible to use LVM2 with a couple of directories
475 here, preferably on different (non-logical-volume) filesystems
476 and with no other on-disk metadata, \fBpvmetadatacopies = 0\fP.
477 Alternatively these directories can be in addition to the
478 on-disk metadata areas.  This feature was created during the
479 development of the LVM2 metadata before the new on-disk metadata
480 areas were designed and no longer gets tested.  
481 It is not supported under low-memory conditions, and it is 
482 important never to edit these metadata files unless you fully 
483 understand how things work: to make changes you should always use 
484 the tools as normal, or else vgcfgbackup, edit backup, vgcfgrestore.
485 .SH FILES
486 .I #DEFAULT_SYS_DIR#/lvm.conf
487 .I #DEFAULT_ARCHIVE_DIR#
488 .I #DEFAULT_BACKUP_DIR#
489 .I #DEFAULT_CACHE_DIR#/.cache
490 .I #DEFAULT_LOCK_DIR#
491 .SH SEE ALSO
492 .BR lvm (8),
493 .BR umask (2),
494 .BR uname (2),
495 .BR dlopen (3),
496 .BR syslog (3),
497 .BR syslog.conf (5)