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 initialized as PVs with pvcreate(8),  vgcreate  will  initi‐
15       tialize  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

USAGE

24       vgcreate VG_new PV ...
25           [ -A|--autobackup y|n ]
26           [ -c|--clustered y|n ]
27           [ -l|--maxlogicalvolumes Number ]
28           [ -p|--maxphysicalvolumes Number ]
29           [ -M|--metadatatype lvm2 ]
30           [ -s|--physicalextentsize Size[m|UNIT] ]
31           [ -f|--force ]
32           [ -Z|--zero y|n ]
33           [    --addtag Tag ]
34           [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
35           ]
36           [    --metadataprofile String ]
37           [    --labelsector Number ]
38           [    --metadatasize Size[m|UNIT] ]
39           [    --pvmetadatacopies 0|1|2 ]
40           [    --[vg]metadatacopies all|unmanaged|Number ]
41           [    --reportformat basic|json|json_std ]
42           [    --dataalignment Size[k|UNIT] ]
43           [    --dataalignmentoffset Size[k|UNIT] ]
44           [    --shared ]
45           [    --systemid String ]
46           [    --locktype sanlock|dlm|none ]
47           [    --setautoactivation y|n ]
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           [    --devices PV ]
60           [    --devicesfile String ]
61           [    --driverloaded y|n ]
62           [    --journal String ]
63           [    --lockopt String ]
64           [    --longhelp ]
65           [    --nohints ]
66           [    --nolocking ]
67           [    --profile String ]
68           [    --version ]
69

OPTIONS

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

VARIABLES

305       VG     Volume Group name.  See lvm(8) for valid names.
306
307       PV     Physical  Volume  name,  a device path under /dev.  For commands
308              managing physical extents, a PV positional arg generally accepts
309              a suffix indicating a range (or multiple ranges) of physical ex‐
310              tents (PEs). When the first PE is omitted, it  defaults  to  the
311              start of the device, and when the last PE is omitted it defaults
312              to end.  Start and end range (inclusive):  PV[:PE-PE]...   Start
313              and length range (counting from 0): PV[:PE+PE]...
314
315       String See the option description for information about the string con‐
316              tent.
317
318       Size[UNIT]
319              Size is an input number that accepts an  optional  unit.   Input
320              units are always treated as base two values, regardless of capi‐
321              talization, e.g. 'k' and 'K' both refer to  1024.   The  default
322              input unit is specified by letter, followed by |UNIT.  UNIT rep‐
323              resents other possible input units: b|B is bytes, s|S is sectors
324              of  512  bytes,  k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB,
325              p|P is PiB, e|E is EiB.  (This should not be confused  with  the
326              output  control  --units, where capital letters mean multiple of
327              1000.)
328

ENVIRONMENT VARIABLES

330       See lvm(8) for information about environment  variables  used  by  lvm.
331       For example, LVM_VG_NAME can generally be substituted for a required VG
332       parameter.
333

EXAMPLES

335       Create a VG with two PVs, using the default physical extent size.
336       vgcreate myvg /dev/sdk1 /dev/sdl1
337

SEE ALSO

339       lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8),
340
341       pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8),
342       pvremove(8), pvresize(8), pvs(8), pvscan(8),
343
344       vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
345       vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
346       vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8),
347       vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8),
348
349       lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8),
350       lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8),
351
352       lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8),
353
354       dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8),
355       lvmdbusd(8), fsadm(8),
356
357       lvmsystemid(7), lvmreport(7), lvmraid(7), lvmthin(7), lvmcache(7)
358
359
360
361Red Hat, Inc.        LVM TOOLS 2.03.18(2)-git (2022-11-10)         VGCREATE(8)
Impressum