1LVM.CONF(5)                   File Formats Manual                  LVM.CONF(5)
2
3
4

NAME

6       lvm.conf - Configuration file for LVM2
7

SYNOPSIS

9       /etc/lvm/lvm.conf
10

DESCRIPTION

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

SYNTAX

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

SECTIONS

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              preferred_names  — List of patterns compared in turn against all
73              the pathnames referencing the same  device  in  in  the  scanned
74              directories.   The pathname that matches the earliest pattern in
75              the list is the one used in  any  output.   As  an  example,  if
76              device-mapper  multipathing  is  used, the following will select
77              multipath device names:
78              devices { preferred_names = [ "^/dev/mapper/mpath" ] }
79
80              filter — List of patterns to apply to devices found by  a  scan.
81              Patterns  are regular expressions delimited by any character and
82              preceded by a (for accept) or r (for reject).  The list is  tra‐
83              versed  in order, and the first regex that matches determines if
84              the device will be accepted or rejected (ignored).  Devices that
85              don't  match  any  patterns  are accepted. If you want to reject
86              patterns that don't match, end the list with "r/.*/".  If  there
87              are  several  names  for the same device (e.g. symbolic links in
88              /dev), if  any  name  matches  any  a  pattern,  the  device  is
89              accepted;  otherwise  if  any  name  matches any r pattern it is
90              rejected; otherwise it is accepted.  As an  example,  to  ignore
91              /dev/cdrom you could use:
92              devices { filter=["r|cdrom|"] }
93
94              cache_dir — Persistent filter cache file directory.  Defaults to
95              "/etc/lvm/cache".
96
97              write_cache_state — Set to 0 to disable the writing out  of  the
98              persistent filter cache file when lvm exits.  Defaults to 1.
99
100              types  —  List  of  pairs  of additional acceptable block device
101              types found in /proc/devices together  with  maximum  (non-zero)
102              number  of  partitions (normally 16).  By default, LVM2 supports
103              ide, sd, md, loop, dasd, dac960, nbd, ida, cciss, ubd,  ataraid,
104              drbd,  power2,  i2o_block  and  iseries/vd.   Block devices with
105              major numbers of different types are ignored by LVM2.   Example:
106              types = ["fd", 16].  To create physical volumes on device-mapper
107              volumes created outside LVM2, perhaps encrypted ones from crypt‐
108              setup, you'll need types = ["device-mapper", 16].  But if you do
109              this, be careful to avoid recursion within LVM2.  The figure for
110              number  of  partitions is not currently used in LVM2 - and might
111              never be.
112
113              sysfs_scan — If set to 1 and your kernel supports sysfs  and  it
114              is  mounted,  sysfs will be used as a quick way of filtering out
115              block devices that are not present.
116
117              md_component_detection — If set to 1, LVM2 will  ignore  devices
118              used  as components of software RAID (md) devices by looking for
119              md superblocks. This doesn't always work satisfactorily e.g.  if
120              a  device  has  been  reused  without  wiping the md superblocks
121              first.
122
123              md_chunk_alignment — If set to  1,  and  a  Physical  Volume  is
124              placed  directly  upon  an  md  device, LVM2 will align its data
125              blocks with the md device's stripe-width.
126
127              data_alignment_detection — If set to 1, and your kernel provides
128              topology information in sysfs for the Physical Volume, the start
129              of data area will  be  aligned  on  a  multiple  of  the  ’mini‐
130              mum_io_size’  or  ’optimal_io_size’  exposed  in  sysfs.   mini‐
131              mum_io_size is the smallest request the device can perform with‐
132              out  incurring  a  read-modify-write  penalty  (e.g.  MD's chunk
133              size).   optimal_io_size  is  the  device's  preferred  unit  of
134              receiving I/O (e.g. MD's stripe width).  minimum_io_size is used
135              if optimal_io_size is undefined (0).  If both md_chunk_alignment
136              and   data_alignment_detection   are   enabled   the  result  of
137              data_alignment_detection is used.
138
139              data_alignment — Default alignment (in KB) of start of data area
140              when creating a new Physical Volume using the lvm2 format.  If a
141              Physical Volume  is  placed  directly  upon  an  md  device  and
142              md_chunk_alignment  or  data_alignment_detection is enabled this
143              parameter is ignored.  Set to 0 to use the default alignment  of
144              64KB or the page size, if larger.
145
146              data_alignment_offset_detection  —  If set to 1, and your kernel
147              provides topology information in sysfs for the Physical  Volume,
148              the  start  of the aligned data area of the Physical Volume will
149              be shifted by the alignment_offset exposed in sysfs.
150
151              To see the location of the first Physical Extent of an  existing
152              Physical Volume use pvs -o +pe_start .  It will be a multiple of
153              the requested  data_alignment  plus  the  alignment_offset  from
154              data_alignment_offset_detection  (if  enabled)  or  the pvcreate
155              commandline.
156
157              disable_after_error_count — During  each  LVM  operation  errors
158              received from each device are counted.  If the counter of a par‐
159              ticular device exceeds the limit set here,  no  further  I/O  is
160              sent  to  that device for the remainder of the respective opera‐
161              tion. Setting the parameter to 0  disables  the  counters  alto‐
162              gether.
163
164       allocation — Space allocation policies
165
166              cling_tag_list — List of PV tags matched by the cling allocation
167              policy.
168
169              When searching for free space to extend an LV, the cling alloca‐
170              tion  policy  will choose space on the same PVs as the last seg‐
171              ment of the existing LV.  If there is insufficient space  and  a
172              list  of tags is defined here, it will check whether any of them
173              are attached to the PVs concerned and then seek to  match  those
174              PV tags between existing extents and new extents.
175
176              The  @ prefix for tags is required.  Use the special tag "@*" as
177              a wildcard to match any PV tag and so use all PV tags  for  this
178              purpose.
179
180              For  example, LVs are mirrored between two sites within a single
181              VG.  PVs are tagged with either @site1  or  @site2  to  indicate
182              where  they  are situated and these two PV tags are selected for
183              use with this allocation policy:
184
185              cling_tag_list = [ "@site1", "@site2" ]
186
187       log — Default log settings
188
189              file — Location of log file.  If this entry is not  present,  no
190              log file is written.
191
192              overwrite  — Set to 1 to overwrite the log file each time a tool
193              is invoked.  By default tools append messages to the log file.
194
195              level — Log level (0-9) of messages to write to the file.  9  is
196              the most verbose; 0 should produce no output.
197
198              verbose  —  Default  level  (0-3)  of messages sent to stdout or
199              stderr.  3 is the most verbose; 0 should produce the least  out‐
200              put.
201
202              syslog  —  Set  to  1 (the default) to send log messages through
203              syslog.  Turn off by setting to 0.  If you  set  to  an  integer
204              greater  than one, this is used - unvalidated - as the facility.
205              The default is LOG_USER.  See /usr/include/sys/syslog.h for safe
206              facility values to use.  For example, LOG_LOCAL0 might be 128.
207
208              indent  —  When  set  to  1  (the default) messages are indented
209              according to their severity, two spaces per level.  Set to 0  to
210              turn off indentation.
211
212              command_names  —  When  set  to 1, the command name is used as a
213              prefix for each message.  Default is 0 (off).
214
215              prefix — Prefix used for all messages (after the command  name).
216              Default is two spaces.
217
218              activation  —  Set  to  1 to log messages while devices are sus‐
219              pended during  activation.   Only  set  this  temporarily  while
220              debugging  a  problem because in low memory situations this set‐
221              ting can cause your machine to lock up.
222
223       backup — Configuration for metadata backups.
224
225              archive_dir — Directory used for  automatic  metadata  archives.
226              Backup  copies  of  former  metadata  for  each volume group are
227              archived here.  Defaults to "/etc/lvm/archive".
228
229              backup_dir — Directory used for automatic metadata  backups.   A
230              single backup copy of the current metadata for each volume group
231              is stored here.  Defaults to "/etc/lvm/backup".
232
233              archive — Whether or not tools  automatically  archive  existing
234              metadata  into archive_dir before making changes to it.  Default
235              is 1 (automatic archives enabled).  Set to 0 to  disable.   Dis‐
236              abling this might make metadata recovery difficult or impossible
237              if something goes wrong.
238
239              backup — Whether or not tools  make  an  automatic  backup  into
240              backup_dir  after  changing  metadata.   Default is 1 (automatic
241              backups enabled).  Set to 0 to disable.   Disabling  this  might
242              make metadata recovery difficult or impossible if something goes
243              wrong.
244
245              retain_min — Minimum number of archives to  keep.   Defaults  to
246              10.
247
248              retain_days  —  Minimum  number  of  days to keep archive files.
249              Defaults to 30.
250
251       shell — LVM2 built-in readline shell settings
252
253              history_size — Maximum number  of  lines  of  shell  history  to
254              retain (default 100) in $HOME/.lvm_history
255
256       global — Global settings
257
258              test  —  If  set to 1, run tools in test mode i.e. no changes to
259              the on-disk metadata will get made.  It's equivalent  to  having
260              the -t option on every command.
261
262              activation  —  Set  to  0 to turn off all communication with the
263              device-mapper driver.  Useful if you want to manipulate  logical
264              volumes while device-mapper is not present in your kernel.
265
266              proc — Mount point of proc filesystem.  Defaults to /proc.
267
268              umask  —  File  creation mask for any files and directories cre‐
269              ated.   Interpreted  as  octal  if  the  first  digit  is  zero.
270              Defaults to 077.  Use 022 to allow other users to read the files
271              by default.
272
273              format — The default value of --metadatatype used  to  determine
274              which  format of metadata to use when creating new physical vol‐
275              umes and volume groups. lvm1 or lvm2.
276
277              fallback_to_lvm1 — Set this to 1 if  you  need  to  be  able  to
278              switch  between  2.4  kernels  using  LVM1 and kernels including
279              device-mapper.  The LVM2 tools should be installed as normal and
280              the  LVM1  tools  should  be  installed with a .lvm1 suffix e.g.
281              vgscan.lvm1.  If an LVM2 tool is then run but unable to communi‐
282              cate with device-mapper, it will automatically invoke the equiv‐
283              alent LVM1 version of the tool.  Note that  for  LVM1  tools  to
284              manipulate  physical  volumes  and volume groups created by LVM2
285              you must use --metadataformat lvm1 when creating them.
286
287              library_dir — A directory searched for LVM2's  shared  libraries
288              ahead of the places dlopen (3) searches.
289
290              format_libraries  — A list of shared libraries to load that con‐
291              tain code to process different formats of metadata. For example,
292              liblvm2formatpool.so is needed to read GFS pool metadata if LVM2
293              was configured --with-pool=shared.
294
295              locking_type — What type of locking to use.  1 is  the  default,
296              which  use  flocks  on files in locking_dir (see below) to avoid
297              conflicting LVM2  commands  running  concurrently  on  a  single
298              machine.  0 disables locking and risks corrupting your metadata.
299              If set to 2, the tools will load  the  external  locking_library
300              (see below).  If the tools were configured --with-cluster=inter‐
301              nal (the default) then 3  means  to  use  built-in  cluster-wide
302              locking.   Type  4  enforces  read-only metadata and forbids any
303              operations that might want to modify Volume Group metadata.  All
304              changes  to  logical  volumes  and their states are communicated
305              using locks.
306
307              wait_for_locks — When set to 1, the default, the tools wait if a
308              lock  request  cannot  be satisfied immediately.  When set to 0,
309              the operation is aborted instead.
310
311              locking_dir — The directory LVM2 places its file locks if  lock‐
312              ing_type is set to 1.  The default is /var/lock/lvm.
313
314              locking_library  —  The  name of the external locking library to
315              load if locking_type is set to 2.  The default  is  liblvm2clus‐
316              terlock.so.   If  you  need to write such a library, look at the
317              lib/locking source code directory.
318
319       tags — Host tag settings
320
321              hosttags — If set to 1, create a host tag with the machine name.
322              Setting  this to 0 does nothing, neither creating nor destroying
323              any tag.  The machine name used is the nodename as  returned  by
324              uname (2).
325
326              Additional  host  tags  to  be set can be listed here as subsec‐
327              tions.  The @ prefix for tags is optional.  Each of  these  host
328              tag  subsections can contain a host_list array of host names. If
329              any one of these entries matches the machine name  exactly  then
330              the  host tag gets defined on this particular host, otherwise it
331              doesn't.
332
333              After lvm.conf has been processed, LVM2 works through each  host
334              tag  that has been defined in turn, and if there is a configura‐
335              tion file called lvm_<host_tag>.conf it  attempts  to  load  it.
336              Any  settings  read in override settings found in earlier files.
337              Any additional host tags defined  get  appended  to  the  search
338              list,  so  in  turn they can lead to further configuration files
339              being processed.  Use lvm dumpconfig to check the result of con‐
340              fig file processing.
341
342              The  following  example always sets host tags tag1 and sets tag2
343              on machines fs1 and fs2:
344
345              tags { tag1 { } tag2 { host_list = [ "fs1", "fs2" ] } }
346
347              These options are useful if you  are  replicating  configuration
348              files around a cluster.  Use of hosttags = 1 means every machine
349              can have static and identical local configuration files yet  use
350              different  settings  and  activate  different logical volumes by
351              default.  See also volume_list below and --addtag in lvm (8).
352
353       activation — Settings affecting device-mapper activation
354
355              missing_stripe_filler — When activating  an  incomplete  logical
356              volume  in  partial  mode,  this option dictates how the missing
357              data is replaced.  A value of "error" will cause  activation  to
358              create  error  mappings  for the missing data, meaning that read
359              access to missing portions of the  volume  will  result  in  I/O
360              errors. You can instead also use a device path, and in that case
361              this device will be used in place of missing  stripes.  However,
362              note  that  using  anything  other than "error" with mirrored or
363              snapshotted volumes is likely to result in data corruption.  For
364              instructions  on  how  to  create  a  device that always returns
365              zeros, see lvcreate (8).
366
367              mirror_region_size — Unit size in KB for  copy  operations  when
368              mirroring.
369
370              readahead  — Used when there is no readahead value stored in the
371              volume group metadata.  Set to  none  to  disable  readahead  in
372              these  circumstances  or auto to use the default value chosen by
373              the kernel.
374
375              reserved_memory, reserved_stack — How many  KB  to  reserve  for
376              LVM2  to  use  while logical volumes are suspended.  If insuffi‐
377              cient memory is reserved before suspension, there is a  risk  of
378              machine deadlock.
379
380              process_priority  — The nice value to use while devices are sus‐
381              pended.  This is set to a high priority so that logical  volumes
382              are  suspended  (with  I/O generated by other processes to those
383              logical volumes getting queued) for the shortest possible time.
384
385              volume_list — This acts as a filter through which  all  requests
386              to activate a logical volume on this machine are passed.  A log‐
387              ical volume is only activated if it matches an item in the list.
388              Tags  must  be  preceded  by  @ and are checked against all tags
389              defined in the logical volume and volume group  metadata  for  a
390              match.   @*  is  short-hand  to  check every tag set on the host
391              machine (see tags above).  Logical volume and volume groups  can
392              also be included in the list by name e.g. vg00, vg00/lvol1.
393
394       metadata — Advanced metadata settings
395
396              pvmetadatacopies  —  When  creating  a physical volume using the
397              LVM2 metadata format, this is the default number  of  copies  of
398              metadata  to store on each physical volume.  Currently it can be
399              set to 0, 1 or 2.  The default is 1.  If set to 2, one  copy  is
400              placed  at  the beginning of the disk and the other is placed at
401              the end.   It  can  be  overridden  on  the  command  line  with
402              --pvmetadatacopies  (see  pvcreate).  If creating a volume group
403              with just one physical volume,  it's  a  good  idea  to  have  2
404              copies.   If  creating  a  large volume group with many physical
405              volumes, you may decide that 3 copies of the metadata is  suffi‐
406              cient,  i.e.  setting  it to 1 on three of the physical volumes,
407              and 0 on the rest.  Every volume group must contain at least one
408              physical  volume  with  at  least 1 copy of the metadata (unless
409              using the text files described below).  The disadvantage of hav‐
410              ing  lots of copies is that every time the tools access the vol‐
411              ume group, every copy of the metadata has to  be  accessed,  and
412              this slows down the tools.
413
414              pvmetadatasize  — Approximate number of sectors to set aside for
415              each copy of the metadata. Volume groups with large  numbers  of
416              physical  or  logical volumes, or volumes groups containing com‐
417              plex logical volume structures will need  additional  space  for
418              their metadata.  The metadata areas are treated as circular buf‐
419              fers, so unused space becomes filled with an archive of the most
420              recent previous versions of the metadata.
421
422              pvmetadataignore  When creating a physical volume using the LVM2
423              metadata format, this states whether metadata  areas  should  be
424              ignored.   The  default is "n".  If metadata areas on a physical
425              volume are ignored, LVM will not not store metadata in the meta‐
426              data  areas  present  on  newly  created  Physical Volumes.  The
427              option can be overridden on the command line with  --metadataig‐
428              nore (See pvcreate and pvchange).  Metadata areas cannot be cre‐
429              ated or extended after Logical Volumes have  been  allocated  on
430              the  device.   If  you  do  not  want  to store metadata on this
431              device, it is still wise always to allocate a metadata area (use
432              a  non-zero value for --pvmetadatacopies) in case you need it in
433              the future and to use this option to instruct LVM2 to ignore it.
434
435              vgmetadatacopies — When creating a volume group using  the  LVM2
436              metadata  format,  this is the default number of copies of meta‐
437              data desired across all  the  physical  volumes  in  the  volume
438              group.   If  set to a non-zero value, LVM will automatically set
439              or clear the metadataignore flag on the  physical  volumes  (see
440              pvcreate  and pvchange --metadataignore) in order to achieve the
441              desired number of metadata copies.  An LVM command that adds  or
442              removes  physical  volumes  (for  example,  vgextend,  vgreduce,
443              vgsplit, or vgmerge), may cause  LVM  to  automatically  set  or
444              clear  the  metadataignore  flags.  Also, if physical volumes go
445              missing or reappear, or a new number of copies is explicitly set
446              (see  vgchange  --vgmetadatacopies),  LVM  may  adjust the meta‐
447              dataignore flags.  Set vgmetadatacopies to 0 instructs  LVM  not
448              to set or clear the metadataignore flags automatically.  You may
449              set a value larger than the sum of all  metadata  areas  on  all
450              physical  volumes.   The  value can be overridden on the command
451              line with --vgmetadatacopies for various commands (for  example,
452              vgcreate   and   vgchange),   and   can  be  queryied  with  the
453              vg_mda_copies field of vgs.  This option is  useful  for  volume
454              groups  containing  large numbers of physical volumes with meta‐
455              data as it may be used to minimize metadata read and write over‐
456              head.
457
458              dirs  — List of directories holding live copies of LVM2 metadata
459              as text files.  These directories must not be  on  logical  vol‐
460              umes.   It  is possible to use LVM2 with a couple of directories
461              here, preferably on different  (non-logical-volume)  filesystems
462              and  with  no  other  on-disk  metadata,  pvmetadatacopies  = 0.
463              Alternatively these directories can be in addition  to  the  on-
464              disk metadata areas.  This feature was created during the devel‐
465              opment of the LVM2 metadata  before  the  new  on-disk  metadata
466              areas  were  designed and no longer gets tested.  It is not sup‐
467              ported under low-memory conditions, and it is important never to
468              edit these metadata files unless you fully understand how things
469              work: to make changes you should always use the tools as normal,
470              or else vgcfgbackup, edit backup, vgcfgrestore.
471

FILES

473       /etc/lvm/lvm.conf            /etc/lvm/archive           /etc/lvm/backup
474       /etc/lvm/cache/.cache /var/lock/lvm
475

SEE ALSO

477       lvm(8), umask(2), uname(2), dlopen(3), syslog(3), syslog.conf(5)
478
479
480
481Sistina Software UK    LVM TOOLS 2.02.84(2) (2011-02-09)           LVM.CONF(5)
Impressum