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

USAGE

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           [    --nolocking ]
57           [    --profile String ]
58           [    --version ]
59

OPTIONS

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

VARIABLES

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

ENVIRONMENT VARIABLES

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

EXAMPLES

293       Create a VG with two PVs, using the default physical extent size.
294       vgcreate myvg /dev/sdk1 /dev/sdl1
295

SEE ALSO

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