The information in this document applies to AIX Versions 3.2.5 and above with Sysback versions 3 and 4.
NOTE: This method does NOT replace the full functionality of recovering an entire rootvg volume group. Use normal Sysback methods and procedures to restore an entire system. The method described in this document is only for recovering individual files when you do not need to restore the entire rootvg volume group. 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 that system stability may be compromised. So, in many cases it is advised to recover rootvg volume group 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 can be found with the following command:
lsdev -C | more
Note that the rmt device names will not necessarily be equivalent to the rmt device names when the system is/was in normal mode.
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 and can be accessed at
the following URL:
http://www.rs6000.ibm.com/resource/aix_resource/Pubs/index.html
getrootfs
start a shell before mounting filesystems
ksh>
mount /dev/hd4 /mnt mount /dev/hd2 /mnt/usr
This preceding commands would mount the / filesystem on the /mnt mount point. Following is a list of the default mount points and logical volume names for each of the rootvg volume group filesystems.
Filesystem Mounted on /dev/hd4 / /dev/hd2 /usr /dev/hd9var /var /dev/hd3 /tmp /dev/hd1 /home
cd /mnt
echo *
sbdevice -r rmt0
sbdevice -f4 rmt0.1
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 |---------------
sbdevice -r rmt0
So, 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:
sbdevice -f4 rmt0.1
The preceding command will position the tape so that it is positioned before the root 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 (see below for details).
If the Packed value is N, 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 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, you would 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
getrootfs
start a shell before mounting filesystems
ksh>
mount /dev/hd4 /mnt
This would mount the / filesystem on the /mnt mount point. Following is a list of the default mount points and logical volume names for each of the rootvg volume group filesystems.
Filesystem Mounted on /dev/hd4 / /dev/hd2 /usr /dev/hd9var /var /dev/hd3 /tmp /dev/hd1 /home
cd /mnt
echo *
sbdevice -r rmt0
sbdevice -f5 rmt0.1
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 |---------------
sbdevice -r rmt0
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 volume group would consist of the following filesystems in order on the Sysback tape:
If you created a filesystem named /data which were present in the rootvg, the list of data images would appear in the order:
For Sysback version 4, each filesystem and raw logical volume is contained in their 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:
sbdevice -f5 rmt0.1The preceding command will place 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 /usr/lpp, only the path ./lpp 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 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 Bkend value is T, use one of the following commands depending on the type of data being restored:
sbread -x rmt0 | tar -xvf ./path_to_directory sbread -x rmt0 | tar -xvf ./path_to_file
If the Packed value is Y and if the Bkend value is B, 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
If the Bkend value is T, use one of the following commands depending on the type of data being restored:
sbread -x rmt0 | sbuncomp | tar -xvf ./path_to_directory sbread -x rmt0 | sbuncomp | tar -xvf ./path_to_file
As an example, if we are restoring /usr/lib, we would first rewind the tape, and reposition it to the correct image so the following commands would be run:
sbdevice -r rmt0 sbdevice -f6 rmt0.1
To restore the /usr/lib directory:
sbread -x rmt0 | restbyname -xvqdf- ./lib
To restore only the /usr/lib/libc.a file:
sbread -x rmt0 | restbyname -xvqf- ./lib/libc.a
sync;sync;sync; cd / unmount all
If hd4 and hd2 do not unmount, turn key to normal (if a key exists) and reboot.
exit
sbdevice -r /dev/rmt0
cd /
sbdevice -f3 /dev/rmt0.1
restbyname -xvqf /dev/rmt0.1 ./tmp/...blksz
sbdevice -r /dev/rmt0
cat ./tmp/...blksz
/usr/lib/methods/ucfgAtape -l rmt0
/usr/lib/methods/chggen -l rmt0 -a block_size=X
/usr/lib/methods/cfgAtape -l rmt0
/usr/lib/methods/ucfgdevice -l rmt0
/usr/lib/methods/chggen -l rmt0 -a block_size=X
/usr/lib/methods/cfgsctape -l rmt0
ksh> exit
The purpose of this section is to describe the differences between versions 3 and 4 of Sysback as they relate to this document.
Images on tape
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 and they are present in the following order:
All subsequent images consist of the filesystems and raw logical volumes of each nonrootvg volume group in alphabetical order. The order in which the nonrootvg volume groups appear on the backup depend on the order in which they were backed up.
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: 96394312721128 Publish Date: Oct. 02, 2000 4FAX Ref: 8601 ]