Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a mksysb tape from mksysb disk image

Status
Not open for further replies.

leandroBC

Technical User
Mar 2, 2004
2
CA
Hello,

I'm trying to create a bootable mksysb tape from the mksysbs image stored on disk.
I'm using the "dd" command but the tape that I'm creating does not "boot" properly.

Does anyone knows how to do it?

Thanks

Leandro

Here is the script with dd command that I'm using:

#
server=edmnim
BLK_SZ=1024
TAPE=rmt0
#
tctl -f /dev/$TAPE rewind
#
#
dd if=/edmnin_nim/mksysb/$server/$server.mksysb of=/dev/$TAPE obs=$BLK_SZ conv=sync
#
tctl -f /dev/$TAPE rewoffl
#

 
The mksysb on a tape several tape images on it, although their exact sequence slips my mind, it goes something like this....

Change tape block size to 512 bytes
Put a boot image on the tape
Reset block size to what it was
Dummy record
Table of contents
Backup of all your files

To emulate this, you could:

chdev -l rmt0 -a block_size=512

mt -f /dev/rmt0 rewind

dd if=/dev/hd5 of=/dev/rmt0.1 bs=512
[or perhaps a 'bosboot -ad /dev/rmt0'] would work.

mkszfile

chdev -l rmt0 -a block_size=1024 (or whatever you wish)

dd if=/image.data of=/dev/rmt0.1

Repeat the same step for the dummy record

dd if=/edmnin_nim/mksysb/$server/$server.mksysb of=/dev/$TAPE obs=$BLK_SZ conv=sync

mt -f /dev/rmt0 rewoffl

No guarantees on this. Look at the mksysb command - it is a script and you can figure out what it is doing and replicate the functionality pretty easily.

BV
 
hi,
try to examine the mksysb command (script) on AIX: it is
done of 4 principal steps:
1) build a boot image
2) put on tape a little /usr dir to use commands
3) store on tape a lttle archive
4) backup rootvg files .

Each steps writes an archive on tape using dd or backup or tar (in earlier AIX Versions) but using /dev/rmt0.1 device access. This says to tape to don't rewind it after write operation is performed.

When you do a mksysb and indicate a disk path, the command
alerts you "media does not appear is a bootable device"
or similar: this, more or less, means that you put on disk only the 4th step of a normal mksysb on tape.

Before put the mksysb image on disk, you should do on tape the same first 3 operations that mksysb does.

A valid exercise is, when a tape-mksysb is done, make 4 sequential restore -Tvf /dev/rmt0.1 or 3 tctl forward /dev/rmt0.1 .

bye
 
Hello folks,

first of all thank for all the answers...here is the complete procedure that I end up with...



# cd /
# mkszfile
# vi'd the bosinst.data file and and made sure PROMPT = yes
# echo 512 NONE >/tapeblksz
# mkinsttape /tmp/2nd.image
This will place all the system files required on the 2nd image of the mksysb tape to a file.
.
Next we transfered the /tmp/2nd.image file to the control workstation and placed it into /tmp, then on the control workstation we ran the following:
.
# 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
.

Leandro
 
hi,
without rewind and reset the tape each time, you can

...
# echo "Dummy Install Image" |dd of=/dev/rmt0.1 bs=512 conv=sync
# dd if=/tmp/2nd.image of=/dev/rmt0.1 bs=512
# echo "Dummy Install Image" |dd of=/dev/rmt0.1 bs=512 conv=sync
# dd if=/backup/mksysb.image of=/dev/rmt0 bs=512


Note: the last access to tape is rmt0 and not rmt0.1


bye
 
Hi all.
How do you create the mksysb image to a disk intead to tape?
I am interested in test this procedure, since i have machines whitout tape drive, and want to make a mksysb to an other disk as backup to but from in case of disaster.
Thanks in advance.

Mglez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top