restvg Command

Purpose

Restores the user volume group and all its containers and files.

Syntax

restvg [ -b Blocks ] [ -d FileName ][ -f Device ] [ -l ] [ -q ] [ -r ] [ -s ] [ -n ] [ -P PPsize ] [ -S ] [ DiskName ... ]

Description

The restvg command restores the user volume group and all its containers and files as specified in the /tmp/vgdata/vgname/vgname.data file, where vgname is the name of the volume group. The /tmp/vgdata/vgname/vgname.data file is contained in the backup image that is created by the savevg command.

The restvg command restores a user volume group. The bosinstall routine reinstalls the root volume group (rootvg). If the restvg command encounters a rootvg volume group in the backup image, the restvg command exits with an error.

If a yes value has been specified in the EXACT_FIT field of the logical_volume_policy stanza of the /tmp/vgdata/vgname/vgname.data file, the restvg command uses the map files to preserve the placement of the physical partitions for each logical volume. The target disks must be of the same size or larger than the source disks specified in the source_disk_data stanzas of the vgname.data file.
Notes:
  • To view the files in the backup image, use restore command with the -T flag.
  • To restore individual files from the backup image, use the restore command with the -x flag.
  • When you run the varyonvg command on the volume group, the logical track group (LTG) size is set to the common max transfer size of the disks.

Flags

Table 1. Flags
Item Description
-b Blocks Specifies the number of 512-byte blocks to read in a single input operation. If this parameter is not specified, the default of 100 is used by the restore command. Larger values result in larger physical transfers to tape devices.
DiskName... Specifies the names of disk devices to be used instead of the disk devices listed in the vgname.data file. The target disk devices must be defined as empty physical volumes, which means that they must contain a physical volume identifier and must not belong to a volume group. If the target disk devices are new, they must be added to the system by using the mkdev command. If the target disk devices belong to a volume group, they must be removed from the volume group by using the reducevg command.
-d FileName The -d flag is an optional flag. When the -d flag is specified, it must be followed by a file name. This file is used as the vgname.data file instead of the one contained within the backup image that is restored. The file name can be specified by either a relative or an absolute path name.
-f Device Specifies the device name of the backup media. The default is /dev/rmt0.
-l Displays useful information about a volume group backup.

This flag requires the -f device flag. This flag causes restvg to display information such as volume group, date and time when the backup was made, uname output from backed up system, oslevel, recommended maintenance and technology levels, backup size in megabytes, and backup shrink size in megabytes. The shrink size is the size of the data on all filesystems. The full size is the total size of each filesystem (unused + data). The -l flag also displays the logical volume and filesystem information of the backed up volume group, equivalent to running lsvg -l vgname.

-n Specifies that the existing MAP files are ignored. The -n flag overrides the value of the EXACT_FIT field in the logical_volume_policy stanza of the vgname.data file.
-P PPsize Specifies the number of megabytes in each physical partition. If not specified, restvg uses the best value for the PPsize, dependent upon the largest disk that is restored. If the PPsize value is not the same as the size specified in the vgname.data file, the number of partitions in each logical volume is altered as per the new PPsize.

If the value of the PPsize that is specified is smaller than the appropriate disk size value, the larger PPsize is used.

If the value of the PPsize that is specified is larger than the appropriate disk size value, the specified larger PPsize value is used.

-q Specifies that the usual prompt is not displayed before the restoration of the volume group image. If this flag is not specified, the prompt displays the volume group name and the target disk-device names.
-r Re-creates only a volume group structure. The -r flag allows restvg command to create (for the specified backup FileName or Device) the volume group, logical volumes, and filesystems, from the backup, without restoring any files or data. This feature is useful for users who use third-party software for restoring data and need all the AIX logical volume structure in place.
Note: The -r flag can be used with either the -f Device flag or the -d FileName flag. This restriction is because the restvg command requires a backup image or vgname.data file to get all the information it needs to re-create the logical volume structure of the volume group wanted.
-s Specifies that the logical volumes be created at the minimum size possible to accommodate the file systems. This size is specified by the value of LV_MIN_LPS field in the lv_data stanza of the vgname.data file where vgname is the name of the volume group.

The -s flag overrides the values of the SHRINK and EXACT_FIT fields in the logical_volume_policy stanza of the vgname.data file. The -s flag causes the same effect as values of SHRINK=yes and EXACT_FIT=no would cause.

-S

start of changeSpecifies that the target physical volumes must have the same encryption policy as the source physical volumes. The source physical volumes are considered encrypted when at least one of the source physical volumes is encrypted. However, the target physical volumes are considered encrypted when all the target physical volumes are encrypted. end of change

start of changeIf the source physical volumes are not encrypted and target physical volumes are encrypted, the restvg command asks to disable the target physical volumes encryption. If the source physical volumes are encrypted and the target physical volumes are not encrypted, the restvg command asks to enable target physical volumes encryption.end of change

Notes:
  • When you use the restvg command with the -S flag, out of all the authentication types, the passphrase and PKS authentication type is only restored in the user volume group. You can add other authentication types after the restoration of the user volume group is complete.
  • start of changeThe encryption policy applies to passphrase authentication and Platform keystore (PKS) encryption authentication method.end of change
  • start of changeThe restvg -S command does not remove the additional encryption methods from the target physical volumes when the backup image of the volume group contains physical volumes that are encrypted only with a passphrase. If the target physical volumes are encrypted by using methods such as key files, key servers, or any other encryption mechanisms, these additional encryption methods remains on the target physical volumes.end of change

Examples

  1. To restore the volume group image from the /dev/rmt1 device, onto the hdisk2 and hdisk3 disks, enter the following command:
    restvg -f/dev/rmt1 hdisk2 hdisk3
  2. To restore the volume group image that is saved in /mydata/myvg file onto the disks that are specified in the vgname.data file that is contained within the backup image, enter the following command:
    restvg -f/mydata/myvg
  3. To re-create the volume group logical volume structure without restoring any files by using only the vgname.data file /home/my_dir/my_vg.data, enter the following command:
    restvg -r -d /home/my_dir/my_vg.data
    Note: vgname.data files can be created for a volume group by using the mkvgdata command.
  4. To re-create the volume group logical volume structure without restoring any files by using the vgname.data file inside the volume group backup that is on the tape in /dev/rmt0, enter the following command:
    restvg -r -f /dev/rmt0
  5. To display volume group information about the volume group backed up on the tape in /dev/rmt0, enter the following command:
    restvg -l -f /dev/rmt0
  6. To restore the volume group image from the /dev/usbms0 device, onto the disks that are specified in the vgname.data file that is contained within the backup image, enter the following command:
    restvg -f /dev/usbms0
    Note: For more information about backing up a volume group, see the listvgbackup command. To restore individual files from a volume group backup, see the restorevgfiles command.