savevg Command

Purpose

Finds and backs up all files belonging to a specified volume group.

Syntax

savevg [ -a ] [ -A ] [  -b Blocks ] [  -e ] [  -f Device ] [  -i-m ] [ -p ] [ -r ] [ -v ] [ -V ] [-x file] [ -X ] VGName [-Z]

Description

The savevg command finds and backs up all files belonging to a specified volume group. The volume group must be varied-on, and the file systems must be mounted. The savevg command uses the data file created by the mkvgdata command. This data file can be one of the following:

/image.data
Contains information about the root volume group (rootvg). The savevg command uses this file to create a backup image that can be used by Network Installation Management (NIM) to reinstall the volume group to the current system or to a new system.
/tmp/vgdata/vgname/vgname.data
Contains information about a user volume group. The VGName variable reflects the name of the volume group. The savevg command uses this file to create a backup image that can be used by the restvg command to remake the user volume group.

To create a backup of the operating system to CD, use the mkcd command.

Note: The savevg command will not generate a bootable tape if the volume group is the root volume group. Although the tape is not bootable, the first three images on the tape are dummy replacements for the images normally found on a bootable tape. The actual system backup is the fourth image.

Flags

Item Description
-a Does not back up extended attributes or NFS4 ACLs.
-A Backs up DMAPI file system files.
-b Blocks Specifies the number of 512-byte blocks to write in a single output operation. If this parameter is not specified, the backup command uses a default value appropriate for the physical device selected. Larger values result in larger physical transfers to tape devices. The value specified must be a multiple of the physical block size of the device being used.
-e Excludes files specified in the /etc/exclude.vgname file from being backed up by this command.
Note: If you want to exclude certain files from the backup, create the /etc/exclude.rootvg file, with an ASCII editor, and enter the patterns of file names that you do not want included in your system backup image. The patterns in this file are input to the pattern matching conventions of the grep command to determine which files will be excluded from the backup. If you want to exclude files listed in the /etc/exclude.rootvg file, select the Exclude Files field and press the Tab key once to change the default value to yes.

For example, to exclude all the contents of the directory called scratch, edit the exclude file to read as follows:

	/scratch/

For example, to exclude the contents of the directory called /tmp, and avoid excluding any other directories that have /tmp in the pathname, edit the exclude file to read as follows:

	^./tmp/

All files are backed up relative to . (current working directory). To exclude any file or directory for which it is important to have the search match the string at the beginning of the line, use ^ (caret character) as the first character in the search string, followed by . (dot character), followed by the filename or directory to be excluded.

If the filename or directory being excluded is a substring of another filename or directory, use ^. (caret character followed by dot character) to indicate that the search should begin at the beginning of the line and/or use $ (dollar sign character) to indicate that the search should end at the end of the line.

-f Device Specifies the device or file name on which the image is to be stored. The default is the /dev/rmt0 device.
-i Creates the data file by calling the mkvgdata command.
-m Creates the data file with map files by calling the mkvgdata command with the -m flag.
-p Disables software packing of the files as they are backed up. Some tape drives use their own packing or compression algorithms.
-r Backs up user volume group information and administration data files. This backs up files such as /tmp/vgdata/vgname/vgname.data and map files if any exist. This does not back up user data files. This backup can be used to create a user volume group without restoring user data files. This cannot be done to rootvg.
-v Verbose mode. Lists files as they are backed up.
-V Verifies a tape backup. This flag causes savevg to verify the file header of each file on the backup tape and report any read errors as they occur.
-x file Exclude the file systems listed in the file from the volume group backup. One file system mount point is listed per line.
-X Specifies to automatically expand the /tmp file system if necessary. The /tmp file system may need to be extended to make room for the boot image when creating a bootable backup to tape.
-Z Specifies that the Encrypted File System (EFS) information for all the files, directories, and file systems is not backed up. The flag runs the backup command without the -Z flag.

Parameters

Item Description
VGName Specifies the name of the volume group to be backed up.

SMIT Fast Paths

  1. To list the contents of a root volume group backup that is created with the savevg command, enter the following SMIT fast path:
    smit lsmksysb
  2. To list the contents of a user volume group backup that is created with the savevg command, enter the following SMIT fast path:
    smit lsbackvg
  3. To restore individual files from a root volume group backup, enter the following SMIT fast path:
    smit restmksysb
  4. To restore individual files from a user volume group backup, enter the following SMIT fast path:
    smit restsavevg

Examples

  1. To back up the root volume group (operating system image) to the /mysys/myvg/myroot backup file and create an /image.data file, enter:
    savevg -i -f/mysys/myvg/myroot rootvg
  2. To back up the uservg volume group to the default tape drive (dev/rmt0) and create a new uservg.data file, enter:
    savevg -i uservg
  3. To back up the data2 volume group and create map files along with a new data2.data file on rmt1 device, enter:
    savevg -mf/dev/rmt1 data2
  4. To back up the data2 volume group, excluding the files listed in the /etc/exclude.data2 file, enter:
    savevg -ief/dev/rmt1 data2
  5. To back up the volume group my_vg to the tape in /dev/rmt0 and then verify the readability of file headers, enter:
    savevg -f /dev/rmt0 -V my_vg
  6. To back up the uservg volume group to the UDFS capable device/dev/usbms0, enter the following command:
    savevg –i –f /dev/usbms0

Files

Item Description
/image.data Used when the volume group is rootvg.
/tmp/vgdata/vgname /vgname.data Used when the volume group is not rootvg and where vgname is the name of the volume group.