Question & Answer
Question
This document will describe the process to stack savevg backups behind a mksysb backup that has been taken to tape.
Answer
This document will describe the process to stack savevg backups behind a mksysb backup that has been taken to tape.
The most important thing to remember in this situation is your exact location on the tape at any given time. Not knowing this information can result in an unintentional overwrite of a previously backed up volume group or even the mksysb data itself, which would render it inaccessible.
Backing up:
First, you need to know what a mksysb and savevg backup looks like - in other words, how many images are created for both types of backups.
A mksysb taken to tape has a total of 4 images :
|boot_image|rootvg_info_files|dummy .toc|rootvg_data
A savevg taken to tape has 1 image :
|savevg_data|
For this document's example we will be using a rootvg and 3 non-rootvg volume groups. The tape device will always be referred to as /dev/rmt0.
# lspv
hdisk0 000048ed5ee29d6a rootvg
hdisk1 000048ede90ece12 datavg
hdisk2 000048edced747b8 nimvg
hdisk3 000048ed3b9e3344 backupsvg
At the conclusion of the instructions below the completed tape backup will contain the following images:
|boot_image|rootvg_info_files|dummy.toc|mksysb_backup|datavg_backup|nimvg backup|backupsvg backup
A total of 7 images.
First, we initiate the mksysb :
# mksysb -ipX /dev/rmt0
After the mksysb completes it will automatically rewind. You'll want to skip ahead to the END of the 4th tape record (or beginning of the 5th tape record - however you want to look at it) to start your first savevg backup. The use of the ".1" at the end of the tape device indicates that it should not rewind after completion of the command given.
To skip to the end of your mksysb (the end of the 4th record) :
# tctl -f /dev/rmt0.1 fsf 4
Now start the first savevg backup :
# savevg -ipXf /dev/rmt0.1 datavg
Again, using the ".1" tells the process to not rewind when it has completed the backup. You can now continue with your next savevg backup :
# savevg -ipXf /dev/rmt0.1 nimvg
Finally, we backup our 3rd volume group :
# savevg -ipXf /dev/rmt0.1 backupsvg
Make sure you keep track of which images are on the tape. Using a format on the tape's label similar to the example below would be very helpful to not only you, but someone else that may need to use this tape and may not know the structure of the backup :
Backup Tape Images :
1-4 mksysb
5. datavg (hdisk1)
6. nimvg (hdisk2)
7. backupsvg (hdisk3)
Restoring:
In order to restore your mksysb image, follow normal mksysb restoration procedures, which are covered in the document “Backing up the Operating System in AIX 4 and 5”.
There are a few options to restore the volume group based on the data you would like back. I will cover the standard information here, as more detailed information is covered the document “Backing up a non-root volume group in AIX 4 and 5”.
Example :
To restore datavg back to hdisk1 :
- rewind the tape back to the beginning :
# tctl -f /dev/rmt0 rewind
- skip to the appropriate image location of the volume group (in this case the end of image 4 / beginning of image 5) :
# tctl -f /dev/rmt0.1 fsf 4
- issue the restvg command to rebuild and restore the volume group :
# restvg -f /dev/rmt0.1 hdisk1
From this point you can either rewind back to the beginning, or if you needed to restore nimvg you are already in the proper place to start that restore (the end of the 5th image / beginning of the 6th image).
Example :
Not moving the tape from the example above, you’re able to restore nimvg without any moving of image locations from our current spot on the tape.
# restvg -f /dev/rmt0.1 hdisk2
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
isg3T1010779