Re: NIM: Initiate mksysb create from client???
From: Stephane GASSIES (sgassies_at_club-internet.fr)
Date: 05/03/04
- Previous message: h maru: "AIX Kerberos Connection to AD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 03 May 2004 16:26:30 GMT
Here is a tool you can use to re-create a boottable tape from a mksysb file.
1) have the "mksysb-generated" file on one server of the same
hardware & sofware as the one to restore (same server is better).
# Start of script (call it as you want e.g. mk_sysb_tape)
#!/usr/bin/ksh
if [[ "H$1" = H-x ]] then
extract=1
shift
else
extract=0
fi
if [[ "H$1" = H+e ]] then
eject=0
shift
else
eject=1
fi
TAPE=${2:-rmt0}
if [[ ! -f $1 || ! -r $1 || ! -w /dev/$TAPE.1 ]] then
echo "Usage: $0 [-x] [+e] mksysb_file [tape drive]"
exit 1
fi
Rc=0
# If asked, get /image.data and /bosinst.data
if (( $extract == 1 )) then
cd /
restore -xqvf $1 ./image.data || Rc=1
(( Rc == 0 )) && { restore -xqvf $1 ./bosinst.data || Rc=2; }
cd $OLDPWD
fi
# boot waiting a block_size of 512, we set it to 512 if not the case
Bl=$(lsattr -EL $TAPE -a block_size -F value)
if (( $Bl != 512 )) then
Bl_change=1
chdev -l $TAPE -a block_size=512
else
Bl_change=0
fi
# Here we go
(( Rc == 0 )) && { bosboot -a -d /dev/$TAPE.1 || Rc=3; }
(( Rc == 0 )) && { mkinstape /dev/$TAPE.1 || Rc=4; }
(( Rc == 0 )) && {
echo "Dummy tape TOC" | dd of=/dev/rmt0.1 bs=512 conv=sync || Rc=5; }
(( Rc == 0 )) && { dd if=$1 of=/dev/$TAPE bs=1024 conv=sync || Rc=6; }
(( Rc == 0 && eject == 1 )) && mt -f /dev/rmt0 rewoffl
# Restore original block_size if changed
(( Bl_change == 1 )) && chdev -l $TAPE -a block_size=$Bl
exit $Rc
# End of script
Examples of use
mk_sysb_tape /mksysb_backup_dir/mksysb_backup_file rmt1
mk_sysb_tape -x /mksysb_backup_dir/mksysb_backup_file
OBS: Thanks to a IBM guy (whom I forgot the name) for writing the
original scriptt.
Hope this will help.
Regards,
Stephane
-- Ce message a ete poste via la plateforme Web club-Internet.fr This message has been posted by the Web platform club-Internet.fr http://forums.club-internet.fr/
- Previous message: h maru: "AIX Kerberos Connection to AD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|