Saturday, January 29, 2011

Create a mksysb tape manually

In preparation for this procedure, perform the following in a different volume group other than rootvg. I used backupsvg with a filesystem called /backups. Make sure you do the following commands in order so that the proper files like /bosinst.data and /image.data are created.

First we create the necessary boot image, bos install image and mksysb image.
mksysb -i -p /backups/xxxxx.mksysb
bosboot -ad /dev/rmt0 -b /backups/codeman.boot
mkinsttape /backups/xxxxx.2nd

Next we restore the mksysb image in preparation for stacking the files onto the tape.
mkdir /backups/root_dir
cd /backups/root_dir
dd if=../xxxxx.mksysb |restore -x -v -f -

Finally we cut the tape placing the boot image(generated by bosboot -b), bosinst image(generated by mkinsttape), dummy image and the mksysb files on it.
tctl -f /dev/rmt0.1 rewind
dd if=/backups/xxxxx.boot of=/dev/rmt0.1 bs=512
dd if=/backups/xxxxx.2nd of=/dev/rmt0.1 bs=512
echo "Dummy Install Image" |dd of=/dev/rmt0.1 bs=512 conv=sync
cd /backups/root_dir
find . -print |backup -i -q -v -f /dev/rmt0.1
tctl -f /dev/rmt0.1 rewind


mksysb -i <filename>
mkinsttape <Full path to file name>
bosboot -ad /dev/rmt0 -b <Full path to file name>

tctl rewind
dd if=<boot file name> of=/dev/rmt0.1 bs=512
dd if=<mkinsttape file name> of=/dev/rmt0.1 bs=512
echo "Dummy Image" |dd of=/dev/rmt0.1 bs=512 conv=sync



To put the 2nd.image on tape that is created using the mkinsttape command use the following. This has been verified.
dd if=/<pathname>/<filename> of=/dev/rmt0.1 bs=512

# chdev -l rmt0 -a block_size=512
# echo "Dummy Install Image" |dd of=/dev/rmt0 bs=512 conv=sync
# tctl rewind
# tctl -f /dev/rmt0.1 fsf 1
# dd if=/tmp/2nd.image of=/dev/rmt0 bs=512
# tctl rewind
# tctl -f /dev/rmt0.1 fsf 2
# echo "Dummy Install Image" |dd of=/dev/rmt0 bs=512 conv=sync
# tctl rewind
# tctl -f /dev/rmt0.1 fsf 3
# dd if=/backup/mksysb.image of=/dev/rmt0 bs=512



some info:
[root@buxxx] /home/mdismail>
 # mkinsttape /tmp/tempmksysbtape
[root@buxxx] /home/mdismail>
 # ls -l /tmp/tempmksysbtape
-rw-------   1 root     system      6144000 Oct 06 05:57 /tmp/tempmksysbtape
[root@buxxx] /home/mdismail>
 # du -sk /tmp/tempmksysbtape
6000    /tmp/tempmksysbtape
[root@buxxx] /home/mdismail>
 # file /tmp/tempmksysbtape
/tmp/tempmksysbtape: backup/restore format file
[root@buxxx] /home/mdismail>
 #


##############
note sure of these steps

mksysb -i <filename>
mkinsttape <Full path to file name>
bosboot -ad /dev/rmt0 -b <Full path to file name>                 /* file generated by mkinsttape  */

tctl rewind
dd if=<boot file name> of=/dev/rmt0.1 bs=512
dd if=<mkinsttape file name> of=/dev/rmt0.1 bs=512
echo "Dummy Image" |dd of=/dev/rmt0.1 bs=512 conv=sync


#########

  2. To create a bootable image called /tmp/tape.bootimage for a tape device,
     type:

     bosboot -ad /dev/rmt0 -b /tmp/tape.bootimage

[root@buxxx] /home/mdismail>
 # bosboot -ad /dev/rmt0 -b /tmp/tape.bootimage

bosboot: Boot image is 30200 512 byte blocks.

***** ATTENTION *****
The boot image you just created might fail to boot because
the size exceeds the system limit.  For information about
fixes or workarounds, see /usr/lpp/bos.sysmgt/README.
***** ATTENTION *****
[root@buxxx] /home/mdismail>
 #

[root@buxxx] /home/mdismail>
 # ls -l /tmp/tape.bootimage
-rw-------   1 root     system     15462339 Oct 06 06:10 /tmp/tape.bootimage
[root@buxxx] /home/mdismail>
 #

[root@buxxx] /home/mdismail>
 # file /tmp/tape.bootimage
/tmp/tape.bootimage: ELF 32-bit MSB version 1 executable PowerPC
[root@buxxx] /home/mdismail>
 #

2 comments:

  1. Hi

    this procedure seems to be quite interesting. Right now I have a problem - I need to create bootable tapes by mksysb but tapes should be written on different server. Servers to be backed up are on remote location so this is why.

    Do you think that your procedure can be split to two parts (scripts at the end) one to be run on remote (to be backed up) server and the second on local one with tape drive? The data would be stored on SVC disk that could be moved between servers.

    So first question is:
    bosboot -ad /dev/rmt0 -b /backups/codeman.boot
    does it write anything to tape? Even, is it necessary to have tape drive attached to the LPAR when doing this at all?

    Later on you have:
    tctl -f /dev/rmt0.1 rewind
    Does it mean that there is something on the tape yet? And what is purpose of codeman.boot file above?

    You understand, that when writing on the tape in this step is necessary, then I can use the procedure for my purposes...

    I don't go farer with your procedure by now. If you are interesting in this problem, please help me


    Regards

    ReplyDelete
  2. fix:

    You understand, that when writing on the tape in this step is necessary, then I can *not* use the procedure for my purposes...

    ReplyDelete