mkvg Command
Purpose
Creates a volume group.
Syntax
mkvg [ -B ] [ -t factor ] [ -S [ -v logicalvolumes ] [ -P partitions ] ] [ -C ] [ -G ] [ -f ] [ -i ] [ -I ][ -c ] [-X none | SSD] [ -L ltgsize ] [ -n ] [ -s size ] [ -V majornumber ] [ -y volumegroup ] [ -M y|s ] [ -p mirrorpool ] [ -O y | n ] [-N o|n] [-r y|n] [ -e y|n] [-k y | n] physicalvolume ...
Description
The mkvg command creates a new volume group, by using the physical volumes that are represented by the physicalvolume parameter. After creating the volume group, the mkvg command automatically varies on the new volume group by using the varyonvg command. The exception to this fact is when the volume group is created with the -C flag. When the volume group is successfully created, the volume group is not varied on automatically. Instead, the user must manually varyon the volume group.
The mkvg command by default creates a volume group that can accommodate 255 logical volumes and 32 physical volumes (disks). These limits can be extended by specifying either the -B or -S flag.
The mkvg command attempts to determine a proper partition size (-s) and factor (-t) if none is specified on the command line.
- The physical volume is checked to verify that it is not already in another volume group. If the mkvg command determines that the physical volume belongs to a volume group that is varied on, it exits without creating the volume group. If the mkvg command determines the physical volume belongs to a volume group that is not varied on, the force option (-f) must be used to create the volume group. When using the force option, the previous contents of the physical volume are lost, so the user must use caution when using the force option.
- To use this command, you must either have root user authority or be a member of the system group.
- When creating the default volume group type (with a maximum of 32 PVs) or the big volume group type (with a maximum of 128 PVs), there is a limitation of 1016 physical partitions per PV. When specifying the physical partition size (-s), make sure that the value is set large enough so that 1016 physical partitions per PV limit is not violated. For example, a partition size of at least 16 MB would be needed to create a volume group with a 10-GB disk. Using a factor size (-t) of 2, a smaller partition size of 8 MB can be used. If a factor value is specified, the maximum number of PVs that can be included in the volume group is MaxPVs/factor.
- Whenever you create a volume group, the operating system automatically does a varyon. However, if you create a volume group with the -C flag, the system does not autovaryon the volume group at the end of the Concurrent Capable volume group creation. Instead, the mkvg command notifies you to manually varyonvg the volume group in either non-concurrent or concurrent mode.
- This command fails to add a disk to the volume group if the disk indicates that it is managed by a third-party volume manager. To override and clear the disk of the third-party volume manager use chpv -C HDiskName.
- Only Enhanced Concurrent Capable volume groups are created when the -c or -C flags are specified.
- You must not mix 4 KB block physical volumes (PV) with PV blocks of other sizes. The block size of all PVs in the volume group must be the same. You can not import the volume group that is created with 4 KB block PVs on a version of AIX® that does not support 4 KB block PVs.
- Bad block relocation policy of a volume group is not supported on a volume group that is created with 4 KB block PVs.
Because the VGDA space has been increased substantially, every VGDA update operation (creating a logical volume, changing a logical volume, adding a physical volume, and so on) might take considerably longer to run.
You can use the System Management Interface Tool (SMIT) smit mkvg fast path to run this command.
Flags
Item | Description |
---|---|
-B | Creates a big type of volume group. This type can accommodate up to 128 physical
volumes and 512 logical volumes. Note: Because the VGDA space has been increased substantially,
every VGDA update operation (creating a logical volume, changing a logical volume, adding a physical
volume, and so on) might take considerably longer to run.
|
-c | Same as -C flag. Only Enhanced Concurrent Capable volume groups are created. |
-C | Creates an Enhanced Concurrent Capable volume group. Only use the -C flag with the PowerHA® SystemMirror® enhanced scalability (ES). It is not usable on
volume groups and systems that do not use the PowerHA SystemMirror
ES product. Use this flag to create an Enhanced Concurrent Capable volume group. Note:
|
-e y|n | Enables the Critical PVs option of the volume group. This flag is available
in IBM®
AIX 7.2 with Technology Level 1, or later.
|
-f | Forces the volume group to be created on the specified physical volume unless the physical volume is part of another volume group in the Device Configuration Database or a volume group that is active. |
-G | Same as -B flag. |
-i | Reads the PhysicalVolume parameter from standard input. |
-I | Creates a volume group that can be imported to AIX Version 6.1. The LTGSize behaves as if the volume group had been created before AIX Version 6.1. If the logical volumes are later created with a strip size that is larger than the supported strip size on AIX Version 6.1 or AIX Version 6.1 (a strip size that is multiplied by the number of disks in an array equals the stripe size), then attempting to import the volume group back to AIX Version 6.1 or AIX Version 6.1 is not supported. |
-k y|n | Enables the data encryption option in the volume group. The
-k flag is available in IBM AIX 7.2 with Technology Level 5, or later. You can specify the following
values for this flag:
|
-L ltgsize | For volume groups created on AIX Version 6.1 without the
-I flag, the -L flag is ignored. When the volume group is varied on the logical track
group size is set to the common maximum transfer size of the disks. For volume groups created on
AIX Version 6.1 with the -I flag or for volume groups that
are created before AIX Version 6.1, the logical track group size is
set to the ltgsize, which must be |
-M y|s | Enables mirror pool strictness for the volume group.
|
-N o|n |
|
-n | Specifies that the volume group is not automatically available during a system restart. The default value activates the volume group automatically. |
-O y / n | Enables the infinite retry option of the logical
volume.
Note: The infinite retry option is not supported in
the Geographic Logical Volume Manager (GLVM) environment.
|
-p mirrorpool | Assigns each of the physical volumes that are being added to the specified mirror pool. After mirror pools are enabled in a volume group, the volume group can no longer be imported into a version of AIX that does not support mirror pools. |
-P partitions | Total number of partitions in the volume group, where the Partitions variable is represented in units of 1024 partitions. Valid values are 32, 64, 128, 256, 512 768, 1024 and 2048. The default is 32 k (32768 partitions). The chvg command can be used to increase the number of partitions up to the maximum of 2048 k (2097152 partitions). This option is only valid with the -S option. |
-r y|n | Enables the Critical VG option
of the volume group. The -r flag can have the
following values:
|
-S | Creates a scalable type of volume group. By default, this volume group
can accommodate up to 1024 physical volumes, 256 logical volumes, and 32768 physical partitions. To
increase the number of logical volumes, use the -v option. To increase the number of physical
partitions, use the -P option. Note: Increasing maxlvs and maxpps beyond the
default values for a scalable volume group can significantly increase the size of the VGDA
proportionately. The maxlvs and maxpps values must be increased only as needed because
they cannot be decreased. Meanwhile, as the VGDA space increases all VGDA update operations
(creating a logical volume, changing a logical volume, adding a physical volume, and so on) can take
longer and longer to run.
|
-s Size | Sets the number of megabytes in each physical partition, where the Size variable is expressed in units of megabytes from 1 (1 MB) through 131072 (128 GB). The Size variable must be equal to a power of 2 (example 1, 2, 4, 8). The default value for 32 and 128 PV volume groups is the lowest value to remain within the limitation of 1016 physical partitions per PV. The default value for scalable volume groups is the lowest value to accommodate 2040 physical partitions per PV. |
-t factor | Changes the limit of the number of physical partitions per physical volume, which is specified by factor. The factor must be 1 - 16 for 32 PV volume groups and 1 and 64 for 128 PV volume groups. The maximum number of physical partitions per physical volume for this volume group changes to factor x 1016. The default is the lowest value to remain within the physical partition limit of factor x 1016. The maximum number of PVs that can be included in the volume group is MaxPVs/factor. The -t option is ignored with the -S option. |
-V majornumber | Specifies the major number of the volume group that is created. |
-v | Number of logical volumes that can be created. Valid values are 256, 512, 1024, 2048 and 4096. The default is 256. The chvg command can be used to increase the number of logical volumes up to the maximum of 4096. This option is only valid with the -S option. The last logical volume is reserved for metadata. |
-X none|SSD | Enables PV type restriction for the volume group.
This option allows a volume group to be created with a specific restriction
based on the PV type. "none" is the default value. "SSD" requires
that all PVs in the volume group must be SSD media type PVs. When
the PV restriction is turned on, the mkvg command verifies
that all PVs meet this condition. Once a PV restriction is turned
on, the volume group can no longer be imported on a version of AIX that does not support PV type
restrictions.
|
-y volumegroup | Specifies the volume group name rather than having the name
generated automatically. Volume group names must be unique system
wide and can range from 1 to 15 characters. The name cannot begin
with a prefix already defined in the PdDv class in the Device
Configuration database for other devices. The volume group name that
is created is sent to standard output. The volume group name can only contain only the following characters: "A" through "Z," "a" through "z," "0" through "9," or "_" (the underscore), "-" (the minus sign), or "." (the period). All other characters are considered invalid. |
Security
Examples
- To create a volume group that contains 3 physical volumes with
partition size set to 1 megabyte, type: mkvg -s 1 hdisk3 hdisk5 hdisk6The volume group is created with an automatically generated name, which is displayed and available at system restart time.
mkvg -s 2 -t 2 -y newvg hdisk1
The volume group newvg is created with a physical partition size of 2-MB and maximum number of physical partitions per physical volume of 2032. The configuration mentioned in the example means that the size of hdisk1 can not be larger than 4064-MB (2032*2)
- To create a volume group that can accommodate a maximum of 1024
physical volumes and 2048 logical volumes, type:
mkvg -S -v 2048 hdisk6
Files
Item | Description |
---|---|
/usr/sbin | Directory where the mkvg command resides. |
/tmp | Directory where the temporary files are stored while the command is running. |
/dev | Directory where the character device entry for the volume group is created. |