1VGCREATE(8) System Manager's Manual VGCREATE(8)
2
3
4
6 vgcreate - Create a volume group
7
9 vgcreate position_args
10 [ option_args ]
11
13 vgcreate creates a new VG on block devices. If the devices were not
14 previously intialized as PVs with pvcreate(8), vgcreate will inititial‐
15 ize them, making them PVs. The pvcreate options for initializing
16 devices are also available with vgcreate.
17
19 vgcreate VG_new PV ...
20 [ -A|--autobackup y|n ]
21 [ -c|--clustered y|n ]
22 [ -l|--maxlogicalvolumes Number ]
23 [ -p|--maxphysicalvolumes Number ]
24 [ -M|--metadatatype lvm2 ]
25 [ -s|--physicalextentsize Size[m|UNIT] ]
26 [ -f|--force ]
27 [ -Z|--zero y|n ]
28 [ --addtag Tag ]
29 [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
30 ]
31 [ --metadataprofile String ]
32 [ --labelsector Number ]
33 [ --metadatasize Size[m|UNIT] ]
34 [ --pvmetadatacopies 0|1|2 ]
35 [ --[vg]metadatacopies all|unmanaged|Number ]
36 [ --reportformat basic|json ]
37 [ --dataalignment Size[k|UNIT] ]
38 [ --dataalignmentoffset Size[k|UNIT] ]
39 [ --shared ]
40 [ --systemid String ]
41 [ --locktype sanlock|dlm|none ]
42 [ COMMON_OPTIONS ]
43
44 Common options for lvm:
45 [ -d|--debug ]
46 [ -h|--help ]
47 [ -q|--quiet ]
48 [ -t|--test ]
49 [ -v|--verbose ]
50 [ -y|--yes ]
51 [ --commandprofile String ]
52 [ --config String ]
53 [ --driverloaded y|n ]
54 [ --lockopt String ]
55 [ --longhelp ]
56 [ --profile String ]
57 [ --version ]
58
60 --addtag Tag
61 Adds a tag to a PV, VG or LV. This option can be repeated to add
62 multiple tags at once. See lvm(8) for information about tags.
63
64 --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
65 Determines the allocation policy when a command needs to allo‐
66 cate Physical Extents (PEs) from the VG. Each VG and LV has an
67 allocation policy which can be changed with vgchange/lvchange,
68 or overriden on the command line. normal applies common sense
69 rules such as not placing parallel stripes on the same PV.
70 inherit applies the VG policy to an LV. contiguous requires new
71 PEs be placed adjacent to existing PEs. cling places new PEs on
72 the same PV as existing PEs in the same stripe of the LV. If
73 there are sufficient PEs for an allocation, but normal does not
74 use them, anywhere will use them even if it reduces performance,
75 e.g. by placing two stripes on the same PV. Optional positional
76 PV args on the command line can also be used to limit which PVs
77 the command will use for allocation. See lvm(8) for more infor‐
78 mation about allocation.
79
80 -A|--autobackup y|n
81 Specifies if metadata should be backed up automatically after a
82 change. Enabling this is strongly advised! See vgcfgbackup(8)
83 for more information.
84
85 -c|--clustered y|n
86 Create a clustered VG using clvmd if LVM is compiled with clus‐
87 ter support. This allows multiple hosts to share a VG on shared
88 devices. clvmd and a lock manager must be configured and run‐
89 ning. (A clustered VG using clvmd is different from a shared VG
90 using lvmlockd.) See clvmd(8) for more information about clus‐
91 tered VGs.
92
93 --commandprofile String
94 The command profile to use for command configuration. See
95 lvm.conf(5) for more information about profiles.
96
97 --config String
98 Config settings for the command. These override lvm.conf set‐
99 tings. The String arg uses the same format as lvm.conf, or may
100 use section/field syntax. See lvm.conf(5) for more information
101 about config.
102
103 --dataalignment Size[k|UNIT]
104 Align the start of the data to a multiple of this number. Also
105 specify an appropriate Physical Extent size when creating a VG.
106 To see the location of the first Physical Extent of an existing
107 PV, use pvs -o +pe_start. In addition, it may be shifted by an
108 alignment offset. See lvm.conf/data_alignment_offset_detection
109 and --dataalignmentoffset.
110
111 --dataalignmentoffset Size[k|UNIT]
112 Shift the start of the data area by this additional offset.
113
114 -d|--debug ...
115 Set debug level. Repeat from 1 to 6 times to increase the detail
116 of messages sent to the log file and/or syslog (if configured).
117
118 --driverloaded y|n
119 If set to no, the command will not attempt to use device-mapper.
120 For testing and debugging.
121
122 -f|--force ...
123 Override various checks, confirmations and protections. Use
124 with extreme caution.
125
126 -h|--help
127 Display help text.
128
129 --labelsector Number
130 By default the PV is labelled with an LVM2 identifier in its
131 second sector (sector 1). This lets you use a different sector
132 near the start of the disk (between 0 and 3 inclusive - see
133 LABEL_SCAN_SECTORS in the source). Use with care.
134
135 --lockopt String
136 Used to pass options for special cases to lvmlockd. See lvm‐
137 lockd(8) for more information.
138
139 --locktype sanlock|dlm|none
140 Specify the VG lock type directly in place of using --shared.
141 See lvmlockd(8) for more information.
142
143 --longhelp
144 Display long help text.
145
146 -l|--maxlogicalvolumes Number
147 Sets the maximum number of LVs allowed in a VG.
148
149 -p|--maxphysicalvolumes Number
150 Sets the maximum number of PVs that can belong to the VG. The
151 value 0 removes any limitation. For large numbers of PVs, also
152 see options --pvmetadatacopies, and --vgmetadatacopies for
153 improving performance.
154
155 --metadataprofile String
156 The metadata profile to use for command configuration. See
157 lvm.conf(5) for more information about profiles.
158
159 --metadatasize Size[m|UNIT]
160 The approximate amount of space used for each VG metadata area.
161 The size may be rounded.
162
163 -M|--metadatatype lvm2
164 Specifies the type of on-disk metadata to use. lvm2 (or just 2)
165 is the current, standard format. lvm1 (or just 1) is no longer
166 used.
167
168 -s|--physicalextentsize Size[m|UNIT]
169 Sets the physical extent size of PVs in the VG. The value must
170 be either a power of 2 of at least 1 sector (where the sector
171 size is the largest sector size of the PVs currently used in the
172 VG), or at least 128KiB. Once this value has been set, it is
173 difficult to change without recreating the VG, unless no extents
174 need moving.
175
176 --profile String
177 An alias for --commandprofile or --metadataprofile, depending on
178 the command.
179
180 --pvmetadatacopies 0|1|2
181 The number of metadata areas to set aside on a PV for storing VG
182 metadata. When 2, one copy of the VG metadata is stored at the
183 front of the PV and a second copy is stored at the end. When 1,
184 one copy of the VG metadata is stored at the front of the PV
185 (starting in the 5th sector). When 0, no copies of the VG meta‐
186 data are stored on the given PV. This may be useful in VGs con‐
187 taining many PVs (this places limitations on the ability to use
188 vgsplit later.)
189
190 -q|--quiet ...
191 Suppress output and log messages. Overrides --debug and --ver‐
192 bose. Repeat once to also suppress any prompts with answer
193 'no'.
194
195 --reportformat basic|json
196 Overrides current output format for reports which is defined
197 globally by the report/output_format setting in lvm.conf. basic
198 is the original format with columns and rows. If there is more
199 than one report per command, each report is prefixed with the
200 report name for identification. json produces report output in
201 JSON format. See lvmreport(7) for more information.
202
203 --shared
204 Create a shared VG using lvmlockd if LVM is compiled with lockd
205 support. lvmlockd will select lock type sanlock or dlm depend‐
206 ing on which lock manager is running. This allows multiple hosts
207 to share a VG on shared devices. lvmlockd and a lock manager
208 must be configured and running. (A shared VG using lvmlockd is
209 different from a clustered VG using clvmd.) See lvmlockd(8) for
210 more information about shared VGs.
211
212 --systemid String
213 Specifies the system ID that will be given to the new VG, over‐
214 riding the system ID of the host running the command. A VG is
215 normally created without this option, in which case the new VG
216 is given the system ID of the host creating it. Using this
217 option requires caution because the system ID of the new VG may
218 not match the system ID of the host running the command, leaving
219 the VG inaccessible to the host. See lvmsystemid(7) for more
220 information.
221
222 -t|--test
223 Run in test mode. Commands will not update metadata. This is
224 implemented by disabling all metadata writing but nevertheless
225 returning success to the calling function. This may lead to
226 unusual error messages in multi-stage operations if a tool
227 relies on reading back metadata it believes has changed but
228 hasn't.
229
230 -v|--verbose ...
231 Set verbose level. Repeat from 1 to 4 times to increase the
232 detail of messages sent to stdout and stderr.
233
234 --version
235 Display version information.
236
237 --[vg]metadatacopies all|unmanaged|Number
238 Number of copies of the VG metadata that are kept. VG metadata
239 is kept in VG metadata areas on PVs in the VG, i.e. reserved
240 space at the start and/or end of the PVs. Keeping a copy of the
241 VG metadata on every PV can reduce performance in VGs containing
242 a large number of PVs. When this number is set to a non-zero
243 value, LVM will automatically choose PVs on which to store meta‐
244 data, using the metadataignore flags on PVs to achieve the spec‐
245 ified number. The number can also be replaced with special
246 string values: unmanaged causes LVM to not automatically manage
247 the PV metadataignore flags. all causes LVM to first clear the
248 metadataignore flags on all PVs, and then to become unmanaged.
249
250 -y|--yes
251 Do not prompt for confirmation interactively but always assume
252 the answer yes. Use with extreme caution. (For automatic no,
253 see -qq.)
254
255 -Z|--zero y|n
256 Controls if the first 4 sectors (2048 bytes) of the device are
257 wiped. The default is to wipe these sectors unless either or
258 both of --restorefile or --uuid are specified.
259
261 VG
262 Volume Group name. See lvm(8) for valid names.
263
264 PV
265 Physical Volume name, a device path under /dev. For commands
266 managing physical extents, a PV positional arg generally accepts
267 a suffix indicating a range (or multiple ranges) of physical
268 extents (PEs). When the first PE is omitted, it defaults to the
269 start of the device, and when the last PE is omitted it defaults
270 to end. Start and end range (inclusive): PV[:PE-PE]... Start
271 and length range (counting from 0): PV[:PE+PE]...
272
273 String
274 See the option description for information about the string con‐
275 tent.
276
277 Size[UNIT]
278 Size is an input number that accepts an optional unit. Input
279 units are always treated as base two values, regardless of capi‐
280 talization, e.g. 'k' and 'K' both refer to 1024. The default
281 input unit is specified by letter, followed by |UNIT. UNIT rep‐
282 resents other possible input units: bBsSkKmMgGtTpPeE. b|B is
283 bytes, s|S is sectors of 512 bytes, k|K is kilobytes, m|M is
284 megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
285 e|E is exabytes. (This should not be confused with the output
286 control --units, where capital letters mean multiple of 1000.)
287
289 See lvm(8) for information about environment variables used by lvm.
290 For example, LVM_VG_NAME can generally be substituted for a required VG
291 parameter.
292
294 Create a VG with two PVs, using the default physical extent size.
295 vgcreate myvg /dev/sdk1 /dev/sdl1
296
298 lvm(8) lvm.conf(5) lvmconfig(8)
299
300 pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8)
301 pvresize(8) pvs(8) pvscan(8)
302
303 vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgcon‐
304 vert(8) vgdisplay(8) vgexport(8) vgextend(8) vgimport(8) vgimport‐
305 clone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8)
306 vgs(8) vgscan(8) vgsplit(8)
307
308 lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvre‐
309 duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
310
311 lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
312 vate(8) lvmdump(8)
313
314 dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8)
315 cmirrord(8) lvmdbusd(8)
316
317 lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
318
319
320
321Red Hat, Inc. LVM TOOLS 2.02.183(2) (2018-12-07) VGCREATE(8)