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] 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.

Note:
  1. 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.
  2. To use this command, you must either have root user authority or be a member of the system group.
  3. 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.
  4. 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.
  5. 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.
  6. Only Enhanced Concurrent Capable volume groups are created when the -c or -C flags are specified.
  7. 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.
  8. 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:
  1. Enhanced Concurrent volume groups use Group Services. Group Services ships with PowerHA SystemMirror ES and must be configured before activating a volume group in this mode.
  2. Only Enhanced Concurrent Capable volume groups are supported when running with a 64-bit kernel. Concurrent Capable volume groups are not supported when running with a 64-bit kernel.
  3. Enhanced Concurrent Capable volume groups have multinode varyon protection enabled. See the -N flag for details about multinode varyon protection.
-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 5.1 and AIX 5.2. The LTGSize behaves as if the volume group had been created before AIX 5.3. If the logical volumes are later created with a strip size that is larger than the supported strip size on AIX 5.1 or AIX 5.2 (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 5.1 or AIX 5.2 is not supported.
-L ltgsize For volume groups created on AIX 5.3 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 5.3 with the -I flag or for volume groups that are created before AIX 5.3, the logical track group size is set to the ltgsize, which must be 128, 256, 512, or 1024. In addition, it must be less than or equal to the maximum transfer size of all disks in the volume group. The default ltgsize is 128-KB.

-M y|s Enables mirror pool strictness for the volume group.
y
Mirror pools must be used on each logical volume in the volume group.
s
Super-strict mirror pools are enforced on this volume group.
-N o|n
o
Creates a volume group that is allowed to varyon in non-concurrent mode in more than one node at the same time. This is the default value.
n
Creates a volume group that is not allowed to varyon in non-concurrent mode in more than one node at the same time. This volume group can no longer be imported on a version of the AIX operating system that does not support the -N flag.
-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.
n
The infinite retry option of the logical volume is not enabled. The failing I/O of the logical volume is not retried. This is the default value.
y
The infinite retry option of the logical volume is enabled. The failed I/O request is retried until it is successful.
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:
y
The Critical VG option of the volume group is enabled. If the volume group is created with the Critical VG option turned on, any I/O request failure starts writing the logical volume manager (LVM) metadata to check the state of the disk before returning the I/O failure. If the rootvg volume group is set to the Critical VG option and if the volume group looses access to quorum set of disks (or all disks if quorum is disabled), instead of forcing the volume group to an offline state, the node crashes and a message is displayed on the console.
n
The Critical VG option of the volume group is not enabled. It is the default value.
-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.
-Xnone|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.
none
As an option, there is no PV restriction. volume group can be formed on any disk type. This is the default value.
SSD
As an option, volume group is restricted to SSD PV types. Disks that are listed in physical volume argument must be of type SSD.
-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

Note:
Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To create a volume group that contains 3 physical volumes with partition size set to 1 megabyte, type:
    mkvg  -s 1 hdisk3 hdisk5 hdisk6
    The 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)

  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.