3 .TH LVM.CONF 5 "LVM TOOLS 2.02.44-cvs (02-17-09)" "Sistina Software UK" \" -*- nroff -*-
5 lvm.conf \- Configuration file for LVM2
9 lvm.conf is loaded during the initialisation phase of
10 \fBlvm\fP (8). This file can in turn lead to other files
11 being loaded - settings read in later override earlier
12 settings. File timestamps are checked between commands and if
13 any have changed, all the files are reloaded.
15 Use \fBlvm dumpconfig\fP to check what settings are in use.
18 This section describes the configuration file syntax.
20 Whitespace is not significant unless it is within quotes.
21 This provides a wide choice of acceptable indentation styles.
22 Comments begin with # and continue to the end of the line.
23 They are treated as whitespace.
25 Here is an informal grammar:
29 A configuration file consists of a set of values.
31 \fBvalue = section | assignment\fP
33 A value can either be a new section, or an assignment.
35 \fBsection = identifier '{' value* '}'\fP
37 A section is groups associated values together.
39 It is denoted by a name and delimited by curly brackets.
47 \fBassignment = identifier '=' (array | type)\fP
49 An assignment associates a type with an identifier.
51 e.g. max_archives = 42
54 \fBarray = '[' (type ',')* type ']' | '[' ']'\fP
56 Inhomogeneous arrays are supported.
58 Elements must be separated by commas.
60 An empty array is acceptable.
62 \fBtype = integer | float | string\fP
63 \fBinteger = [0-9]*\fP
65 \fBfloat = [0-9]*\.[0-9]*\fP
67 \fBstring = '"' .* '"'\fP
69 Strings must be enclosed in double quotes.
73 The sections that may be present in the file are:
75 \fBdevices\fP \(em Device settings
77 \fBdir\fP \(em Directory in which to create volume group device nodes.
78 Defaults to "/dev". Commands also accept this as a prefix on volume
81 \fBscan\fP \(em List of directories to scan recursively for
83 Devices in directories outside this hierarchy will be ignored.
86 \fBpreferred_names\fP \(em List of patterns compared in turn against
87 all the pathnames referencing the same device in in the scanned directories.
88 The pathname that matches the earliest pattern in the list is the
89 one used in any output. As an example, if device-mapper multipathing
90 is used, the following will select multipath device names:
92 \fBdevices { preferred_names = [ "^/dev/mapper/mpath" ] }\fP
94 \fBfilter\fP \(em List of patterns to apply to devices found by a scan.
95 Patterns are regular expressions delimited by any character and preceded
96 by \fBa\fP (for accept) or \fBr\fP (for reject). The list is traversed
97 in order, and the first regex that matches determines if the device
98 will be accepted or rejected (ignored). Devices that don't match
99 any patterns are accepted. If you want to reject patterns that
100 don't match, end the list with "r/.*/".
101 If there are several names for the same device (e.g. symbolic links
102 in /dev), if any name matches any \fBa\fP pattern, the
103 device is accepted; otherwise if any name matches any \fBr\fP
104 pattern it is rejected; otherwise it is accepted.
105 As an example, to ignore /dev/cdrom you could use:
107 \fBdevices { filter=["r|cdrom|"] }\fP
109 \fBcache_dir\fP \(em Persistent filter cache file directory.
110 Defaults to "/etc/lvm/cache".
112 \fBwrite_cache_state\fP \(em Set to 0 to disable the writing out of the
113 persistent filter cache file when \fBlvm\fP exits.
116 \fBtypes\fP \(em List of pairs of additional acceptable block device types
117 found in /proc/devices together with maximum (non-zero) number of
118 partitions (normally 16). By default, LVM2 supports ide, sd, md, loop,
119 dasd, dac960, nbd, ida, cciss, ubd, ataraid, drbd, power2, i2o_block
120 and iseries/vd. Block devices with major
121 numbers of different types are ignored by LVM2.
122 Example: \fBtypes = ["fd", 16]\fP.
123 To create physical volumes on device-mapper volumes
124 created outside LVM2, perhaps encrypted ones from \fBcryptsetup\fP,
125 you'll need \fBtypes = ["device-mapper", 16]\fP. But if you do this,
126 be careful to avoid recursion within LVM2. The figure for number
127 of partitions is not currently used in LVM2 - and might never be.
129 \fBsysfs_scan\fP (em If set to 1 and your kernel supports sysfs and
130 it is mounted, sysfs will be used as a quick way of filtering out
131 block devices that are not present.
133 \fBmd_component_detection\fP (em If set to 1, LVM2 will ignore devices
134 used as components of software RAID (md) devices by looking for md
135 superblocks. This doesn't always work satisfactorily e.g. if a device
136 has been reused without wiping the md superblocks first.
138 \fBlog\fP \(em Default log settings
140 \fBfile\fP \(em Location of log file. If this entry is not present, no
143 \fBoverwrite\fP \(em Set to 1 to overwrite the log file each time a tool
144 is invoked. By default tools append messages to the log file.
146 \fBlevel\fP \(em Log level (0-9) of messages to write to the file.
147 9 is the most verbose; 0 should produce no output.
149 \fBverbose\fP \(em Default level (0-3) of messages sent to stdout or stderr.
150 3 is the most verbose; 0 should produce the least output.
152 \fBsyslog\fP \(em Set to 1 (the default) to send log messages through syslog.
153 Turn off by setting to 0. If you set to an integer greater than one,
154 this is used - unvalidated - as the facility. The default is LOG_USER.
155 See /usr/include/sys/syslog.h for safe facility values to use.
156 For example, LOG_LOCAL0 might be 128.
158 \fBindent\fP \(em When set to 1 (the default) messages are indented
159 according to their severity, two spaces per level.
160 Set to 0 to turn off indentation.
162 \fBcommand_names\fP \(em When set to 1, the command name is used as a
163 prefix for each message.
166 \fBprefix\fP \(em Prefix used for all messages (after the command name).
167 Default is two spaces.
169 \fBactivation\fP \(em Set to 1 to log messages while
170 devices are suspended during activation.
171 Only set this temporarily while debugging a problem because
172 in low memory situations this setting can cause your machine to lock up.
174 \fBbackup\fP \(em Configuration for metadata backups.
176 \fBarchive_dir\fP \(em Directory used for automatic metadata archives.
177 Backup copies of former metadata for each volume group are archived here.
178 Defaults to "/etc/lvm/archive".
180 \fBbackup_dir\fP \(em Directory used for automatic metadata backups.
181 A single backup copy of the current metadata for each volume group
183 Defaults to "/etc/lvm/backup".
185 \fBarchive\fP \(em Whether or not tools automatically archive existing
186 metadata into \fBarchive_dir\fP before making changes to it.
187 Default is 1 (automatic archives enabled).
189 Disabling this might make metadata recovery difficult or impossible
190 if something goes wrong.
192 \fBbackup\fP \(em Whether or not tools make an automatic backup
193 into \fBbackup_dir\fP after changing metadata.
194 Default is 1 (automatic backups enabled). Set to 0 to disable.
195 Disabling this might make metadata recovery difficult or impossible
196 if something goes wrong.
198 \fBretain_min\fP \(em Minimum number of archives to keep.
201 \fBretain_days\fP \(em Minimum number of days to keep archive files.
204 \fBshell\fP \(em LVM2 built-in readline shell settings
206 \fBhistory_size\fP \(em Maximum number of lines of shell history to retain (default 100) in $HOME/.lvm_history
208 \fBglobal\fP \(em Global settings
210 \fBtest\fP \(em If set to 1, run tools in test mode i.e. no changes to
211 the on-disk metadata will get made. It's equivalent to having the
212 -t option on every command.
214 \fBactivation\fP \(em Set to 0 to turn off all communication with
215 the device-mapper driver. Useful if you want to manipulate logical
216 volumes while device-mapper is not present in your kernel.
218 \fBproc\fP \(em Mount point of proc filesystem.
221 \fBumask\fP \(em File creation mask for any files and directories created.
222 Interpreted as octal if the first digit is zero.
224 Use 022 to allow other users to read the files by default.
226 \fBformat\fP \(em The default value of \fB--metadatatype\fP used
227 to determine which format of metadata to use when creating new
228 physical volumes and volume groups. \fBlvm1\fP or \fBlvm2\fP.
230 \fBfallback_to_lvm1\fP \(em Set this to 1 if you need to
231 be able to switch between 2.4 kernels using LVM1 and kernels
232 including device-mapper.
233 The LVM2 tools should be installed as normal and
234 the LVM1 tools should be installed with a .lvm1 suffix e.g.
236 If an LVM2 tool is then run but unable to communicate
237 with device-mapper, it will automatically invoke the equivalent LVM1
238 version of the tool. Note that for LVM1 tools to
239 manipulate physical volumes and volume groups created by LVM2 you
240 must use \fB--metadataformat lvm1\fP when creating them.
242 \fBlibrary_dir\fP \(em A directory searched for LVM2's shared libraries
243 ahead of the places \fBdlopen\fP (3) searches.
245 \fBformat_libraries\fP \(em A list of shared libraries to load that contain
246 code to process different formats of metadata. For example, liblvm2formatpool.so
247 is needed to read GFS pool metadata if LVM2 was configured \fB--with-pool=shared\fP.
249 \fBlocking_type\fP \(em What type of locking to use.
250 1 is the default, which use flocks on files in \fBlocking_dir\fP
252 avoid conflicting LVM2 commands running concurrently on a single
253 machine. 0 disables locking and risks corrupting your metadata.
254 If set to 2, the tools will load the external \fBlocking_library\fP
256 If the tools were configured \fB--with-cluster=internal\fP
257 (the default) then 3 means to use built-in cluster-wide locking.
258 All changes to logical volumes and their states are communicated
261 \fBlocking_dir\fP \(em The directory LVM2 places its file locks
262 if \fBlocking_type\fP is set to 1. The default is \fB/var/lock/lvm\fP.
264 \fBlocking_library\fP \(em The name of the external locking
265 library to load if \fBlocking_type\fP is set to 2.
266 The default is \fBliblvm2clusterlock.so\fP. If you need to write
267 such a library, look at the lib/locking source code directory.
269 \fBtags\fP \(em Host tag settings
271 \fBhosttags\fP \(em If set to 1, create a host tag with the machine name.
272 Setting this to 0 does nothing, neither creating nor destroying any tag.
273 The machine name used is the nodename as returned by \fBuname\fP (2).
275 Additional host tags to be set can be listed here as subsections.
276 The @ prefix for tags is optional.
277 Each of these host tag subsections can contain a \fBhost_list\fP
278 array of host names. If any one of these entries matches the machine
279 name exactly then the host tag gets defined on this particular host,
280 otherwise it doesn't.
282 After lvm.conf has been processed, LVM2 works through each host
283 tag that has been defined in turn, and if there is a configuration
284 file called lvm_\fB<host_tag>\fP.conf it attempts to load it.
285 Any settings read in override settings found in earlier files.
286 Any additional host tags defined get appended to the search list,
287 so in turn they can lead to further configuration files being processed.
288 Use \fBlvm dumpconfig\fP to check the result of config
291 The following example always sets host tags \fBtag1\fP and
292 sets \fBtag2\fP on machines fs1 and fs2:
294 tags { tag1 { } tag2 { host_list = [ "fs1", "fs2" ] } }
296 These options are useful if you are replicating configuration files
297 around a cluster. Use of \fBhosttags = 1\fP means every machine
298 can have static and identical local configuration files yet use
299 different settings and activate different logical volumes by
300 default. See also \fBvolume_list\fP below and \fB--addtag\fP
303 \fBactivation\fP \(em Settings affecting device-mapper activation
305 \fBmissing_stripe_filler\fP \(em When activating an incomplete logical
306 volume in partial mode, this option dictates how the missing data is
307 replaced. A value of "error" will cause activation to create error
308 mappings for the missing data, meaning that read access to missing
309 portions of the volume will result in I/O errors. You can instead also
310 use a device path, and in that case this device will be used in place of
311 missing stripes. However, note that using anything other than
312 "error" with mirrored or snapshotted volumes is likely to result in data
313 corruption. For instructions on how to create a device that always
314 returns zeros, see \fBlvcreate\fP (8).
316 \fBmirror_region_size\fP \(em Unit size in KB for copy operations
319 \fBreadahead\fP \(em Used when there is no readahead value stored
320 in the volume group metadata. Set to \fBnone\fP to disable
321 readahead in these circumstances or \fBauto\fP to use the default
322 value chosen by the kernel.
324 \fBreserved_memory\fP, \fBreserved_stack\fP \(em How many KB to reserve
325 for LVM2 to use while logical volumes are suspended. If insufficient
326 memory is reserved before suspension, there is a risk of machine deadlock.
328 \fBprocess_priority\fP \(em The nice value to use while devices are
329 suspended. This is set to a high priority so that logical volumes
330 are suspended (with I/O generated by other processes to those
331 logical volumes getting queued) for the shortest possible time.
333 \fBvolume_list\fP \(em This acts as a filter through which
334 all requests to activate a logical volume on this machine
335 are passed. A logical volume is only activated if it matches
336 an item in the list. Tags must be preceded by @ and are checked
337 against all tags defined in the logical volume and volume group
338 metadata for a match.
339 @* is short-hand to check every tag set on the host machine (see
341 Logical volume and volume groups can also be included in the list
342 by name e.g. vg00, vg00/lvol1.
344 \fBmetadata\fP \(em Advanced metadata settings
346 \fBpvmetadatacopies\fP \(em When creating a physical volume using the
347 LVM2 metadata format, this is the default number of copies of metadata
348 to store on each physical volume.
349 Currently it can be set to 0, 1 or 2. The default is 1.
350 If set to 2, one copy is placed at the beginning of the disk
351 and the other is placed at the end.
352 It can be overridden on the command line with \fB--metadatacopies\fP.
353 If creating a volume group with just one physical volume, it's a
354 good idea to have 2 copies. If creating a large volume group with
355 many physical volumes, you may decide that 3 copies of the metadata
356 is sufficient, i.e. setting it to 1 on three of the physical volumes,
357 and 0 on the rest. Every volume group must contain at least one
358 physical volume with at least 1 copy of the metadata (unless using
359 the text files described below). The disadvantage of having lots
360 of copies is that every time the tools access the volume group, every
361 copy of the metadata has to be accessed, and this slows down the
364 \fBpvmetadatasize\fP \(em Approximate number of sectors to set aside
365 for each copy of the metadata. Volume groups with large numbers of
366 physical or logical volumes, or volumes groups containing complex
367 logical volume structures will need additional space for their metadata.
368 The metadata areas are treated as circular buffers, so
369 unused space becomes filled with an archive of the most recent
370 previous versions of the metadata.
372 \fBdirs\fP \(em List of directories holding live copies of LVM2
373 metadata as text files. These directories must not be on logical
374 volumes. It is possible to use LVM2 with a couple of directories
375 here, preferably on different (non-logical-volume) filesystems
376 and with no other on-disk metadata, \fBpvmetadatacopies = 0\fP.
377 Alternatively these directories can be in addition to the
378 on-disk metadata areas. This feature was created during the
379 development of the LVM2 metadata before the new on-disk metadata
380 areas were designed and no longer gets tested.
381 It is not supported under low-memory conditions, and it is
382 important never to edit these metadata files unless you fully
383 understand how things work: to make changes you should always use
384 the tools as normal, or else vgcfgbackup, edit backup, vgcfgrestore.
389 .I /etc/lvm/cache/.cache