blob: ae884beecb650c1d12184e86de92a468db048a91 [file] [log] [blame]
.TH LVM.CONF 5 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
lvm.conf \(em Configuration file for LVM2
.B #DEFAULT_SYS_DIR#/lvm.conf
\fBlvm.conf\fP is loaded during the initialisation phase of
\fBlvm\fP(8). This file can in turn lead to other files
being loaded - settings read in later override earlier
settings. File timestamps are checked between commands and if
any have changed, all the files are reloaded.
The settings defined in lvm.conf can be overridden by any
of these extended configuration methods:
.B direct config override on command line
The \fB\-\-config ConfigurationString\fP command line option takes the
ConfigurationString as direct string representation of the configuration
to override the existing configuration. The ConfigurationString is of
exactly the same format as used in any LVM configuration file.
.B profile config
A profile is a set of selected customizable configuration settings
that are aimed to achieve a certain characteristics in various
environments or uses. It's used to override existing configuration.
Normally, the name of the profile should reflect that environment or use.
There are two groups of profiles recognised: \fBcommand profiles\fP and
\fBmetadata profiles\fP.
The \fBcommand profile\fP is used to override selected configuration
settings at global LVM command level - it is applied at the very beginning
of LVM command execution and it is used throughout the whole time of LVM
command execution. The command profile is applied by using the
\fB\-\-commandprofile ProfileName\fP command line option that is recognised by
all LVM2 commands.
The \fBmetadata profile\fP is used to override selected configuration
settings at Volume Group/Logical Volume level - it is applied independently
for each Volume Group/Logical Volume that is being processed. As such,
each Volume Group/Logical Volume can store the profile name used
in its metadata so next time the Volume Group/Logical Volume is
processed, the profile is applied automatically. If Volume Group and
any of its Logical Volumes have different profiles defined, the profile
defined for the Logical Volume is preferred. The metadata profile can be
attached/detached by using the \fBlvchange\fP and \fBvgchange\fP commands
and their \fB\-\-metadataprofile ProfileName\fP and
\fB\-\-detachprofile\fP options or the \fB\-\-metadataprofile\fP
option during creation when using \fBvgcreate\fP or \fBlvcreate\fP command.
The \fBvgs\fP and \fBlvs\fP reporting commands provide \fB-o vg_profile\fP
and \fB-o lv_profile\fP output options to show the metadata profile
currently attached to a Volume Group or a Logical Volume.
The set of options allowed for command profiles is mutually exclusive
when compared to the set of options allowed for metadata profiles. The
settings that belong to either of these two sets can't be mixed together
and LVM tools will reject such profiles.
LVM itself provides a few predefined configuration profiles.
Users are allowed to add more profiles with different values if needed.
For this purpose, there's the \fBcommand_profile_template.profile\fP
(for command profiles) and \fBmetadata_profile_template.profile\fP
(for metadata profiles) which contain all settings that are customizable
by profiles of certain type. Users are encouraged to copy these template
profiles and edit them as needed. Alternatively, the
\fBlvmconfig \-\-file <ProfileName.profile> \-\-type profilable-command <section>\fP
or \fBlvmconfig \-\-file <ProfileName.profile> \-\-type profilable-metadata <section>\fP
can be used to generate a configuration with profilable settings in either
of the type for given section and save it to new ProfileName.profile
(if the section is not specified, all profilable settings are reported).
The profiles are stored in #DEFAULT_PROFILE_DIR# directory by default.
This location can be changed by using the \fBconfig/profile_dir\fP setting.
Each profile configuration is stored in \fBProfileName.profile\fP file
in the profile directory. When referencing the profile, the \fB.profile\fP
suffix is left out.
.B tag config
See \fBtags\fP configuration setting description below.
When several configuration methods are used at the same time
and when LVM looks for the value of a particular setting, it traverses
this \fBconfig cascade\fP from left to right:
\fBdirect config override on command line\fP -> \fBcommand profile config\fP -> \fBmetadata profile config\fP -> \fBtag config\fP -> \fBlvmlocal.conf\fB -> \fBlvm.conf\fP
No part of this cascade is compulsory. If there's no setting value found at
the end of the cascade, a default value is used for that setting.
Use \fBlvmconfig\fP to check what settings are in use and what
the default values are.
This section describes the configuration file syntax.
Whitespace is not significant unless it is within quotes.
This provides a wide choice of acceptable indentation styles.
Comments begin with # and continue to the end of the line.
They are treated as whitespace.
Here is an informal grammar:
.BR file " = " value *
A configuration file consists of a set of values.
.BR value " = " section " | " assignment
A value can either be a new section, or an assignment.
.BR section " = " identifier " '" { "' " value "* '" } '
A section groups associated values together. If the same section is
encountered multiple times, the contents of all instances are concatenated
together in the order of appearance.
It is denoted by a name and delimited by curly brackets.
e.g. backup {
.BR assignment " = " identifier " '" = "' ( " array " | " type " )"
An assignment associates a type with an identifier. If the identifier contains
forward slashes, those are interpreted as path delimiters. The statement
\fBsection/key = value\fP is equivalent to \fBsection { key = value }\fP. If
multiple instances of the same key are encountered, only the last value is used
(and a warning is issued).
e.g. \fBlevel = 7\fP
.BR array " = '" [ "' ( " type " '" , "')* " type " '" ] "' | '" [ "' '" ] '
Inhomogeneous arrays are supported.
Elements must be separated by commas.
An empty array is acceptable.
.BR type " = " integer " | " float " | " string
.BR integer " = [0-9]*"
.BR float " = [0-9]*'" . '[0-9]*
.B string \fR= '\fB"\fR'.*'\fB"\fR'
Strings with spaces must be enclosed in double quotes, single words that start
with a letter can be left unquoted.
.B lvmconfig
command prints the LVM configuration settings in various ways.
See the man page
.BR lvmconfig (8).
Command to print a list of all possible config settings, with their
default values:
.B lvmconfig \-\-type default
Command to print a list of all possible config settings, with their
default values, and a full description of each as a comment:
.B lvmconfig \-\-type default --withcomments
Command to print a list of all possible config settings, with their
current values (configured, non-default values are shown):
.B lvmconfig \-\-type current
Command to print all config settings that have been configured with a
different value than the default (configured, non-default values are
.B lvmconfig \-\-type diff
Command to print a single config setting, with its default value,
and a full description, where "Section" refers to the config section,
e.g. global, and "Setting" refers to the name of the specific setting,
e.g. umask:
.B lvmconfig \-\-type default --withcomments Section/Setting
.I #DEFAULT_SYS_DIR#/lvm.conf
.I #DEFAULT_SYS_DIR#/lvmlocal.conf
.BR lvm (8)
.BR lvmconfig (8)