Re. AIX support for remote tape units Re: AIX support for remote tape units

Re. AIX support for remote tape units Re: AIX support for remote tape units

Post by Frank Kraem » Fri, 04 Dec 1992 17:22:24



>In article <jfy.723085...@depot.cis.ksu.edu.cis.ksu.edu> j...@cis.ksu.edu (Josep
h F. Young) writes:
>>Our department is about to get an RS6000 for database research and I
>>have the dubious task of integrating it with our existing network of a
>>Solbourne, Sun SPARCs and Sun3 workstations, running SunOS 4.1.x or
>>equivalent.

>>At least initially, the RS6000 will not have a local tape drive,
>>meaning that we will need to do backups over the ethernet to one of
>>the tape drives connected to our Solbourne 5/603 server, usually an
>>EXABYTE 8500.

>>How well does AIX support:

>>(1) backups over an ethernet to a non-AIX machine's tape drive, ie.
>>dump, mksysb, etc.?
>mksysb will not back up to remote tapes.

I've 3 got machines to admin - just one of them has an internal 8mm drive.
Because I'm too lazy to look for an external tape in our office I'm running
weekly backups (user data) and monthly system backups (mksysb) over TCP/IP
and ethernet. It works just fine. For me and my 'customers' I wrote a
small script called usave.sh. Adapt it to your needs and remote backup and
restore will work, just fine.

frank ;-)

=-=-=-=-=-= cut here =-=-=-=-=-=-=-=
#!/bin/ksh
# @(#) Create a backup tape of the private user data.
#=================================================================#
#   Script :  usave.sh                                            #
#   Author :  F. Kraemer                                          #
#   Date   :  92/02/19                                            #
#   Update :  92/10/29                                            #
#   Info   :  the ultimative backup script                        #
#   Example:  usave.sh /dev/rmt0      -  save to local tape       #
#             usave.sh /save/save.me  -  save to loacal file      #
#             usave.sh /tmp/pipe      -  save to remote tape      #
#-----------------------------------------------------------------#
PS4="(+) "
#set -x
PROG=$(basename $0)
HOST=$(hostname)
TODAY=$(date +%H:%M:%S)
#-----------------------------------------------------------------#
# cleanup                                                         #
#-----------------------------------------------------------------#
cleanup ()
{
ec=$1
error=$2
case "$ec"
in
   "$USAGE_EC")    # usage error
     error="Usage:\t$PROG DeviceName\n" 1>&2
    ;;
   "$NOTAP_EC")    # Tape error
     error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
    ;;
   "$LISTE_EC")    # list error
     error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
    ;;
   "$NOTAR_EC")    # tar command error
     error="error:\t$PROG: tar command failed.\n" 1>&2
    ;;
   "$PIPEP_EC")    # pipe error
     error="error:\t$PROG: mknod command failed.\n" 1>&2
    ;;
   "$NORSH_EC")    # rsh error
     error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
    ;;
   "$RHOST_EC")    # remote host error
     error="error:\t$PROG: Remote Host unknown.\n" 1>&2
    ;;
   *)
   ;;
esac
case "$DEVICE"
in
    #
    # Fix the block size if $DEVICE is a tape device
    #
    /dev/rmt[0-9]*)
        echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
        tctl -f $DEVICE rewind 2>/dev/null
        ;;
    *) ;;
esac
rm -f ${LIST} ${PIPE} 2>/dev/null
[ -n "$error" ] && echo "\n${error}\n"
trap '' 0 1 2 15
exit "$ec"

}

#-----------------------------------------------------------------#
# Variables.                                                      #
#-----------------------------------------------------------------#
USAGE_EC=1                         # exit code for usage error
NOMNT_EC=2                         # exit code wrong device name
NOTAP_EC=3                         # exit code no tape available
LISTE_EC=4                         # exit code backup list error
NOTAR_EC=5                         # exit code for wrong tar
TRAPP_EC=6                         # exit code for trap
PIPEP_EC=7                         # exit code for pipe
RHOST_EC=8                         # exit code for bad ping
NORSH_EC=9                         # exit code for bad rsh
DEVICE="$1"                        # device to tar into
LIST="/tmp/.tar.$LOGNAME.$$"       #
REMOTEH=""                         # Remote host for backup
REMOTET=""                         # Remote tape for backup
tapedev=                           #
PIPE="/tmp/pipe"                   # Pipe for remote backup
#-----------------------------------------------------------------#
# main()                                                          #
#-----------------------------------------------------------------#
tput clear
echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
rm -f $LIST 2>/dev/null
#-----------------------------------------------------------------#
# Trap on exit/interrupt/break to clean up                        #
#-----------------------------------------------------------------#
trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
#-----------------------------------------------------------------#
# Check command options                                           #
#-----------------------------------------------------------------#
[ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
#-----------------------------------------------------------------#
# Check device name                                               #
#-----------------------------------------------------------------#
[ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
        "$PROG: Backup device or file name must start with a '/'."
#-----------------------------------------------------------------#
# Check tape device.                                              #
#-----------------------------------------------------------------#
case "$DEVICE"
in
    #
    # Fix the block size if $DEVICE is a tape device
    #
    /dev/rmt[0-9]*)
        #
        echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
        #
        # see if a low or high density tape device was specified
        # (eg rmt0.1)
        density="`expr $DEVICE : \
                "/dev/rmt[0-9]*\.\([0-9]*\)"`"
        #
        # strip /dev/ from device name and
        # get the base name (eg translate:
        # /dev/rmt0.2 to rmt0)
        #
        tapedev="`expr $DEVICE : \
                "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
        #
        # Check if the tape is defined in the system.
        lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
        rc=$?
        [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
        #
        # Restore old tape name.
        #
        [ "${density:-1}" -lt 4 ] && density=1 || density=5
        DEVICE="/dev/${tapedev}.${density}"
        echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
        read TEMP
        echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
        tctl -f $DEVICE rewind 2>/dev/null
        ;;
    #
    # Backup is done on remote host. The remote shell facility
    # must be set up and running.
    #
    ${PIPE}*)
        #
        echo "\n\t$PROG: Assuming remote backup via network.\n"
        echo "\t$PROG: Enter name of Remote Host   ===> \c"
        read REMOTEH
        echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
        ping ${REMOTEH} 1 1 >/dev/null 2>&1
        rc=$?                                    # give up unknown host
        [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
        JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
        rc=$?                                    # give up rsh failed
        [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
        echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
        echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
        read REMOTET
        echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}......(press ent
er)"
        read TEMP
        echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
        rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
        rc=$?                                    # give up rsh failed
        [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
        rm -f ${PIPE} 2>/dev/null
        mknod ${PIPE} p
        rc=$?                                    # give up mknod failed
        [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
        cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
        ;;
    *)  ;;
esac
#-----------------------------------------------------------------#
# Prepare the list.                                               #
#-----------------------------------------------------------------#
echo "\n\t$PROG: Create list of files to be saved...."
find $HOME -print > $LIST
rc=$?
[ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
#-----------------------------------------------------------------#
# tar the files.                                                  #
#-----------------------------------------------------------------#
echo "\n\t$PROG: Changing current directory to (/)...."
cd / > /dev/null 2>&1
echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
tar -cvf "$DEVICE" -L "$LIST"
rc="$?"
[ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
#-----------------------------------------------------------------#
# Backup completed                                                #
#-----------------------------------------------------------------#
TODAY=$(date +%H:%M:%S)
echo "\n\t$PROG ended at $TODAY............................\n\n"
cleanup 0
#-----------------------------------------------------------------#
# EOF                                                             #
#-----------------------------------------------------------------#
=-=-=-=-=-= cut here =-=-=-=-=-=-=-=

.----------------------------------------------------------------------.
| E-Mail: FRANVM3(KRAEMERF)                 - IBM VNET  "Yes, I'm one  |
| ======  IBMMAIL(DEIBM27S)                 - IBM-Mail   of those      |
|         DE.IBMX400.IBMMAIL.KRAEMER.KRAEME - X.400      stupid IBM    |
|         kraem...@franvm3.vnet.ibm.com     - Internet   field SE's."  |
| Voice : +49-(0)611/776-364                                           |
| Mail  : Abraham-Lincoln Street 26, 6200 Wiesbaden, Germany           |
'----------------------------------------------------------------------'

 
 
 

1. AIX support for remote tape units

Our department is about to get an RS6000 for database research and I
have the dubious task of integrating it with our existing network of a
Solbourne, Sun SPARCs and Sun3 workstations, running SunOS 4.1.x or
equivalent.

At least initially, the RS6000 will not have a local tape drive,
meaning that we will need to do backups over the ethernet to one of
the tape drives connected to our Solbourne 5/603 server, usually an
EXABYTE 8500.

How well does AIX support:

(1) backups over an ethernet to a non-AIX machine's tape drive, ie.
dump, mksysb, etc.?

(2) OS install from a non-AIX machine?  Is it even possible?

(3) disaster recovery, using backups on remote tape drives?

(4) Are there any idiosyncracies with AIX tape handling (local tape)
which can produce tapes that cannot be read on other machines or read
tapes that were written by other machines?

Thanks for any advice you can give me.
--
Joseph Young, Systems Programmer
KSU Department of Computing and Information Sciences
Manhattan, Kansas 66506  FAX: (913) 532-7353  Phone: (913) 532-6350  

2. Cobalt RAQ4 and Apache 1.3.12 - Cache issues

3. Suncoast LUG Meetings

4. Exabyte 8mm tapes on other x86 supported tape units???

5. Using DOS partition

6. remote tape unit

7. Problem with AKCL Lisp/C interface on IBM RS6000

8. How can I use a remote tape unit

9. Remote Tape Units

10. AIX/PS2 Internal Tape Backup Unit

11. accessing remote tape dive in AIX

12. ufsdump to remote AIX tape bombing. Help!