This document describes how to restore individual files and directories from a Sysback backup using specific low level commands. Although these commands are intended for use in normal mode, with the appropriate tape device manipulation commands, you can use these steps in service mode to restore data. Normally these commands would only be used in an emergency, such as when the normal Sysback commands are not restoring the data successfully or when restoring in service mode.
This method will function at AIX 3.2.5 and above with Sysback versions 3 and 4.
NOTE: This method does NOT replace the full functionality of restoring data. Use normal Sysback methods and procedures to restore an entire system. This method is only for recovering individual files when the user is unable to restore files normally with Sysback either through the Sysback commands on command line or through SMIT, or as directed by the AIX Support Center. Note also that replacing operating system specific files and/or directories in this manner is not necessarily a supported method of recovering from a disaster and system stability may be compromised. So, in many cases it is advised to recover rootvg using normal methods.
All example commands will use generic device names such as rmt0. The exact device name to use will vary depending on the system. A list of devices on the system may be found with the following command:
lsdev -C | more
For clarification on the differences between Sysback versions 3 and 4,
see
the section Differences between Sysback versions 3 and 4.
Related documentation
The product documentation library is also available:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html
cd /
tctl -f /dev/rmt0 rewind
tctl -f /dev/rmt0.1 fsf 4
sbread -H rmt0.1
-----------| Example Header |------------ Date: Thu Jun 29 08:26:54 2000 User: root Host: mars Type: Volume Group Data: rootvg Size: 688 megabytes Packed: N Buffer: 256 Kbytes Volume: 1 -----------| End Example |---------------
tctl -f /dev/rmt0 rewind
To restore any data from the rootvg volume group on the Sysback tape, enter the following command to forward the tape to the correct position:
tctl -f /dev/rmt0.1 fsf 4
The preceding command will position the tape so that it is positioned before the rootvg volume group image, which is actually the fifth image on the tape. All rootvg filesystems are included in this image, and the other volume groups' images would follow.
NOTE: You must include the filesystem mount point in the path. This is different from Sysback version 4.
If the Packed flag's value is N, use one of the following commands depending on the type of data being restored:
sbread -x rmt0 | restbyname -xvqdf- ./<path_to_directory> sbread -x rmt0 | restbyname -xvqf- ./<path_to_file>
If the Packed flag's value is Y, use one of the following commands depending on the type of data being restored:
sbread -x rmt0 | sbuncomp | restbyname -xvqdf- ./<path_to_directory> sbread -x rmt0 | sbuncomp | restbyname -xvqf- ./<path_to_file>
As an example, if you are restoring /tmp, first rewind the tape, and reposition it to the correct image:
sbdevice -r rmt0 sbdevice -f4 rmt0.1
To restore the /tmp directory, enter:
sbread -x rmt0 | restbyname -xvqdf- ./tmp
To restore only the /etc/passwd file, enter:
sbread -x rmt0 | restbyname -xvqf- ./etc/passwd
cd /
If you need to restore to a different destination other than the original location, change the directory to the desired location.
tctl -f /dev/rmt0 rewind
tctl -f /dev/rmt0.1 fsf 4
sbread -H rmt0.1
-----------| Example Header |------------ Date: Fri Feb 18 12:43:15 2000 User: root Host: mars Type: TOC - System Backup Data: rootvg Size: 219 megabytes Packed: N Buffer: 64 Kbytes Bkend: B Volume: 1 Backup Volume: 1 Image Number: 1 -----------| End Example |---------------
tctl -f /dev/rmt0 rewind
First data image: /dev/hd4 mounted on / |
Second data image: /dev/hd2 mounted on /usr |
Subsequent data images: (Each filesystem and raw logical volume in alphabetical order (excluding / and /usr) will have one data image each. |
As an example, a default rootvg would consist of the following filesystems in order on the Sysback tape:
If you created a filesystem named /data which was present in the rootvg, then the list of data images would appear in the order:
For Sysback version 4, each filesystem and raw logical volume is contained in its own separate individual images on tape. rootvg volume group data images are located on the tape after the boot image and Sysback images. The data images start at image number 6 on the tape. The first five images are the boot image, an install image, a dummy image, a Sysback program install image, and the Sysback table of contents for the backup.
To restore from the first data image (/) on the Sysback tape, enter the following command to forward the tape to the correct position:
tctl -f /dev/rmt0.1 fsf 5
The preceding command will correctly position the tape so that it is positioned before the first data image, which is actually the sixth image on the tape. The /usr filesystem would be the seventh image, and the other filesystems raw logical volumes would follow.
NOTE: Do not include the filesystem mount point in the path. For example, if restoring the directory /tmp, then only the path ./ would be specified. The filesystem mount point is already assumed by the command as it knows what image it is restoring the data from.
If the Packed value is N and the Bkend value is B, use one of the following commands:
sbread -x rmt0 | restbyname -xvqdf- ./<path_to_directory> sbread -x rmt0 | restbyname -xvqf- ./<path_to_file>
If the Packed value is N, and the Bkend value is T, use one of the following commands:
sbread -x rmt0 | tar -xvf ./<path_to_directory> sbread -x rmt0 | tar -xvf ./<path_to_file>
If the Packed value is Y and the Bkend value is B, use one of the following commands:
sbread -x rmt0 | sbuncomp | restbyname -xvqdf- ./<path_to_directory> sbread -x rmt0 | sbuncomp | restbyname -xvqf- ./<path_to_file>
If the Packed value is Y and the Bkend value is T, use one of the following commands:
sbread -x rmt0 | sbuncomp | tar -xvf ./<path_to_directory> sbread -x rmt0 | sbuncomp | tar -xvf ./<path_to_file>
As an example, if you are restoring /tmp, you would first rewind the tape, reposition it to the correct image so the following commands could be executed:
tctl -f /dev/rmt0 rewind tctl -f /dev/rmt0.1 fsf 9
To restore the /tmp directory, enter:
sbread -x rmt0 | restbyname -xvqdf- ./
To restore only the /tmp/tempdata/datalog file, enter:
sbread -x rmt0 | restbyname -xvqf- ./tempdata/datalog
tctl -f /dev/rmt0 rewind
cd /
tctl -f /dev/rmt0.1 fsf 3
restbyname -xvqf /dev/rmt0.1 ./tmp/...blksz
tctl -f /dev/rmt0 rewind
cat ./tmp/...blksz
chdev -a block_size=X -l rmt0
The purpose of this section is to describe the differences between versions 3 and 4 of Sysback.
Version 3 of Sysback has four images on tape before the data images in the following order:
All subsequent images consist of one image per volume group that was included in the backup starting with rootvg.
Version 4 of Sysback has five images on tape before the data images in the following order:
All subsequent images consist of the raw logical volumes and filesystems that constitute the volume groups in the following order:
For example, if a Sysback version 4 backup contains a standard rootvg volume group (no user made logical volumes or filesystems), a datavg volume group consisting of the filesystems /data, /data2, /mail, and a volume group called dbvg with the filesystems /db1, db2, /orders, then the order of the images on the tape would be as follows assuming that datavg is before dbvg:
Filesystem mountpoint in restore path
The filesystem mountpoint is included in all Sysback version 3 restores
because all of the filesystems are included in the same image.
The filesystem mountpoint is not included in any Sysback version 4
restores because every filesystem is in its own data image. This
helps with reduced filelist sizes as the filesystem mountpoint is written
only to the header.
[ Doc Ref: 96394324025386 Publish Date: Jan. 23, 2001 4FAX Ref: 8799 ]