1LVM.CONF(5) File Formats Manual LVM.CONF(5)
2
3
4
6 lvm.conf - Configuration file for LVM2
7
9 /etc/lvm/lvm.conf
10
12 lvm.conf is loaded during the initialisation phase of lvm (8). This
13 file can in turn lead to other files being loaded - settings read in
14 later override earlier settings. File timestamps are checked between
15 commands and if any have changed, all the files are reloaded.
16
17 Use lvm dumpconfig to check what settings are in use.
18
20 This section describes the configuration file syntax.
21
22 Whitespace is not significant unless it is within quotes. This pro‐
23 vides a wide choice of acceptable indentation styles. Comments begin
24 with # and continue to the end of the line. They are treated as white‐
25 space.
26
27 Here is an informal grammar:
28
29 file = value*
30 A configuration file consists of a set of values.
31
32 value = section | assignment
33 A value can either be a new section, or an assignment.
34
35 section = identifier '{' value* '}'
36 A section is groups associated values together.
37 It is denoted by a name and delimited by curly brackets.
38 e.g. backup {
39 ...
40 }
41
42 assignment = identifier '=' (array | type)
43 An assignment associates a type with an identifier.
44 e.g. max_archives = 42
45
46 array = '[' (type ',')* type ']' | '[' ']'
47 Inhomogeneous arrays are supported.
48 Elements must be separated by commas.
49 An empty array is acceptable.
50
51 type = integer | float | string
52 integer = [0-9]*
53 float = [0-9]*.[0-9]*
54 string = '"' .* '"'
55
56 Strings must be enclosed in double quotes.
57
58
60 The sections that may be present in the file are:
61
62 devices — Device settings
63
64 dir — Directory in which to create volume group device nodes.
65 Defaults to "/dev". Commands also accept this as a prefix on
66 volume group names.
67
68 scan — List of directories to scan recursively for LVM physical
69 volumes. Devices in directories outside this hierarchy will be
70 ignored. Defaults to "/dev".
71
72 filter — List of patterns to apply to devices found by a scan.
73 Patterns are regular expressions delimited by any character and
74 preceded by a (for accept) or r (for reject). The list is tra‐
75 versed in order, and the first regex that matches determines if
76 the device will be accepted or rejected (ignored). Devices that
77 don't match any patterns are accepted. If you want to reject
78 patterns that don't match, end the list with "r/.*/". If there
79 are several names for the same device (e.g. symbolic links in
80 /dev), if any name matches any a pattern, the device is
81 accepted; otherwise if any name matches any r pattern it is
82 rejected; otherwise it is accepted. As an example, to ignore
83 /dev/cdrom you could use: devices { filter=["r|cdrom|"] }
84
85 cache_dir — Persistent filter cache file directory. Defaults to
86 "/etc/lvm/cache".
87
88 write_cache_state — Set to 0 to disable the writing out of the
89 persistent filter cache file when lvm exits. Defaults to 1.
90
91 types — List of pairs of additional acceptable block device
92 types found in /proc/devices together with maximum (non-zero)
93 number of partitions (normally 16). By default, LVM2 supports
94 ide, sd, md, loop, dasd, dac960, nbd, ida, cciss, ubd, ataraid,
95 drbd, power2, i2o_block and iseries/vd. Block devices with
96 major numbers of different types are ignored by LVM2. Example:
97 types = ["fd", 16]. To create physical volumes on device-mapper
98 volumes created outside LVM2, perhaps encrypted ones from crypt‐
99 setup, you'll need types = ["device-mapper", 16]. But if you do
100 this, be careful to avoid recursion within LVM2. The figure for
101 number of partitions is not currently used in LVM2 - and might
102 never be.
103
104 sysfs_scan (em If set to 1 and your kernel supports sysfs and it
105 is mounted, sysfs will be used as a quick way of filtering out
106 block devices that are not present.
107
108 md_component_detection (em If set to 1, LVM2 will ignore devices
109 used as components of software RAID (md) devices by looking for
110 md superblocks. This doesn't always work satisfactorily e.g. if
111 a device has been reused without wiping the md superblocks
112 first.
113
114 log — Default log settings
115
116 file — Location of log file. If this entry is not present, no
117 log file is written.
118
119 overwrite — Set to 1 to overwrite the log file each time a tool
120 is invoked. By default tools append messages to the log file.
121
122 level — Log level (0-9) of messages to write to the file. 9 is
123 the most verbose; 0 should produce no output.
124
125 verbose — Default level (0-3) of messages sent to stdout or
126 stderr. 3 is the most verbose; 0 should produce the least out‐
127 put.
128
129 syslog — Set to 1 (the default) to send log messages through
130 syslog. Turn off by setting to 0. If you set to an integer
131 greater than one, this is used - unvalidated - as the facility.
132 The default is LOG_USER. See /usr/include/sys/syslog.h for safe
133 facility values to use. For example, LOG_LOCAL0 might be 128.
134
135 indent — When set to 1 (the default) messages are indented
136 according to their severity, two spaces per level. Set to 0 to
137 turn off indentation.
138
139 command_names — When set to 1, the command name is used as a
140 prefix for each message. Default is 0 (off).
141
142 prefix — Prefix used for all messages (after the command name).
143 Default is two spaces.
144
145 activation — Set to 1 to log messages while devices are sus‐
146 pended during activation. Only set this temporarily while
147 debugging a problem because in low memory situations this set‐
148 ting can cause your machine to lock up.
149
150 backup — Configuration for metadata backups.
151
152 archive_dir — Directory used for automatic metadata archives.
153 Backup copies of former metadata for each volume group are
154 archived here. Defaults to "/etc/lvm/archive".
155
156 backup_dir — Directory used for automatic metadata backups. A
157 single backup copy of the current metadata for each volume group
158 is stored here. Defaults to "/etc/lvm/backup".
159
160 archive — Whether or not tools automatically archive existing
161 metadata into archive_dir before making changes to it. Default
162 is 1 (automatic archives enabled). Set to 0 to disable. Dis‐
163 abling this might make metadata recovery difficult or impossible
164 if something goes wrong.
165
166 backup — Whether or not tools make an automatic backup into
167 backup_dir after changing metadata. Default is 1 (automatic
168 backups enabled). Set to 0 to disable. Disabling this might
169 make metadata recovery difficult or impossible if something goes
170 wrong.
171
172 retain_min — Minimum number of archives to keep. Defaults to
173 10.
174
175 retain_days — Minimum number of days to keep archive files.
176 Defaults to 30.
177
178 shell — LVM2 built-in readline shell settings
179
180 history_size — Maximum number of lines of shell history to
181 retain (default 100) in $HOME/.lvm_history
182
183 global — Global settings
184
185 test — If set to 1, run tools in test mode i.e. no changes to
186 the on-disk metadata will get made. It's equivalent to having
187 the -t option on every command.
188
189 activation — Set to 0 to turn off all communication with the
190 device-mapper driver. Useful if you want to manipulate logical
191 volumes while device-mapper is not present in your kernel.
192
193 proc — Mount point of proc filesystem. Defaults to /proc.
194
195 umask — File creation mask for any files and directories cre‐
196 ated. Interpreted as octal if the first digit is zero.
197 Defaults to 077. Use 022 to allow other users to read the files
198 by default.
199
200 format — The default value of --metadatatype used to determine
201 which format of metadata to use when creating new physical vol‐
202 umes and volume groups. lvm1 or lvm2.
203
204 fallback_to_lvm1 — Set this to 1 if you need to be able to
205 switch between 2.4 kernels using LVM1 and kernels including
206 device-mapper. The LVM2 tools should be installed as normal and
207 the LVM1 tools should be installed with a .lvm1 suffix e.g.
208 vgscan.lvm1. If an LVM2 tool is then run but unable to communi‐
209 cate with device-mapper, it will automatically invoke the equiv‐
210 alent LVM1 version of the tool. Note that for LVM1 tools to
211 manipulate physical volumes and volume groups created by LVM2
212 you must use --metadataformat lvm1 when creating them.
213
214 library_dir — A directory searched for LVM2's shared libraries
215 ahead of the places dlopen (3) searches.
216
217 format_libraries — A list of shared libraries to load that con‐
218 tain code to process different formats of metadata. For example,
219 liblvm2formatpool.so is needed to read GFS pool metadata if LVM2
220 was configured --with-pool=shared.
221
222 locking_type — What type of locking to use. 1 is the default,
223 which use flocks on files in locking_dir (see below) to avoid
224 conflicting LVM2 commands running concurrently on a single
225 machine. 0 disables locking and risks corrupting your metadata.
226 If set to 2, the tools will load the external locking_library
227 (see below). If the tools were configured --with-cluster=inter‐
228 nal (the default) then 3 means to use built-in cluster-wide
229 locking. All changes to logical volumes and their states are
230 communicated using locks.
231
232 locking_dir — The directory LVM2 places its file locks if lock‐
233 ing_type is set to 1. The default is /var/lock/lvm.
234
235 locking_library — The name of the external locking library to
236 load if locking_type is set to 2. The default is liblvm2clus‐
237 terlock.so. If you need to write such a library, look at the
238 lib/locking source code directory.
239
240 tags — Host tag settings
241
242 hosttags — If set to 1, create a host tag with the machine name.
243 Setting this to 0 does nothing, neither creating nor destroying
244 any tag. The machine name used is the nodename as returned by
245 uname (2).
246
247 Additional host tags to be set can be listed here as subsec‐
248 tions. The @ prefix for tags is optional. Each of these host
249 tag subsections can contain a host_list array of host names. If
250 any one of these entries matches the machine name exactly then
251 the host tag gets defined on this particular host, otherwise it
252 doesn't.
253
254 After lvm.conf has been processed, LVM2 works through each host
255 tag that has been defined in turn, and if there is a configura‐
256 tion file called lvm_<host_tag>.conf it attempts to load it.
257 Any settings read in override settings found in earlier files.
258 Any additional host tags defined get appended to the search
259 list, so in turn they can lead to further configuration files
260 being processed. Use lvm dumpconfig to check the result of con‐
261 fig file processing.
262
263 The following example always sets host tags tag1 and sets tag2
264 on machines fs1 and fs2:
265
266 tags { tag1 { } tag2 { host_list = [ "fs1", "fs2" ] } }
267
268 These options are useful if you are replicating configuration
269 files around a cluster. Use of hosttags = 1 means every machine
270 can have static and identical local configuration files yet use
271 different settings and activate different logical volumes by
272 default. See also volume_list below and --addtag in lvm (8).
273
274 activation — Settings affecting device-mapper activation
275
276 missing_stripe_filler — When activating an incomplete logical
277 volume in partial mode, this missing data is replaced with this
278 device. It could perhaps be a block device that always returns
279 an error when it is accessed, or one that always returns zeros.
280 See lvcreate (8) for how to create such devices.
281
282 mirror_region_size — Unit size in KB for copy operations when
283 mirroring.
284
285 reserved_memory, reserved_stack — How many KB to reserve for
286 LVM2 to use while logical volumes are suspended. If insuffi‐
287 cient memory is reserved before suspension, there is a risk of
288 machine deadlock.
289
290 process_priority — The nice value to use while devices are sus‐
291 pended. This is set to a high priority so that logical volumes
292 are suspended (with I/O generated by other processes to those
293 logical volumes getting queued) for the shortest possible time.
294
295 volume_list — This acts as a filter through which all requests
296 to activate a logical volume on this machine are passed. A log‐
297 ical volume is only activated if it matches an item in the list.
298 Tags must be preceded by @ and are checked against all tags
299 defined in the logical volume and volume group metadata for a
300 match. @* is short-hand to check every tag set on the host
301 machine (see tags above). Logical volume and volume groups can
302 also be included in the list by name e.g. vg00, vg00/lvol1.
303
304 metadata — Advanced metadata settings
305
306 pvmetadatacopies — When creating a physical volume using the
307 LVM2 metadata format, this is the default number of copies of
308 metadata to store on each physical volume. Currently it can be
309 set to 0, 1 or 2. The default is 1. If set to 2, one copy is
310 placed at the beginning of the disk and the other is placed at
311 the end. It can be overridden on the command line with --meta‐
312 datacopies. If creating a volume group with just one physical
313 volume, it's a good idea to have 2 copies. If creating a large
314 volume group with many physical volumes, you may decide that 3
315 copies of the metadata is sufficient, i.e. setting it to 1 on
316 three of the physical volumes, and 0 on the rest. Every volume
317 group must contain at least one physical volume with at least 1
318 copy of the metadata (unless using the text files described
319 below). The disadvantage of having lots of copies is that every
320 time the tools access the volume group, every copy of the meta‐
321 data has to be accessed, and this slows down the tools.
322
323 pvmetadatasize — Approximate number of sectors to set aside for
324 each copy of the metadata. Volume groups with large numbers of
325 physical or logical volumes, or volumes groups containing com‐
326 plex logical volume structures will need additional space for
327 their metadata. The metadata areas are treated as circular buf‐
328 fers, so unused space becomes filled with an archive of the most
329 recent previous versions of the metadata.
330
331 dirs — List of directories holding live copies of LVM2 metadata
332 as text files. These directories must not be on logical vol‐
333 umes. It is possible to use LVM2 with a couple of directories
334 here, preferably on different (non-logical-volume) filesystems
335 and with no other on-disk metadata, pvmetadatacopies = 0.
336 Alternatively these directories can be in addition to the on-
337 disk metadata areas. This feature was created during the devel‐
338 opment of the LVM2 metadata before the new on-disk metadata
339 areas were designed and no longer gets tested. It is not sup‐
340 ported under low-memory conditions, and it is important never to
341 edit these metadata files unless you fully understand how things
342 work: to make changes you should always use the tools as normal,
343 or else vgcfgbackup, edit backup, vgcfgrestore.
344
346 /etc/lvm/lvm.conf /etc/lvm/archive /etc/lvm/backup
347 /etc/lvm/cache/.cache /var/lock/lvm
348
350 lvm(8), umask(2), uname(2), dlopen(3), syslog(3), syslog.conf(5)
351
352
353
354Sistina Software UK LVM TOOLS LVM.CONF(5)