Backup to a remote tape device



The scenarios is as follows:

Machine A : We need to take an mksysb image on a tape. The tape should be bootable. The machine does not have access to a tape drive.

Machine B: Does have access to a tape drive and is connected to machine A via LAN.

Procedure:

A bootable tape as a result of mksysb contains 4 records (set of data).

BOS Boot Image - contains a copy of the system's kernel and device drivers needed to
boot from the tape.
mkinsttape Image
./image.data - holds the information needed to recreate the root volume group and its
logical volumes and file systems.
./bosinst.data - contains the customizable install procedures and dictates how the BOS
install program will behave. This file allows for the non-interactive installs.
Dummy "Table of Content" used to make mksysb tapes have the same number of files as BOS install
tapes.

Steps: (our working directory on both servers will be /opt)

Machine A:

Create a bootable image on machine A:
Code:
bosboot -ad /dev/rmt0 -b /opt/1_bosboot.img
copy /var/adm/ras/bosinst.data to /bosinst.data
Mkinsttape image:
Code:
mkinsttape /opt/2_mkinsttape.img

mkszfile

mksysb image:
Code:
mksysb -e -i -p /opt/4_mksysb.img #### with -e is for exluding files, it is optional only

Notice that the files are named in the order they will be written on the tape.
Copy the three resulting files: 1_bosboot.img, 2_mkinsttape.img, and 4_mksysb.img to machine B via FTP or SCP or whatever method.
Machine B:

Prepare the tape
Code:
chdev -l rmt0 -a extfm=yes

Rewind it
Code:
tctl -f /dev/rmt0 rewind

Change the block size to 512
Code:
chdev -l rmt0 -a block_size=512

Rewind it again
Code:
tctl -f /dev/rmt0 rewind

Write the first file
Code:
dd if=/opt/1_bosboot.img of=/dev/rmt0 bs=512 conv=sync

Rewind the tape
Code:
tctl -f /dev/rmt0 rewind

Position the writer to write after the first file:
Code:
tctl -f /dev/rmt0.1 fsf 1 ## Notice that we used the non-rewindable device rmt0.1 rather than the normal one rmt0

Write the second file:
Code:
dd if=/opt/2_mkinsttape.img of=/dev/rmt0.1 bs=512

Rewind
Code:
tctl -f /dev/rmt0 rewind

Position the writer to write after the second file:
Code:
tctl -f /dev/rmt0.1 fsf 2

Create and save the dummy TOC to tape (required by bootable tapes):
Code:
echo "Dummy tape TOC" | dd of=/dev/rmt0.1 bs=512 conv=sync

Rewind:
Code:
tctl -f /dev/rmt0 rewind

Position the writer to write after the third file:
Code:
tctl -f /dev/rmt0.1 fsf 3

Write the final file:
Code:
dd if=/opt/4_mksysb.img of=/dev/rmt0.1 bs=512

Eject the tape and you're done.

Comments

Popular posts from this blog

Installing and configuring the storage agent (AIX)

Move a file system to another volume group

Xmanger does not work