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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to read from the tape on different server

Status
Not open for further replies.

naveenrt

Technical User
Mar 23, 2001
53
0
0
US
Hello
I have got 2 AIX Server one has a 12 GB( Server1) Tape drive and the other 20 GB( Server2) the details are as below

I have used the tar command to write in to the tape on Server 1

I am unable to read/extract the contents of tape drive from Server 2 . It keeps on reading the tape

I have tried by giving the BLOCK SIZE as variable length still no luck

I tried the dd if=/dev/rmt0 of=/tmp/testtape bs=1024 . This command works and it puts the file in to testtape file

I am unable toundersatnd as to why the above works and tar does not

Any Idea as to how to extract the contents or is there any additional configuration i need to do

Please help

Server 1 (12 GB)
========

Manufacturer :ARCHIVE

The output of the mt -f rmt0 status command

rmt0 Available 10-60-00-5,0 SCSI 4mm Tape Drive
attribute value description user_settable

mode yes Use DEVICE BUFFERS during writes True
block_size 1024 BLOCK size (0=variable length) True
extfm yes Use EXTENDED file marks True
ret no RETENSION on tape change or reset True
density_set_1 37 DENSITY setting #1 True
density_set_2 36 DENSITY setting #2 True
compress yes Use data COMPRESSION True
size_in_mb 12000 Size in Megabytes False
ret_error no RETURN error on tape change or reset True
Server 2 ( 20GB)
=========

Manufacturer :HP
mt -f rmt0 status
rmt0 Available 11-08-00-0,0 SCSI 4mm Tape Drive
attribute value description user_settable

mode yes Use DEVICE BUFFERS during writes True
block_size 1024 BLOCK size (0=variable length) True
extfm no Use EXTENDED file marks True
ret no RETENSION on tape change or reset True
density_set_1 38 DENSITY setting #1 True
density_set_2 37 DENSITY setting #2 True
compress yes Use data COMPRESSION True
size_in_mb 20480 Size in Megabytes False
ret_error no RETURN error on tape change or reset True
#

There is no difference between both the configuration of the Tape drive as can be seen above

Thanks and Regards
Naveen


 
Can you do a "tcopy" on the tape on the second machine?

I'm not quite sure if this makes a difference (I don't imagine it would), but your "density" settings are different for each drive.

Finally, can we see an "lscfg -vl rmt0" for the drives?
 
Do they both use AME (Advanced Metal Evaporated) tapes? Old MP (Metal Particle) tapes can be read in newer AME drives but not written to, and I don't think AME tapes can be read by MP drives. IBM Certified -- AIX 4.3 Obfuscation
 
Yegloev has it right. If the 12GB tape drive isn't able to read AME tapes it won't work.

We just went through something similar at my office. We have two RS/6000's with 20GB 8mm drivers in each. They're AME drives. Problem is we sync data with a federal agency and they don't have the ability to read AME tapes. To make matters worse, we can't create anything but AME tapes.

I ended up just creatign .tar files out of the files I wanted, ftp'ing them onto my Windows machine and burning them to a CD.

What a pain that whole process was.
 
Hello
I am using 12/24 GB DDS3 Tape . I am taking the tar backup from 12 GB (Archive Make) Tape drive on to 12/24 dds3 tape

I take this tar backed up files and try to restore it in 20GB tape drive (HP Make) .

When i try to to restore i am unable to do the same

As requested by Chapter11 here is the lscfg output

12 GB Tape Drive ( Server1)
===========================
$ lscfg -vl rmt0
DEVICE LOCATION DESCRIPTION

rmt0 10-60-00-5,0 SCSI 4mm Tape Drive (12000 MB)

Manufacturer................ARCHIVE
Machine Type and Model......IBM-STD224000N!D
Device Specific.(Z1)........726B
Serial Number...............GS0BR3V
Device Specific.(LI)........00000101
Part Number.................59H3878
FRU Number..................59H3879
EC Level....................E30364
Device Specific.(Z0)........0180020283000018
Device Specific.(Z3)........L1

20 GB Tape Drive ( Server2)
lscfg -vl rmt0
DEVICE LOCATION DESCRIPTION

rmt0 11-08-00-0,0 SCSI 4mm Tape Drive (20480 MB)

Manufacturer................HP
Machine Type and Model......IBM-C568303030!D
Device Specific.(Z1)........C105
Serial Number...............31206362
Device Specific.(LI)........A1700292
Part Number.................19P0798
FRU Number..................19P0802
EC Level....................H27417
Device Specific.(Z0)........0180020283000038
Device Specific.(Z3)........L1


Hope this info helps more in solving

Thanks and Regards
Naveen

 
The only thing I can think of at the moment is that maybe the heads are *just* enough different in alignment to cause problems. It's happened to us before.

Apart from that, the MP/AME problem might be causing you a headache, although I don't believe that's the problem. I don't have a 4mm20G so I don't know off the top of my head if they're AME drives. It *should* still be able to read the MP-type tape, although you will have to clean the 20g drive every time you use an older tape.

Do this: Create an archive on the 20g drive, and verify that *that* drive is functioning properly.

 
I have a feeling that Chapter11 was right on when he said head alignment. It's a problem even when using the same manufacturer's drives. IBM Certified -- AIX 4.3 Obfuscation
 
Set the default block size to 0 and try again, If that doesn't work, why not try a remote tape backup

tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"

or

#!/bin/ksh
#######################################################################
# rmksysb #
#######################################################################
# #
# Description: #
# creates a bootable mksysb backup of a remote system running #
# AIX 3.x or lists the Table of Contents of the current tape #
# #
# Usage: #
# ./rmksysb $1 [$2] #
# $1 - remote host to be backed up #
# $2 - optional: local tape device (default: rmt0) #
# or: #
# ./rmksysb -l [$2] #
# to list Table of Contents saveset on tape in $2 #
# (only useful on tapes created by rmksysb) #
# #
# Output: #
# a bootable mksysb of the remote system #
# or a listing of the TOC saveset on the current tape #
# #
# Remarks: #
# . rmksysb can only be used by root #
# . this script will use tapedevice .1, so if #
# a >2.3GB drive is used: check density_set_1 #
# . the remote host needs /.rhosts to include the local host #
# for root access (+ shell enabled in /etc/inetd.conf) #
# . you will need some room (>1.5MB) on /tmp on the remote host #
# for standard mksysb .archive.list.* etc. #
# . remote standard output & standard error (except dd/chdev) #
# will go to local stdout & stderr #
# . redirecting stdout can create quite large log-files (2MB) #
# . AIX versions should not be too far apart as the boot-saveset#
# comes from the local system & the rest from the remote #
# (tested on AIX 3.2.5, AIX 4+ definitely won't work!!!) #
# . most likely this script will fail with multi-tape mksysb's: #
# another incentive to keep rootvg as small as possible! #
# #
# Author: #
# Henk van Doorn #
# Email: hvdoorn@xs4all.nl #
# #
# Thanks to all who contributed. Esp. Paul Wynn (AIXpert '93), #
# my colleagues Dominic Dinardo & Douwe van Terwisga #
# + the input from Usenet were stimulating; thanks folks! #
# I would welcome any additions & changes for the better... #
# #
#######################################################################
# CHANGES #
#######################################################################
# #
# ID WHO DATE DESCR #
# -- --- ------- --------------------------------------------- #
# X000 HvD 6Jan95 Created this file. #
# X001 HvD 2Feb95 Final version #
#######################################################################

set +u

# Global variable definitions.
UMASK=`umask`
BLK_SZ=1024
BOOT_BLK_SZ=512
HOST=${1}

# TAPE = $2 with /dev/ & .* removed, defaulting to rmt0
TAPE=${2:-rmt0}
TAPE=${TAPE#/dev/}
TAPE=${TAPE%.*}

usage()
{
echo &quot;Usage: ./rmksysb <remote_host_name> [<tape_device>] or&quot; >&2
echo &quot; ./rmksysb -l [<tape_device>]&quot; >&2
echo &quot; with <tape_device>= e.g. rmt1&quot; >&2
echo &quot;Default <tape_device>=rmt0&quot; >&2
return
}

check_parms()
{
if [ &quot;${HOST}&quot; = &quot;&quot; ]
then
usage
exit 1
fi

if [ &quot;${HOST}&quot; = &quot;-l&quot; ]
then
# show TOC block which contains some backup details on rmksysb tapes
get_tape_block_size
chdev -l ${TAPE} -a block_size=${BOOT_BLK_SZ} >/dev/null 2>&1
mt -f /dev/${TAPE} rewind
mt -f /dev/${TAPE}.1 fsf 2
dd if=/dev/${TAPE} count=1 2>/dev/null
chdev -l ${TAPE} -a block_size=${OLD_BLK_SZ} >/dev/null 2>&1
exit
fi
}

check_host()
{
rsh ${HOST} hostname >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo &quot;Check hostname & rsh access&quot; >&2
exit 1
fi
}

get_tape_block_size()
{
VALID=
`lsdev -Cc tape | cut -f1 -d&quot; &quot; | grep ${TAPE} 2>&1 >/dev/null` &&
{
OLD_BLK_SZ=`lsattr -El ${TAPE} -a block_size | cut -f2 -d&quot; &quot;`
VALID=true
}

if [ &quot;$VALID&quot; = &quot;&quot; ]
then
echo &quot;Tape drive $TAPE is not a valid local drive!&quot; >&2
exit 1
fi
}

#
# The main procedure is analogous to its C counterpart,
# This is the basic driver routine.
#
main()
{

if [ &quot;`id | grep 'uid=0'`&quot; = &quot;&quot; ]
then
echo &quot;rmksysb can only be run as root!&quot; >&2
exit 2
fi
umask 022

check_parms
check_host
get_tape_block_size

# display some info on this rmksysb session
echo &quot;`date`\n\nRemote System Backup from remote ${HOST} to local `hostname` on device:\n`lscfg -v -l ${TAPE} | sed -n '3,6p' | grep &quot;[a-z]&quot; `\n&quot;

# Here the action starts
rsh $HOST -n /usr/bin/mkszfile
rsh $HOST -n &quot;echo ${BLK_SZ} > /tapeblksz&quot;

rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb&quot;
rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb.out&quot;
rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb.err&quot;

rsh $HOST -n &quot;/etc/mknod /tmp/pipe.rmksysb p&quot;
rsh $HOST -n &quot;/etc/mknod /tmp/pipe.rmksysb.out p&quot;
rsh $HOST -n &quot;/etc/mknod /tmp/pipe.rmksysb.err p&quot;

# create remote startup file for mkinsttape
rsh $HOST -n &quot;echo '#!/bin/ksh\nexport PATH=$PATH ; /usr/sbin/mkinsttape /tmp/pipe.rmksysb >/tmp/pipe.rmksysb.out 2>/tmp/pipe.rmksysb.err &' > /tmp/mkinsttape.start &quot;
rsh $HOST -n &quot;chmod 700 /tmp/mkinsttape.start&quot;

chdev -l $TAPE -a block_size=${BOOT_BLK_SZ} >/dev/null 2>&1
tctl -f /dev/${TAPE} retension

echo
echo
echo &quot;>>> SAVESET 1: BOS boot image from `hostname`&quot;
echo
bosboot -d /dev/${TAPE}.1 -a

echo
echo
echo &quot;>>> SAVESET 2: BOS install utilities from ${HOST} (backup format)&quot;
echo
rsh $HOST -n &quot;nohup /tmp/mkinsttape.start&quot; &

# get remote standard out & err to local stdout & err
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb.out 2>/dev/null&quot; | dd 2>/dev/null &
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb.err 2>/dev/null&quot; | ( dd 2>/dev/null ) >&2 &

# get remote mkinsttape to local tape device
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb 2>/dev/null&quot; | dd 2>/dev/null | dd of=/dev/${TAPE}.1 conv=sync 2>/dev/null

echo
echo
echo &quot;>>> SAVESET 3: Backup information (list with ./rmksysb -l [<tapedevice>])&quot;
echo
# add dummy TOC to tape with some backup information
echo &quot;`date`\n\nRemote System Backup from remote ${HOST} to local `hostname` on device:\n`lscfg -v -l ${TAPE} | sed -n '3,6p' | grep &quot;[a-z]&quot; `\n&quot; | dd of=/dev/${TAPE}.1 conv=sync 2>/dev/null

# change blocksize to 1024 for better performance
chdev -l ${TAPE} -a block_size=${BLK_SZ} >/dev/null 2>&1

# rewind & skip first 3 savesets
mt -f /dev/${TAPE} rewind
mt -f /dev/${TAPE}.1 fsf 3

echo
echo
echo &quot;>>> SAVESET 4: mksysb (rootvg backup) from ${HOST} (tar format)&quot;
echo
# start the actual remote mksysb
echo &quot;The contents of the /.fs.size file on ${HOST} are:&quot;
rsh $HOST -n &quot;cat /.fs.size&quot;
echo

rsh $HOST -n &quot;nohup /usr/bin/mksysb /tmp/pipe.rmksysb >/tmp/pipe.rmksysb.out 2>/tmp/pipe.rmksysb.err &&quot; &

# get remote standard out & err to local stdout
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb.out 2>/dev/null&quot; | dd 2>/dev/null &
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb.err 2>/dev/null&quot; | ( dd 2>/dev/null ) >&2 &

# get remote mksysb to local tape device
rsh $HOST -n &quot;dd if=/tmp/pipe.rmksysb 2>/dev/null&quot; | dd obs=${BLK_SZ} 2>/dev/null | dd of=/dev/${TAPE} bs=${BLK_SZ} conv=sync 2>/dev/null

# cleaning up
rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb&quot;
rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb.out&quot;
rsh $HOST -n &quot;rm -f /tmp/pipe.rmksysb.err&quot;
rsh $HOST -n &quot;rm -f /tmp/mkinsttape.start&quot;

chdev -l ${TAPE} -a block_size=${OLD_BLK_SZ} >/dev/null 2>&1
umask $UMASK

# display some closing info on this rmksysb session
echo &quot;Remote System Backup from remote ${HOST} to local `hostname` is finished.\n`date`\n&quot;

} #end of main

# Call the driver
main

This was pinched from the AIX FAQ

Regards --
| Mike Nixon
| Unix Admin
| ----------------------------
 
Hello
I got the solution . Here it is

12 Gb Tape drive is DDS/3
20 GB Tape drive is DDS/4

So The density setting for both are different . Take notice of this

Setting on 12 GB Tape ( See command above for this listing)
density_set_1 37 DENSITY setting #1 True
density_set_2 36 DENSITY setting #2 True

Setting on 20 GB Tape ( See command above for this listing)
density_set_1 38 DENSITY setting #1 True
density_set_2 37 DENSITY setting #2 True


On the 20GB Tape drive( Server2) change( Using Smitty Tapes) the setting of density_set_1 to 37 ( This is the Density with which the Tape was written on 12 GB Tape)
and also make the block size zero

block_size 0 BLOCK size (0=variable length) True

Now the data on the Tape will be restored

Thanks everyone for their time in solving thisimg ]

Thanks and Regards
Naveen
 
Aha, but you might not want to change the density 1 setting on your 20G drive - you'll lose the ability to write 20G tapes.

Instead, load the 12G tape in the drive, and refer to the drive as /dev/rmtX.[4567] to use the drive with the second density setting.

See the manpage for &quot;rmt&quot; for a further breakdown of the post-period number meanings.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top