views:

2299

answers:

2

Is it possible to use AIX's mksysb and savevg to create a bootable tape with the rootvg and then append all the other VGs?

A: 

First, use savevg to backup any extra volume groups to a file system on the rootvg:

savevg -f /tmp/vgname

Compress it if it will be too large, or use the -i option to exclude files. The easiest way is to exclude all files on the volume group and restore those off of the regular backup device. Once that is done, create your normal mksysb.

For DR purposes, restore the system using the mksysb, then use restvg to restore the volume groups out of your backup files. Restore any extra files that may have been excluded, and you're running again.

+1  A: 

Answering my own question:

To backup, use a script similar to this one:

tctl -f/dev/rmt0 rewind
/usr/bin/mksysb -p -v   /dev/rmt0.1
/usr/bin/savevg -p -v -f/dev/rmt0.1 vg01
/usr/bin/savevg -p -v -f/dev/rmt0.1 vg02
/usr/bin/savevg -p -v -f/dev/rmt0.1 vg03
   ...etc...
tctl -f/dev/rmt0 rewind

Notes:
- mksysb backs up rootvg and creates a bootable tape.
- using "rmt0.1" prevents auto-rewind after operations.

Also, mkszfile and mkvgdata were used previously to create the "image.data" and various "vgdata" and map files. I did this because my system runs all disks mirrored and I wanted the possibility of restoring with only half the number of disks present. All my image.dat, vgdata and map files were done unmirrored to allow more flexibility during restore.

To restore, the procedures are:

For rootvg, boot from tape and follow the on-screen prompt (a normal mksysb restore).

For the other volume groups, it goes like this:

tctl -f/dev/rmt0.1 rewind
tctl -f/dev/rmt0.1 fsf 4
restvg -f/dev/rmt0.1 hdisk[n]

"fsf 4" will place the tape at the first saved VG following the mksysb backup. Use "fsf 5" for the 2nd, "fsf 6" for the 3rd, and so on.

If restvg complains about missing disks, you can add the "-n" flag to forego the "exact map" default parameter.

If you need to recuperate single files, you can do it like this:

tctl -f/dev/rmt0 rewind
restore -x -d -v -s4 -f/dev/rmt0.1 ./[path]/[file]

"-s4" is rootvg, replace with "-s5" for 1st VG following, "-s6" for 2nd, etc. The files are restored in your current folder.

This technique gives you a single tape that can be used to restore any single file or folder; and also be used to completely rebuild your system from scratch.

Guy Gervais