1VGCREATE(8)                 System Manager's Manual                VGCREATE(8)
2
3
4

NAME

6       vgcreate - Create a volume group
7

SYNOPSIS

9       vgcreate position_args
10           [ option_args ]
11

DESCRIPTION

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
18       When vgcreate uses an existing PV, that PV's existing values for  meta‐
19       data size, PE start, etc, are used, even if different values are speci‐
20       fied in the vgcreate command.  To change these values, first use  pvre‐
21       move on the device.
22
23

USAGE

25       vgcreate VG_new PV ...
26           [ -A|--autobackup y|n ]
27           [ -c|--clustered y|n ]
28           [ -l|--maxlogicalvolumes Number ]
29           [ -p|--maxphysicalvolumes Number ]
30           [ -M|--metadatatype lvm2 ]
31           [ -s|--physicalextentsize Size[m|UNIT] ]
32           [ -f|--force ]
33           [ -Z|--zero y|n ]
34           [    --addtag Tag ]
35           [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
36           ]
37           [    --metadataprofile String ]
38           [    --labelsector Number ]
39           [    --metadatasize Size[m|UNIT] ]
40           [    --pvmetadatacopies 0|1|2 ]
41           [    --[vg]metadatacopies all|unmanaged|Number ]
42           [    --reportformat basic|json ]
43           [    --dataalignment Size[k|UNIT] ]
44           [    --dataalignmentoffset Size[k|UNIT] ]
45           [    --shared ]
46           [    --systemid String ]
47           [    --locktype sanlock|dlm|none ]
48           [ COMMON_OPTIONS ]
49
50       Common options for lvm:
51           [ -d|--debug ]
52           [ -h|--help ]
53           [ -q|--quiet ]
54           [ -t|--test ]
55           [ -v|--verbose ]
56           [ -y|--yes ]
57           [    --commandprofile String ]
58           [    --config String ]
59           [    --driverloaded y|n ]
60           [    --lockopt String ]
61           [    --longhelp ]
62           [    --nolocking ]
63           [    --profile String ]
64           [    --version ]
65

OPTIONS

67       --addtag Tag
68              Adds a tag to a PV, VG or LV. This option can be repeated to add
69              multiple tags at once. See lvm(8) for information about tags.
70
71       --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
72              Determines the allocation policy when a command needs to allo‐
73              cate Physical Extents (PEs) from the VG. Each VG and LV has an
74              allocation policy which can be changed with vgchange/lvchange,
75              or overriden on the command line.  normal applies common sense
76              rules such as not placing parallel stripes on the same PV.
77              inherit applies the VG policy to an LV.  contiguous requires new
78              PEs be placed adjacent to existing PEs.  cling places new PEs on
79              the same PV as existing PEs in the same stripe of the LV.  If
80              there are sufficient PEs for an allocation, but normal does not
81              use them, anywhere will use them even if it reduces performance,
82              e.g. by placing two stripes on the same PV.  Optional positional
83              PV args on the command line can also be used to limit which PVs
84              the command will use for allocation.  See lvm(8) for more infor‐
85              mation about allocation.
86
87       -A|--autobackup y|n
88              Specifies if metadata should be backed up automatically after a
89              change.  Enabling this is strongly advised! See vgcfgbackup(8)
90              for more information.
91
92       -c|--clustered y|n
93              This option was specific to clvm and is now replaced by the
94              --shared option with lvmlockd(8).
95
96       --commandprofile String
97              The command profile to use for command configuration.  See
98              lvm.conf(5) for more information about profiles.
99
100       --config String
101              Config settings for the command. These override lvm.conf set‐
102              tings.  The String arg uses the same format as lvm.conf, or may
103              use section/field syntax.  See lvm.conf(5) for more information
104              about config.
105
106       --dataalignment Size[k|UNIT]
107              Align the start of a PV data area with a multiple of this num‐
108              ber.  To see the location of the first Physical Extent (PE) of
109              an existing PV, use pvs -o +pe_start. In addition, it may be
110              shifted by an alignment offset, see --dataalignmentoffset.  Also
111              specify an appropriate PE size when creating a VG.
112
113       --dataalignmentoffset Size[k|UNIT]
114              Shift the start of the PV data area by this additional offset.
115
116       -d|--debug ...
117              Set debug level. Repeat from 1 to 6 times to increase the detail
118              of messages sent to the log file and/or syslog (if configured).
119
120       --driverloaded y|n
121              If set to no, the command will not attempt to use device-mapper.
122              For testing and debugging.
123
124       -f|--force ...
125              Override various checks, confirmations and protections.  Use
126              with extreme caution.
127
128       -h|--help
129              Display help text.
130
131       --labelsector Number
132              By default the PV is labelled with an LVM2 identifier in its
133              second sector (sector 1). This lets you use a different sector
134              near the start of the disk (between 0 and 3 inclusive - see
135              LABEL_SCAN_SECTORS in the source). Use with care.
136
137       --lockopt String
138              Used to pass options for special cases to lvmlockd.  See lvm‐
139              lockd(8) for more information.
140
141       --locktype sanlock|dlm|none
142              Specify the VG lock type directly in place of using --shared.
143              See lvmlockd(8) for more information.
144
145       --longhelp
146              Display long help text.
147
148       -l|--maxlogicalvolumes Number
149              Sets the maximum number of LVs allowed in a VG.
150
151       -p|--maxphysicalvolumes Number
152              Sets the maximum number of PVs that can belong to the VG.  The
153              value 0 removes any limitation.  For large numbers of PVs, also
154              see options --pvmetadatacopies, and --vgmetadatacopies for
155              improving performance.
156
157       --metadataprofile String
158              The metadata profile to use for command configuration.  See
159              lvm.conf(5) for more information about profiles.
160
161       --metadatasize Size[m|UNIT]
162              The approximate amount of space used for each VG metadata area.
163              The size may be rounded.
164
165       -M|--metadatatype lvm2
166              Specifies the type of on-disk metadata to use.  lvm2 (or just 2)
167              is the current, standard format.  lvm1 (or just 1) is no longer
168              used.
169
170       --nolocking
171              Disable locking.
172
173       -s|--physicalextentsize Size[m|UNIT]
174              Sets the physical extent size of PVs in the VG.  The value must
175              be either a power of 2 of at least 1 sector (where the sector
176              size is the largest sector size of the PVs currently used in the
177              VG), or at least 128KiB.  Once this value has been set, it is
178              difficult to change without recreating the VG, unless no extents
179              need moving.
180
181       --profile String
182              An alias for --commandprofile or --metadataprofile, depending on
183              the command.
184
185       --pvmetadatacopies 0|1|2
186              The number of metadata areas to set aside on a PV for storing VG
187              metadata.  When 2, one copy of the VG metadata is stored at the
188              front of the PV and a second copy is stored at the end.  When 1,
189              one copy of the VG metadata is stored at the front of the PV.
190              When 0, no copies of the VG metadata are stored on the given PV.
191              This may be useful in VGs containing many PVs (this places limi‐
192              tations on the ability to use vgsplit later.)
193
194       -q|--quiet ...
195              Suppress output and log messages. Overrides --debug and --ver‐
196              bose.  Repeat once to also suppress any prompts with answer
197              'no'.
198
199       --reportformat basic|json
200              Overrides current output format for reports which is defined
201              globally by the report/output_format setting in lvm.conf.  basic
202              is the original format with columns and rows.  If there is more
203              than one report per command, each report is prefixed with the
204              report name for identification. json produces report output in
205              JSON format. See lvmreport(7) for more information.
206
207       --shared
208              Create a shared VG using lvmlockd if LVM is compiled with lockd
209              support.  lvmlockd will select lock type sanlock or dlm depend‐
210              ing on which lock manager is running. This allows multiple hosts
211              to share a VG on shared devices. lvmlockd and a lock manager
212              must be configured and running.  See lvmlockd(8) for more infor‐
213              mation about shared VGs.
214
215       --systemid String
216              Specifies the system ID that will be given to the new VG, over‐
217              riding the system ID of the host running the command. A VG is
218              normally created without this option, in which case the new VG
219              is given the system ID of the host creating it. Using this
220              option requires caution because the system ID of the new VG may
221              not match the system ID of the host running the command, leaving
222              the VG inaccessible to the host.  See lvmsystemid(7) for more
223              information.
224
225       -t|--test
226              Run in test mode. Commands will not update metadata.  This is
227              implemented by disabling all metadata writing but nevertheless
228              returning success to the calling function. This may lead to
229              unusual error messages in multi-stage operations if a tool
230              relies on reading back metadata it believes has changed but
231              hasn't.
232
233       -v|--verbose ...
234              Set verbose level. Repeat from 1 to 4 times to increase the
235              detail of messages sent to stdout and stderr.
236
237       --version
238              Display version information.
239
240       --[vg]metadatacopies all|unmanaged|Number
241              Number of copies of the VG metadata that are kept.  VG metadata
242              is kept in VG metadata areas on PVs in the VG, i.e. reserved
243              space at the start and/or end of the PVs.  Keeping a copy of the
244              VG metadata on every PV can reduce performance in VGs containing
245              a large number of PVs.  When this number is set to a non-zero
246              value, LVM will automatically choose PVs on which to store meta‐
247              data, using the metadataignore flags on PVs to achieve the spec‐
248              ified number.  The number can also be replaced with special
249              string values: unmanaged causes LVM to not automatically manage
250              the PV metadataignore flags.  all causes LVM to first clear the
251              metadataignore flags on all PVs, and then to become unmanaged.
252
253       -y|--yes
254              Do not prompt for confirmation interactively but always assume
255              the answer yes. Use with extreme caution.  (For automatic no,
256              see -qq.)
257
258       -Z|--zero y|n
259              Controls if the first 4 sectors (2048 bytes) of the device are
260              wiped.  The default is to wipe these sectors unless either or
261              both of --restorefile or --uuid are specified.
262

VARIABLES

264       VG
265              Volume Group name.  See lvm(8) for valid names.
266
267       PV
268              Physical  Volume  name,  a device path under /dev.  For commands
269              managing physical extents, a PV positional arg generally accepts
270              a  suffix  indicating  a  range (or multiple ranges) of physical
271              extents (PEs). When the first PE is omitted, it defaults to  the
272              start of the device, and when the last PE is omitted it defaults
273              to end.  Start and end range (inclusive):  PV[:PE-PE]...   Start
274              and length range (counting from 0): PV[:PE+PE]...
275
276       String
277              See the option description for information about the string con‐
278              tent.
279
280       Size[UNIT]
281              Size is an input number that accepts an  optional  unit.   Input
282              units are always treated as base two values, regardless of capi‐
283              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
284              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
285              resents other possible input units:  bBsSkKmMgGtTpPeE.   b|B  is
286              bytes,  s|S  is  sectors  of 512 bytes, k|K is kilobytes, m|M is
287              megabytes, g|G is gigabytes, t|T is terabytes, p|P is petabytes,
288              e|E  is  exabytes.  (This should not be confused with the output
289              control --units, where capital letters mean multiple of 1000.)
290

ENVIRONMENT VARIABLES

292       See lvm(8) for information about environment  variables  used  by  lvm.
293       For example, LVM_VG_NAME can generally be substituted for a required VG
294       parameter.
295

EXAMPLES

297       Create a VG with two PVs, using the default physical extent size.
298       vgcreate myvg /dev/sdk1 /dev/sdl1
299

SEE ALSO

301       lvm(8) lvm.conf(5) lvmconfig(8)
302
303       pvchange(8)  pvck(8)  pvcreate(8)  pvdisplay(8)  pvmove(8)  pvremove(8)
304       pvresize(8) pvs(8) pvscan(8)
305
306       vgcfgbackup(8)  vgcfgrestore(8)  vgchange(8) vgck(8) vgcreate(8) vgcon‐
307       vert(8)  vgdisplay(8)  vgexport(8)  vgextend(8)  vgimport(8)  vgimport‐
308       clone(8)  vgmerge(8)  vgmknodes(8)  vgreduce(8) vgremove(8) vgrename(8)
309       vgs(8) vgscan(8) vgsplit(8)
310
311       lvcreate(8) lvchange(8)  lvconvert(8)  lvdisplay(8)  lvextend(8)  lvre‐
312       duce(8) lvremove(8) lvrename(8) lvresize(8) lvs(8) lvscan(8)
313
314       lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeacti‐
315       vate(8) lvmdump(8)
316
317       dmeventd(8) lvmpolld(8)  lvmlockd(8)  lvmlockctl(8)  cmirrord(8)  lvmd‐
318       busd(8)
319
320       lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7)
321
322
323
324Red Hat, Inc.          LVM TOOLS 2.03.10(2) (2020-08-09)           VGCREATE(8)
Impressum