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}] [-d|--debug] [-h|--help] [-l|--maxlogi‐
11 calvolumes MaxLogicalVolumes] [-M|--metadatatypetype] [-p|--maxphysi‐
12 calvolumes MaxPhysicalVolumes] [--[vg]metadatacopies] NumberOf‐
13 Copies|unmanaged|all] [-s|--physicalextentsize PhysicalExtent‐
14 Size[bBsSkKmMgGtTpPeE]] [-t|--test] [-v|--verbose] [--version] [ PHYSI‐
15 CAL DEVICE OPTIONS ] VolumeGroupName PhysicalDevicePath [PhysicalDevi‐
16 cePath...]
17
19 vgcreate creates a new volume group called VolumeGroupName using the
20 block special device PhysicalDevicePath.
21
22 If PhysicalDevicePath was not previously configured for LVM with pvcre‐
23 ate (8), the device will be initialized with the same default values
24 used with pvcreate. If non-default pvcreate values are desired, they
25 may be given on the commandline with the same options as pvcreate. See
26 PHYSICAL DEVICE OPTIONS for available options. Note that the restore-
27 related options such as --restorefile, --uuid, and --physicalvolumesize
28 are not available. If a restore operation is needed, use pvcreate (8)
29 and vgcfgrestore (8).
30
32 See lvm for common options.
33
34 -c, --clustered {y|n}
35 If clustered locking is enabled, this defaults to y indicating
36 that this Volume Group is shared with other nodes in the clus‐
37 ter.
38
39 If the new Volume Group contains only local disks that are not
40 visible on the other nodes, you must specify --clustered n. If
41 the cluster infrastructure is unavailable on a particular node
42 at a particular time, you may still be able to use such Volume
43 Groups.
44
45 -l, --maxlogicalvolumes MaxLogicalVolumes
46 Sets the maximum number of logical volumes allowed in this vol‐
47 ume group. The setting can be changed with vgchange. For vol‐
48 ume groups with metadata in lvm1 format, the limit and default
49 value is 255. If the metadata uses lvm2 format, the default
50 value is 0 which removes this restriction: there is then no
51 limit.
52
53 -p, --maxphysicalvolumes MaxPhysicalVolumes
54 Sets the maximum number of physical volumes that can belong to
55 this volume group. The setting can be changed with vgchange.
56 For volume groups with metadata in lvm1 format, the limit and
57 default value is 255. If the metadata uses lvm2 format, the
58 value 0 removes this restriction: there is then no limit. If
59 you have a large number of physical volumes in a volume group
60 with metadata in lvm2 format, for tool performance reasons, you
61 should consider some use of --pvmetadatacopies 0 as described in
62 pvcreate(8), and/or use --vgmetadatacopies.
63
64 --vgmetadatacopies NumberOfCopies|unmanaged|all
65 Sets the desired number of metadata copies in the volume group.
66 If set to a non-zero value, LVM will automatically manage the
67 'metadataignore' flags on the physical volumes (see pvcreate or
68 pvchange --metadataignore) in order to achieve NumberOfCopies
69 copies of metadata. If set to unmanaged, LVM will not automati‐
70 cally manage the 'metadataignore' flags. If set to all, LVM
71 will first clear all of the 'metadataignore' flags on all meta‐
72 data areas in the volume group, then set the value to unmanaged.
73 The vgmetadatacopies option is useful for volume groups contain‐
74 ing large numbers of physical volumes with metadata as it may be
75 used to minimize metadata read and write overhead. The default
76 value is unmanaged.
77
78 -s, --physicalextentsize PhysicalExtentSize[bBsSkKmMgGtTpPeE]
79 Sets the physical extent size on physical volumes of this volume
80 group. A size suffix (k for kilobytes up to t for terabytes) is
81 optional, megabytes is the default if no suffix is present. The
82 default is 4 MB and it must be at least 1 KB and a power of 2.
83
84 Once this value has been set, it is difficult to change it with‐
85 out recreating the volume group which would involve backing up
86 and restoring data on any logical volumes. However, if no
87 extents need moving for the new value to apply, it can be
88 altered using vgchange -s.
89
90 If the volume group metadata uses lvm1 format, extents can vary
91 in size from 8KB to 16GB and there is a limit of 65534 extents
92 in each logical volume. The default of 4 MB leads to a maximum
93 logical volume size of around 256GB.
94
95 If the volume group metadata uses lvm2 format those restrictions
96 do not apply, but having a large number of extents will slow
97 down the tools but have no impact on I/O performance to the log‐
98 ical volume. The smallest PE is 1KB.
99
100 The 2.4 kernel has a limitation of 2TB per block device.
101
103 The following options are available for initializing physical devices
104 in the volume group. These options are further described in the pvcre‐
105 ate man page.
106
107 -f, --force
108
109 -y, --yes
110
111 -Z, --zero y|n
112
113 --labelsector sector
114
115 --metadatasize size
116
117 --pvmetadatacopies copies
118
119 --dataalignment alignment
120
121 --dataalignmentoffset alignment_offset
122
124 To create a volume group named test_vg using physical volumes
125 /dev/sdk1, and /dev/sdl1 with default physical extent size of 4MB:
126
127 vgcreate test_vg /dev/sdk1 /dev/sdl1
128
129
131 lvm(8), pvdisplay(8), pvcreate(8), vgdisplay(8), vgextend(8), vgre‐
132 duce(8), lvcreate(8), lvdisplay(8), lvextend(8), lvreduce(8)
133
134
135
136Sistina Software UK LVM TOOLS 2.02.84(2) (2011-02-09) VGCREATE(8)