1VGCREATE(8) System Manager's Manual VGCREATE(8)
2
3
4
6 vgcreate — create a volume group
7
9 vgcreate [--addtag Tag] [--alloc AllocationPolicy] [-A|--autobackup
10 {y|n}] [-c|--clustered {y|n}] [--commandprofile ProfileName]
11 [-d|--debug] [-h|--help] [-l|--maxlogicalvolumes MaxLogicalVolumes]
12 [-M|--metadatatype type] [--metadataprofile ProfileName] [-p|--maxphys‐
13 icalvolumes MaxPhysicalVolumes] [--[vg]metadatacopies NumberOf‐
14 Copies|unmanaged|all] [-s|--physicalextentsize PhysicalExtent‐
15 Size[bBsSkKmMgGtTpPeE]] [--shared] [--systemid SystemID] [-t|--test]
16 [-v|--verbose] [--version] [PHYSICAL DEVICE OPTIONS] VolumeGroupName
17 PhysicalDevicePath [PhysicalDevicePath...]
18
20 vgcreate creates a new volume group called VolumeGroupName using the
21 block special device PhysicalDevicePath.
22
23 If PhysicalDevicePath was not previously configured for LVM with pvcre‐
24 ate(8), the device will be initialized with the same default values
25 used with pvcreate(8). If non-default pvcreate values are desired,
26 they may be given on the commandline with the same options as pvcre‐
27 ate(8). See PHYSICAL DEVICE OPTIONS for available options. Note that
28 the restore-related options such as --restorefile, --uuid and --physi‐
29 calvolumesize are not available. If a restore operation is needed, use
30 pvcreate(8) and vgcfgrestore(8).
31
33 See lvm(8) for common options.
34
35 -c, --clustered {y|n}
36 If clustered locking is enabled, this defaults to y indicating
37 that this Volume Group is shared with other nodes in the clus‐
38 ter.
39
40 If the new Volume Group contains only local disks that are not
41 visible on the other nodes, you must specify --clustered n. If
42 the cluster infrastructure is unavailable on a particular node
43 at a particular time, you may still be able to use such Volume
44 Groups.
45
46 -l, --maxlogicalvolumes MaxLogicalVolumes
47 Sets the maximum number of logical volumes allowed in this vol‐
48 ume group. The setting can be changed with vgchange(8). For
49 volume groups with metadata in lvm1 format, the limit and
50 default value is 255. If the metadata uses lvm2 format, the
51 default value is 0 which removes this restriction: there is then
52 no limit.
53
54 -p, --maxphysicalvolumes MaxPhysicalVolumes
55 Sets the maximum number of physical volumes that can belong to
56 this volume group. The setting can be changed with vgchange.
57 For volume groups with metadata in lvm1 format, the limit and
58 default value is 255. If the metadata uses lvm2 format, the
59 value 0 removes this restriction: there is then no limit. If
60 you have a large number of physical volumes in a volume group
61 with metadata in lvm2 format, for tool performance reasons, you
62 should consider some use of --pvmetadatacopies 0 as described in
63 pvcreate(8), and/or use --vgmetadatacopies.
64
65 --[vg]metadatacopies NumberOfCopies|unmanaged|all
66 Sets the desired number of metadata copies in the volume group.
67 If set to a non-zero value, LVM will automatically manage the
68 'metadataignore' flags on the physical volumes (see pvcreate(8)
69 or pvchange --metadataignore) in order to achieve NumberOfCopies
70 copies of metadata. If set to unmanaged, LVM will not automati‐
71 cally manage the 'metadataignore' flags. If set to all, LVM
72 will first clear all of the 'metadataignore' flags on all meta‐
73 data areas in the volume group, then set the value to unmanaged.
74 The vgmetadatacopies option is useful for volume groups contain‐
75 ing large numbers of physical volumes with metadata as it may be
76 used to minimize metadata read and write overhead. The default
77 value is unmanaged.
78
79 --metadataprofile ProfileName
80 Uses and attaches the ProfileName configuration profile to the
81 volume group metadata. Whenever the volume group is processed
82 next time, the profile is automatically applied. The profile is
83 inherited by all logical volumes in the volume group unless the
84 logical volume itself has its own profile attached. See
85 lvm.conf(5) for more information about metadata profiles.
86
87 -s, --physicalextentsize PhysicalExtentSize[bBsSkKmMgGtTpPeE]
88 Sets the physical extent size on physical volumes of this volume
89 group. A size suffix (k for kilobytes up to t for terabytes) is
90 optional, megabytes is the default if no suffix is present. For
91 LVM2 format, the value must be a power of 2 of at least 1 sector
92 (where the sector size is the largest sector size of the PVs
93 currently used in the VG) or, if not a power of 2, at least
94 128KiB. For the older LVM1 format, it must be a power of 2 of
95 at least 8KiB. The default is 4 MiB. Once this value has been
96 set, it is difficult to change it without recreating the volume
97 group which would involve backing up and restoring data on any
98 logical volumes. However, if no extents need moving for the new
99 value to apply, it can be altered using vgchange -s.
100
101 If the volume group metadata uses lvm1 format, extents can vary
102 in size from 8KiB to 16GiB and there is a limit of 65534 extents
103 in each logical volume. The default of 4 MiB leads to a maximum
104 logical volume size of around 256GiB.
105
106 If the volume group metadata uses lvm2 format those restrictions
107 do not apply, but having a large number of extents will slow
108 down the tools but have no impact on I/O performance to the log‐
109 ical volume. The smallest PE is 1KiB
110
111 The 2.4 kernel has a limitation of 2TiB per block device.
112
113
114 --shared
115 Create a shared VG using lvmlockd if LVM is compiled with lockd
116 support. lvmlockd will select lock type sanlock or dlm depend‐
117 ing on which lock manager is running. This allows multiple
118 hosts to share a VG on shared devices. See lvmlockd(8).
119
120
121 --systemid SystemID
122 Specifies the system ID that will be given to the new VG, over‐
123 riding the system ID of the host running the command. A VG is
124 normally created without this option, in which case the new VG
125 is given the system ID of the host creating it. Using this
126 option requires caution because the system ID of the new VG may
127 not match the system ID of the host running the command, leaving
128 the VG inaccessible to the host. See lvmsystemid(7).
129
130
132 The following options are available for initializing physical devices
133 in the volume group. These options are further described in the pvcre‐
134 ate(8) man page.
135
136 -f, --force
137
138 -y, --yes
139
140 -Z, --zero {y|n}
141
142 --labelsector sector
143
144 --metadatasize size
145
146 --pvmetadatacopies copies
147
148 --dataalignment alignment
149
150 --dataalignmentoffset alignment_offset
151
153 Creates a volume group named "test_vg" using physical volumes
154 "/dev/sdk1" and "/dev/sdl1" with default physical extent size of 4MiB:
155
156 vgcreate test_vg /dev/sdk1 /dev/sdl1
157
158
160 lvm(8), pvdisplay(8), pvcreate(8), vgdisplay(8), vgextend(8), vgre‐
161 duce(8), lvcreate(8), lvdisplay(8), lvextend(8), lvreduce(8)
162
163
164
165Sistina Software UKLVM TOOLS 2.02.143(2)-RHEL6 (2016-12-13) VGCREATE(8)