1 .TH LVM.CONF 5 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
3 lvm.conf \- Configuration file for LVM2
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.
13 Use \fBlvm dumpconfig\fP to check what settings are in use.
16 This section describes the configuration file syntax.
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.
23 Here is an informal grammar:
27 A configuration file consists of a set of values.
29 \fBvalue = section | assignment\fP
31 A value can either be a new section, or an assignment.
33 \fBsection = identifier '{' value* '}'\fP
35 A section is groups associated values together.
37 It is denoted by a name and delimited by curly brackets.
45 \fBassignment = identifier '=' (array | type)\fP
47 An assignment associates a type with an identifier.
49 e.g. max_archives = 42
52 \fBarray = '[' (type ',')* type ']' | '[' ']'\fP
54 Inhomogeneous arrays are supported.
56 Elements must be separated by commas.
58 An empty array is acceptable.
60 \fBtype = integer | float | string\fP
61 \fBinteger = [0-9]*\fP
63 \fBfloat = [0-9]*\.[0-9]*\fP
65 \fBstring = '"' .* '"'\fP
67 Strings must be enclosed in double quotes.
71 The sections that may be present in the file are:
73 \fBdevices\fP \(em Device settings
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
79 \fBscan\fP \(em List of directories to scan recursively for
81 Devices in directories outside this hierarchy will be ignored.
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:
90 \fBdevices { preferred_names = [ "^/dev/mapper/mpath" ] }\fP
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:
105 \fBdevices { filter=["r|cdrom|"] }\fP
107 \fBcache_dir\fP \(em Persistent filter cache file directory.
108 Defaults to "/etc/lvm/cache".
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.
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.
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.
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.
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.
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.
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.
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.
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
169 \fBlog\fP \(em Default log settings
171 \fBfile\fP \(em Location of log file. If this entry is not present, no
174 \fBoverwrite\fP \(em Set to 1 to overwrite the log file each time a tool
175 is invoked. By default tools append messages to the log file.
177 \fBlevel\fP \(em Log level (0-9) of messages to write to the file.
178 9 is the most verbose; 0 should produce no output.
180 \fBverbose\fP \(em Default level (0-3) of messages sent to stdout or stderr.
181 3 is the most verbose; 0 should produce the least output.
183 \fBsyslog\fP \(em Set to 1 (the default) to send log messages through syslog.
184 Turn off by setting to 0. If you set to an integer greater than one,
185 this is used - unvalidated - as the facility. The default is LOG_USER.
186 See /usr/include/sys/syslog.h for safe facility values to use.
187 For example, LOG_LOCAL0 might be 128.
189 \fBindent\fP \(em When set to 1 (the default) messages are indented
190 according to their severity, two spaces per level.
191 Set to 0 to turn off indentation.
193 \fBcommand_names\fP \(em When set to 1, the command name is used as a
194 prefix for each message.
197 \fBprefix\fP \(em Prefix used for all messages (after the command name).
198 Default is two spaces.
200 \fBactivation\fP \(em Set to 1 to log messages while
201 devices are suspended during activation.
202 Only set this temporarily while debugging a problem because
203 in low memory situations this setting can cause your machine to lock up.
205 \fBbackup\fP \(em Configuration for metadata backups.
207 \fBarchive_dir\fP \(em Directory used for automatic metadata archives.
208 Backup copies of former metadata for each volume group are archived here.
209 Defaults to "/etc/lvm/archive".
211 \fBbackup_dir\fP \(em Directory used for automatic metadata backups.
212 A single backup copy of the current metadata for each volume group
214 Defaults to "/etc/lvm/backup".
216 \fBarchive\fP \(em Whether or not tools automatically archive existing
217 metadata into \fBarchive_dir\fP before making changes to it.
218 Default is 1 (automatic archives enabled).
220 Disabling this might make metadata recovery difficult or impossible
221 if something goes wrong.
223 \fBbackup\fP \(em Whether or not tools make an automatic backup
224 into \fBbackup_dir\fP after changing metadata.
225 Default is 1 (automatic backups enabled). Set to 0 to disable.
226 Disabling this might make metadata recovery difficult or impossible
227 if something goes wrong.
229 \fBretain_min\fP \(em Minimum number of archives to keep.
232 \fBretain_days\fP \(em Minimum number of days to keep archive files.
235 \fBshell\fP \(em LVM2 built-in readline shell settings
237 \fBhistory_size\fP \(em Maximum number of lines of shell history to retain (default 100) in $HOME/.lvm_history
239 \fBglobal\fP \(em Global settings
241 \fBtest\fP \(em If set to 1, run tools in test mode i.e. no changes to
242 the on-disk metadata will get made. It's equivalent to having the
243 -t option on every command.
245 \fBactivation\fP \(em Set to 0 to turn off all communication with
246 the device-mapper driver. Useful if you want to manipulate logical
247 volumes while device-mapper is not present in your kernel.
249 \fBproc\fP \(em Mount point of proc filesystem.
252 \fBumask\fP \(em File creation mask for any files and directories created.
253 Interpreted as octal if the first digit is zero.
255 Use 022 to allow other users to read the files by default.
257 \fBformat\fP \(em The default value of \fB--metadatatype\fP used
258 to determine which format of metadata to use when creating new
259 physical volumes and volume groups. \fBlvm1\fP or \fBlvm2\fP.
261 \fBfallback_to_lvm1\fP \(em Set this to 1 if you need to
262 be able to switch between 2.4 kernels using LVM1 and kernels
263 including device-mapper.
264 The LVM2 tools should be installed as normal and
265 the LVM1 tools should be installed with a .lvm1 suffix e.g.
267 If an LVM2 tool is then run but unable to communicate
268 with device-mapper, it will automatically invoke the equivalent LVM1
269 version of the tool. Note that for LVM1 tools to
270 manipulate physical volumes and volume groups created by LVM2 you
271 must use \fB--metadataformat lvm1\fP when creating them.
273 \fBlibrary_dir\fP \(em A directory searched for LVM2's shared libraries
274 ahead of the places \fBdlopen\fP (3) searches.
276 \fBformat_libraries\fP \(em A list of shared libraries to load that contain
277 code to process different formats of metadata. For example, liblvm2formatpool.so
278 is needed to read GFS pool metadata if LVM2 was configured \fB--with-pool=shared\fP.
280 \fBlocking_type\fP \(em What type of locking to use.
281 1 is the default, which use flocks on files in \fBlocking_dir\fP
283 avoid conflicting LVM2 commands running concurrently on a single
284 machine. 0 disables locking and risks corrupting your metadata.
285 If set to 2, the tools will load the external \fBlocking_library\fP
287 If the tools were configured \fB--with-cluster=internal\fP
288 (the default) then 3 means to use built-in cluster-wide locking.
289 Type 4 enforces read-only metadata and forbids any operations that
290 might want to modify Volume Group metadata.
291 All changes to logical volumes and their states are communicated
294 \fBwait_for_locks\fP \(em When set to 1, the default, the tools
295 wait if a lock request cannot be satisfied immediately.
296 When set to 0, the operation is aborted instead.
298 \fBlocking_dir\fP \(em The directory LVM2 places its file locks
299 if \fBlocking_type\fP is set to 1. The default is \fB/var/lock/lvm\fP.
301 \fBlocking_library\fP \(em The name of the external locking
302 library to load if \fBlocking_type\fP is set to 2.
303 The default is \fBliblvm2clusterlock.so\fP. If you need to write
304 such a library, look at the lib/locking source code directory.
306 \fBtags\fP \(em Host tag settings
308 \fBhosttags\fP \(em If set to 1, create a host tag with the machine name.
309 Setting this to 0 does nothing, neither creating nor destroying any tag.
310 The machine name used is the nodename as returned by \fBuname\fP (2).
312 Additional host tags to be set can be listed here as subsections.
313 The @ prefix for tags is optional.
314 Each of these host tag subsections can contain a \fBhost_list\fP
315 array of host names. If any one of these entries matches the machine
316 name exactly then the host tag gets defined on this particular host,
317 otherwise it doesn't.
319 After lvm.conf has been processed, LVM2 works through each host
320 tag that has been defined in turn, and if there is a configuration
321 file called lvm_\fB<host_tag>\fP.conf it attempts to load it.
322 Any settings read in override settings found in earlier files.
323 Any additional host tags defined get appended to the search list,
324 so in turn they can lead to further configuration files being processed.
325 Use \fBlvm dumpconfig\fP to check the result of config
328 The following example always sets host tags \fBtag1\fP and
329 sets \fBtag2\fP on machines fs1 and fs2:
331 tags { tag1 { } tag2 { host_list = [ "fs1", "fs2" ] } }
333 These options are useful if you are replicating configuration files
334 around a cluster. Use of \fBhosttags = 1\fP means every machine
335 can have static and identical local configuration files yet use
336 different settings and activate different logical volumes by
337 default. See also \fBvolume_list\fP below and \fB--addtag\fP
340 \fBactivation\fP \(em Settings affecting device-mapper activation
342 \fBmissing_stripe_filler\fP \(em When activating an incomplete logical
343 volume in partial mode, this option dictates how the missing data is
344 replaced. A value of "error" will cause activation to create error
345 mappings for the missing data, meaning that read access to missing
346 portions of the volume will result in I/O errors. You can instead also
347 use a device path, and in that case this device will be used in place of
348 missing stripes. However, note that using anything other than
349 "error" with mirrored or snapshotted volumes is likely to result in data
350 corruption. For instructions on how to create a device that always
351 returns zeros, see \fBlvcreate\fP (8).
353 \fBmirror_region_size\fP \(em Unit size in KB for copy operations
356 \fBreadahead\fP \(em Used when there is no readahead value stored
357 in the volume group metadata. Set to \fBnone\fP to disable
358 readahead in these circumstances or \fBauto\fP to use the default
359 value chosen by the kernel.
361 \fBreserved_memory\fP, \fBreserved_stack\fP \(em How many KB to reserve
362 for LVM2 to use while logical volumes are suspended. If insufficient
363 memory is reserved before suspension, there is a risk of machine deadlock.
365 \fBprocess_priority\fP \(em The nice value to use while devices are
366 suspended. This is set to a high priority so that logical volumes
367 are suspended (with I/O generated by other processes to those
368 logical volumes getting queued) for the shortest possible time.
370 \fBvolume_list\fP \(em This acts as a filter through which
371 all requests to activate a logical volume on this machine
372 are passed. A logical volume is only activated if it matches
373 an item in the list. Tags must be preceded by @ and are checked
374 against all tags defined in the logical volume and volume group
375 metadata for a match.
376 @* is short-hand to check every tag set on the host machine (see
378 Logical volume and volume groups can also be included in the list
379 by name e.g. vg00, vg00/lvol1.
381 \fBmetadata\fP \(em Advanced metadata settings
383 \fBpvmetadatacopies\fP \(em When creating a physical volume using the
384 LVM2 metadata format, this is the default number of copies of metadata
385 to store on each physical volume.
386 Currently it can be set to 0, 1 or 2. The default is 1.
387 If set to 2, one copy is placed at the beginning of the disk
388 and the other is placed at the end.
389 It can be overridden on the command line with \fB--metadatacopies\fP.
390 If creating a volume group with just one physical volume, it's a
391 good idea to have 2 copies. If creating a large volume group with
392 many physical volumes, you may decide that 3 copies of the metadata
393 is sufficient, i.e. setting it to 1 on three of the physical volumes,
394 and 0 on the rest. Every volume group must contain at least one
395 physical volume with at least 1 copy of the metadata (unless using
396 the text files described below). The disadvantage of having lots
397 of copies is that every time the tools access the volume group, every
398 copy of the metadata has to be accessed, and this slows down the
401 \fBpvmetadatasize\fP \(em Approximate number of sectors to set aside
402 for each copy of the metadata. Volume groups with large numbers of
403 physical or logical volumes, or volumes groups containing complex
404 logical volume structures will need additional space for their metadata.
405 The metadata areas are treated as circular buffers, so
406 unused space becomes filled with an archive of the most recent
407 previous versions of the metadata.
409 \fBdirs\fP \(em List of directories holding live copies of LVM2
410 metadata as text files. These directories must not be on logical
411 volumes. It is possible to use LVM2 with a couple of directories
412 here, preferably on different (non-logical-volume) filesystems
413 and with no other on-disk metadata, \fBpvmetadatacopies = 0\fP.
414 Alternatively these directories can be in addition to the
415 on-disk metadata areas. This feature was created during the
416 development of the LVM2 metadata before the new on-disk metadata
417 areas were designed and no longer gets tested.
418 It is not supported under low-memory conditions, and it is
419 important never to edit these metadata files unless you fully
420 understand how things work: to make changes you should always use
421 the tools as normal, or else vgcfgbackup, edit backup, vgcfgrestore.
426 .I /etc/lvm/cache/.cache