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 de‐
16       vices 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.  in‐
77              herit 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 LA‐
135              BEL_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 im‐
155              proving 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 op‐
220              tion 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 un‐
229              usual error messages in multi-stage operations if a tool relies
230              on reading back metadata it believes has changed but hasn't.
231
232       -v|--verbose ...
233              Set verbose level. Repeat from 1 to 4 times to increase the de‐
234              tail of messages sent to stdout and stderr.
235
236       --version
237              Display version information.
238
239       --[vg]metadatacopies all|unmanaged|Number
240              Number of copies of the VG metadata that are kept.  VG metadata
241              is kept in VG metadata areas on PVs in the VG, i.e. reserved
242              space at the start and/or end of the PVs.  Keeping a copy of the
243              VG metadata on every PV can reduce performance in VGs containing
244              a large number of PVs.  When this number is set to a non-zero
245              value, LVM will automatically choose PVs on which to store meta‐
246              data, using the metadataignore flags on PVs to achieve the spec‐
247              ified number.  The number can also be replaced with special
248              string values: unmanaged causes LVM to not automatically manage
249              the PV metadataignore flags.  all causes LVM to first clear the
250              metadataignore flags on all PVs, and then to become unmanaged.
251
252       -y|--yes
253              Do not prompt for confirmation interactively but always assume
254              the answer yes. Use with extreme caution.  (For automatic no,
255              see -qq.)
256
257       -Z|--zero y|n
258              Controls if the first 4 sectors (2048 bytes) of the device are
259              wiped.  The default is to wipe these sectors unless either or
260              both of --restorefile or --uuid are specified.
261

VARIABLES

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

ENVIRONMENT VARIABLES

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

EXAMPLES

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

SEE ALSO

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