1LVM(8) System Manager's Manual LVM(8)
2
3
4
6 lvm - LVM2 tools
7
9 lvm [command | file]
10
12 lvm provides the command-line tools for LVM2. A separate manual page
13 describes each command in detail.
14
15 If lvm is invoked with no arguments it presents a readline prompt
16 (assuming it was compiled with readline support). LVM commands may be
17 entered interactively at this prompt with readline facilities including
18 history and command name and option completion. Refer to readline(3)
19 for details.
20
21 If lvm is invoked with argv[0] set to the name of a specific LVM com‐
22 mand (for example by using a hard or soft link) it acts as that com‐
23 mand.
24
25 Where commands take VG or LV names as arguments, the full path name is
26 optional. An LV called "lvol0" in a VG called "vg0" can be specified
27 as "vg0/lvol0". Where a list of VGs is required but is left empty, a
28 list of all VGs will be substituted. Where a list of LVs is required
29 but a VG is given, a list of all the LVs in that VG will be substi‐
30 tuted. So "lvdisplay vg0" will display all the LVs in "vg0". Tags can
31 also be used - see addtag below.
32
33 One advantage of using the built-in shell is that configuration infor‐
34 mation gets cached internally between commands.
35
36 A file containing a simple script with one command per line can also be
37 given on the command line. The script can also be executed directly if
38 the first line is #! followed by the absolute path of lvm.
39
41 The following commands are built into lvm without links normally being
42 created in the filesystem for them.
43
44 dumpconfig — Display the configuration information after
45 loading lvm.conf (5) and any other configuration files.
46
47 formats — Display recognised metadata formats.
48
49 help — Display the help text.
50
51 pvdata — Not implemented in LVM2.
52
53 segtypes — Display recognised logical volume segment types.
54
55 version — Display version information.
56
57 The following commands are not implemented in LVM2 but might be in
58 future: lvmsadc, lvmsar, pvdata, pvresize.
59
61 The following options are available for many of the commands. They are
62 implemented generically and documented here rather than repeated on
63 individual manual pages.
64
65 -h | --help — Display the help text.
66
67 --version — Display version information.
68
69 -v | --verbose — Set verbose level.
70 Repeat from 1 to 3 times to increase the detail of messages sent
71 to stdout and stderr. Overrides config file setting.
72
73 -d | --debug — Set debug level.
74 Repeat from 1 to 6 times to increase the detail of messages sent
75 to the log file and/or syslog (if configured). Overrides config
76 file setting.
77
78 --quiet — Suppress output and log messages.
79 Overrides -d and -v.
80
81 -t | --test — Run in test mode.
82 Commands will not update metadata. This is implemented by dis‐
83 abling all metadata writing but nevertheless returning success
84 to the calling function. This may lead to unusual error mes‐
85 sages in multi-stage operations if a tool relies on reading back
86 metadata it believes has changed but hasn't.
87
88 --driverloaded { y | n }
89 Whether or not the device-mapper kernel driver is loaded. If
90 you set this to n, no attempt will be made to contact the
91 driver.
92
93 -A | --autobackup { y | n }
94 Whether or not to metadata should be backed up automatically
95 after a change. You are strongly advised not to disable this!
96 See vgcfgbackup (8).
97
98 -P | --partial
99 When set, the tools will do their best to provide access to vol‐
100 ume groups that are only partially available. Where part of a
101 logical volume is missing, /dev/ioerror will be substituted, and
102 you could use dmsetup (8) to set this up to return I/O errors
103 when accessed, or create it as a large block device of nulls.
104 Metadata may not be changed with this option. To insert a
105 replacement physical volume of the same or large size use pvcre‐
106 ate -u to set the uuid to match the original followed by vgcf‐
107 grestore (8).
108
109 -M | --metadatatype type
110 Specifies which type of on-disk metadata to use, such as lvm1 or
111 lvm2, which can be abbreviated to 1 or 2 respectively. The
112 default (lvm2) can be changed by setting format in the global
113 section of the config file.
114
115 --ignorelockingfailure
116 This lets you proceed with read-only metadata operations such as
117 lvchange -ay and vgchange -ay even if the locking module fails.
118 One use for this is in a system init script if the lock direc‐
119 tory is mounted read-only when the script runs.
120
121 --addtag tag
122 Add the tag tag to a PV, VG or LV. A tag is a word that can be
123 used to group LVM2 objects of the same type together. Tags can
124 be given on the command line in place of PV, VG or LV arguments.
125 Tags should be prefixed with @ to avoid ambiguity. Each tag is
126 expanded by replacing it with all objects possessing that tag
127 which are of the type expected by its position on the command
128 line. PVs can only possess tags while they are part of a Volume
129 Group: PV tags are discarded if the PV is removed from the VG.
130 As an example, you could tag some LVs as database and others as
131 userdata and then activate the database ones with lvchange -ay
132 @database. Objects can possess multiple tags simultaneously.
133 Only the new LVM2 metadata format supports tagging: objects
134 using the LVM1 metadata format cannot be tagged because the on-
135 disk format does not support it. Snapshots cannot be tagged.
136 Characters allowed in tags are: A-Z a-z 0-9 _ + . -
137
138 --deltag tag
139 Delete the tag tag from a PV, VG or LV, if it's present.
140
141 --alloc AllocationPolicy
142 The allocation policy to use: contiguous, cling, normal, any‐
143 where or inherit. When a command needs to allocate physical
144 extents from the volume group, the allocation policy controls
145 how they are chosen. Each volume group and logical volume has
146 an allocation policy. The default for a volume group is normal
147 which applies common-sense rules such as not placing parallel
148 stripes on the same physical volume. The default for a logical
149 volume is inherit which applies the same policy as for the vol‐
150 ume group. These policies can be changed using lvchange (8) and
151 vgchange [22m(8) or over-ridden on the command line of any command
152 that performs allocation. The contiguous policy requires that
153 new extents be placed adjacent to existing extents. The cling
154 policy places new extents on the same physical volume as exist‐
155 ing extents in the same stripe of the Logical Volume. If there
156 are sufficient free extents to satisfy an allocation request but
157 normal doesn't use them, anywhere will - even if that reduces
158 performance by placing two stripes on the same physical volume.
159
160 N.B. The policies described above are not implemented fully yet.
161 In particular, contiguous free space cannot be broken up to sat‐
162 isfy allocation attempts.
163
165 LVM_SYSTEM_DIR
166 Directory containing lvm.conf and other LVM system files.
167 Defaults to "/etc/lvm".
168
169 HOME Directory containing .lvm_history if the internal readline shell
170 is invoked.
171
172 LVM_VG_NAME
173 The volume group name that is assumed for any reference to a
174 logical volume that doesn't specify a path. Not set by default.
175
177 All tools return a status code of zero on success or non-zero on fail‐
178 ure.
179
181 /etc/lvm/lvm.conf
182 $HOME/.lvm_history
183
185 clvmd(8), lvchange(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm‐
186 change(8), lvmdiskscan(8), lvreduce(8), lvremove(8), lvrename(8), lvre‐
187 size(8), lvs(8), lvscan(8), pvchange(8), pvcreate(8), pvdisplay(8),
188 pvmove(8), pvremove(8), pvs(8), pvscan(8), vgcfgbackup(8), vgchange(8),
189 vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgextend(8), vgim‐
190 port(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8),
191 vgrename(8), vgs(8), vgscan(8), vgsplit(8), readline(3), lvm.conf(5)
192
193
194
195
196Sistina Software UK LVM TOOLS LVM(8)