importvg Command

Purpose

Imports a new volume group definition from a set of physical volumes.

Syntax

importvg [ -V MajorNumber ] [ -y VolumeGroup ] [ -f ] [ -c ] [ -x ] | [ -L VolumeGroup ] [ -n ] [ -F ] [ -R ] [ -I ] [-O ] PhysicalVolume

Description

The importvg command makes the previously exported volume group known to the system. The PhysicalVolume parameter specifies only one physical volume to identify the volume group; any remaining physical volumes (those belonging to the same volume group) are found by the importvg command and included in the import. An imported volume group is automatically varied unless the volume group is Concurrent Capable. You must use the varyonvg command to activate Concurrent Capable volume groups before you access them.

When a volume group with file systems is imported, the /etc/filesystems file is updated with values for the new logical volumes and mount points. After importing the volume group and activating it with the varyonvg command, you must run the fsck command before the file systems can be mounted. However, the mount point information would be missing from the LVCB (logical volume control block) if it is longer than 128 characters. In this case, the importvg command will not be able to update the /etc/filesystems file with the stanza for the newly imported logical volume. You should manually edit the /etc/filesystems file to add a new stanza for this logical volume.

The importvg command changes the name of a logical volume if the name already exists in the system. It prints a message and the new name to standard error, and updates the /etc/filesystems file to include the new logical volume name. If the importvg command renames any filesystem log logical volumes, you must manually update any file systems using that log device to know about the renamed device.

Notes:
  1. To use this command, you must either have root user authority or be a member of the system group.
  2. AIX® Version 4 changed the behavior of importvg so that as part of the importvg process, the volume group is automatically varied on by the system after it is imported. However, if the volume group is Concurrent Capable then the importvg command prompts you to varyonvg the imported volume group manually.
  3. A volume group with a mirrored striped logical volume cannot be back ported into a version older than AIX 4.3.3.

You can use the Volumes application in Web-based System Manager (wsm) to change volume characteristics. You could also use the System Management Interface Tool (SMIT) smit importvg 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
-c This flag is ignored. On AIX 5.2 and higher only Enhanced Concurrent Capable volume groups will be created.
-f Forces the volume group to be varied online.
-LVolumeGroup Takes a volume group and learns about possible changes performed to that volume group. Any new logical volumes created as a result of this command emulate the ownership, group identification, and permissions of the /dev special file for the volume group listed in the -y flag. The -L flag performs the functional equivalent of the -F and -n flags during execution.

Restrictions:

  • The volume group must not be in an active state on the system executing the -L flag.
  • The volume group's disks must be unlocked on all systems that have the volume group varied on and operational. Volume groups and their disks may be unlocked, remain active and used via the varyonvg -b -u command.
  • The physical volume name provided must be of a good and known state, the disk named may not be in the missing or removed state.
  • If a logical volume name clash is detected, the command will fail. Unlike the basic importvg actions, clashing logical volume names will not be renamed.
-F Provides a fast version of importvg that checks the Volume Group Descriptor Areas of only the disks that are members of the same volume group. As a result, if a user exercises this flag, they must ensure that all physical volumes in the volume group are in a good and known state. If this flag is used on a volume group where a disk may be in missing or removed state, the command may fail or the results may be inconsistent.
-I Causes the importvg command to fail if imfs fails.
-n Causes the volume not to be varied at the completion of the volume group import into the system.
-O Forces varyon the volume group even if it is varied on in some other node.
Note: In AIX 61 TL8 and later releases, varyonvg command updates the LVM metadata and ODM with varyon state of the volume group. During varyon time, varyonvg command reads this data and fails if the volume group is already varied in another node. Varyoffvg command resets the varyon state of the volume group during varyoff time. If system crashes before varying off the volume group or the volume group is forced off, then varyonvg command will fail after reboot. In this scenario, use –O flag to force varyon the volume group.
-R Restores the ownership, group ID, and permissions of the logical volume special device files. These values will be restored only if they were set using U, G and P flags of mklv and chlv commands. This flag is applicable only for volume groups of the types big and scalable.
-V MajorNumber Specifies the major number of the imported volume group.
-x This flag is ignored. On AIX 5.2 and higher only Enhanced Concurrent Capable volume groups will be created.
Attention: This entry must be added after the entry used to initiate srcmstr.
Item Description
-y VolumeGroup Specifies the name to use for the new volume group. If this flag is not used, the system automatically generates a new name.

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

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 import the volume group bkvg from physical volume hdisk7, enter:

    importvg  -y bkvg hdisk7

    The volume group bkvg is made known to the system.

  2. To use the -L on a multi-tailed system:
    Node A has the volume group datavg varied on.
    Node B is aware of datavg, but it is not varied on.
    Node A: varyonvg -b -u datavg
    Node B: importvg -L datavg hdisk7
    Node A: varyonvg datavg

Files

Item Description
/usr/sbin Directory where the importvg command resides.
/tmp Directory where the temporary files are stored while the command is running.