mkvg Command

Purpose

Creates a volume group.

Syntax

mkvg [ -B ] [ -t factor ] [ -S [ -v logicalvolumes ] [ -P partitions ] ] [ -C ] [ -G ] [ -f ] [ -i ] [ -I ][ -c ] [ -x ] [-X none | SSD] [ -L ltgsize ] [ -n ] [ -s size ] [ -V majornumber ] [ -y volumegroup ] [ -M y|s ] [ -p mirrorpool ] [ -O y | n ] [-N o|n]physicalvolume ...

Description

The mkvg command creates a new volume group, using the physical volumes represented by the physicalvolume parameter. After creating the volume group, the mkvg command automatically varies on the new volume group 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 will not be 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 will attempt to determine a proper partition size (-s) and factor (-t) if none is specified on the command line.

Note: If a volume group is created with the -B option, it cannot be imported into AIX® 4.3.1 or lower versions. If a volume group is created with the -S option, it cannot be imported into AIX 5.2 or lower versions.
Note:
  1. The physical volume is checked to verify that it is not already in another volume group. If the mkvg command determines the physical volume belongs to a volume group that is varied on, it will exit 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 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 will 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 will fail 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 manger use chpv -C HDiskName.
  6. On AIX 5.2 and later only Enhanced Concurrent Capable volume groups will be created when the -c or -C flags are specified.

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 Volumes application in Web-based System Manager to change volume characteristics. You could also use the System Management Interface Tool (SMIT) smit mkvg fast path to run this command.

See the section "Administering a PowerHA® cluster" in the PowerHA SystemMirror Administration Guide, 7.1 or later, for a discussion of the behavior of this command in a PowerHA cluster.

Flags

Item Description
-B Creates a Big-type volume group. This 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 log ical volume, adding a physical volume, and so on) may take considerably longer to run.
-c Same as -C flag. On AIX 5.2 and later only Enhanced Concurrent Capable volume groups will be created.
-C Creates an Enhanced Concurrent Capable volume group. Only use the -C flag with the HACMP™ ES. It is not usable on volume groups and systems not using the HACMP 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 HACMP ES and must be configured prior to 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.
-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 will behave as if the volume group had been created prior to 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 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 will be set to the common max transfer size of the disks.

For volume groups created on AIX 5.3 with the -I flag or for volume groups created prior to AIX 5.3, the logical track group size is set to the ltgsize, which must be 128, 256, 512, or 1024. In addition, it should be less than or equal to the maximum transfer size of all disks in the volume group. The default ltgsize is 128 kilobytes.

-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 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.
-S Creates a Scalable-type 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 should only be increased 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 will be the lowest value to remain within the limitation of 1016 physical partitions per PV. The default value for scalable volume groups will be the lowest value to accommodate 2040 physical partitions per PV.
-t factor Changes the limit of the number of physical partitions per physical volume, specified by factor. The factor should be between 1 and 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 will be 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 This flag is ignored. On AIX 5.2 and later only Enhanced Concurrent Capable volume groups will be created.
-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 be SSD media type PVs. When the PV restriction is turned on, the mkvg command will verify 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 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 created is sent to standard output.

The volume group name can only contain 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 AIX Version 7.1 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 three 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 2MB and maximum number of physical partitions per physical volume of 2032. The above configuration means that the size of hdisk1 could not be larger than 4064MB (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.