How to create a recovery tape from a net recovery archive
Abstract
This document explains how to create a self-contained recovery tape using a network recovery archive already stored on an Ignite-UX server for a HP-9000 PA-RISC system. See the make_net_recovery(4) manpage for more details on how to create this kind of archive. It is important that the archive fit onto a single tape. For the example, we are using the archive created at "2001-03-12,09:00" for the sys1 host.
Build LIF
1. Build the LIF file. The LIF file will contain the Ignite-UX tools and environment, the config files produced for the recovery archive, and the scripts used during recovery.
1.1. Use make_medialif to build the LIF file.
# cd /var/opt/ignite/clients/sys1/recovery/2001-03-12,09:00 # make_medialif -f system_cfg -f control_cfg -f archive_cfg \ -C "2001-03-12,09:00 sys1 recovery image" \ -l /var/tmp/my_lif -a -r os_rev
1.2. Modify the LIF file for use on the tape.
# instl_adm -d -F /var/tmp/my_lif > /var/tmp/cfg
1.3. Add these lines to the end of the /var/tmp/cfg file.
control_from_server=FALSE run_ui=TRUE
1.4. Update the LIF file with the new configuration.
# instl_adm -F /var/tmp/my_lif -f /var/tmp/cfg
Create Tape
2. Create the tape. To write the LIF and archive to a tape.
2.1. Determine which tape device file you can use to write the tape. The device file must match the tape drive type you will use when actually recovering the system. Also, the tape device file must be the no-rewind type. For the rest of this example, assume that /dev/rmt/c1t0d0DDS1n is a no-rewind DDS-1/no compression device file.
2.2. Rewind the tape, write out the LIF and archive, and rewind again.
# mt -t /dev/rmt/c1t0d0DDS1n rew # dd if=/var/tmp/my_lif of=/dev/rmt/c1t0d0DDS1n obs=2k # dd if="/var/opt/ignite/recovery/archives/sys1/2001-03-12,09:00" of=/dev/rmt/c1t0d0DDS1n obs=10k # mt -t /dev/rmt/c1t0d0DDS1n rew
In this example, the archive is retrieved from the standard location on the Ignite-UX server for this host. If you have chosen to put the archive elsewhere, refer to that location instead.
Sample script
#!/bin/sh # Script for creating self-contained bootable Ingnite/UX recovery tape from a pre-existing # make_net_recovery archive. Useful for creating off-site OS backups. # usage: make_tape_from_server hostname set -x # error checking and alert function alert () { STATUS=$? set -x if [[ ! $STATUS = 0 ]] then print " $0 failed: Return code: $STATUS " exit 99 fi } HOST=$1 TAPE=/dev/rmt/0n PRTFILE=/tmp/maketape.tmp PRINTER=<printer> cd /var/opt/ignite/clients/${1}/recovery latest=`/usr/bin/ls -lad latest |awk '{print $NF}'` # Build the LIF file /usr/bin/rm -f /var/tmp/my_lif /var/tmp/cfg cd /var/opt/ignite/clients/${1}/recovery/${latest} /opt/ignite/bin/make_medialif \ -f system_cfg -f control_cfg -f archive_cfg \ -C "${latest} $1 recovery image" \ -l /var/tmp/my_lif -a -r B.11.11 ; alert # Modify LIF for use on tape. /opt/ignite/bin/instl_adm -d -F /var/tmp/my_lif >/var/tmp/cfg ; alert # Edit cfg file for ignite. print "#" >>/var/tmp/cfg print "# added by $0" >>/var/tmp/cfg print "control_from_server=FALSE" >>/var/tmp/cfg print "run_ui=TRUE" >>/var/tmp/cfg /opt/ignite/bin/instl_adm -F /var/tmp/my_lif -f /var/tmp/cfg ; alert # Write the tape /usr/bin/mt -t $TAPE rew ; alert sleep 30 /usr/bin/dd if=/var/tmp/my_lif of=$TAPE obs=2k ; alert sleep 30 /usr/bin/dd if=/var/opt/ignite/recovery/archives/${1}/${latest} of=$TAPE obs=10k ; alert sleep 30 # Rewind and eject tape /usr/bin/mt -t $TAPE rew ; alert sleep 10 /usr/bin/mt -t $TAPE offline ; alert