From - Tue Nov 12 16:41:31 1996 Path: news.unizar.es!news.rediris.es!news.belnet.be!swsbe6.switch.ch!swidir.switch.ch!01-newsfeed.univie.ac.at!voskovec.radio.cz!btnet-feed2!btnet!dispatch.news.demon.net!demon!news.sprintlink.net!news-dc-5.sprintlink.net!www.nntp.primenet.com!nntp.primenet.com!feed1.news.erols.com!howland.erols.net!newsfeed.internetmci.com!news.msfc.nasa.gov!centauri.hq.nasa.gov!newsfeed.gsfc.nasa.gov!daacdev1!fish From: fish@daacdev1.stx.com ("John R. Vanderpool") Newsgroups: comp.sys.sgi.admin Subject: Re: trying to read a tape ... about to give up... Date: 7 Nov 1996 16:54:10 GMT Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Lines: 102 Message-ID: <55t47i$504@post.gsfc.nasa.gov> References: <55o31s$gjk@r02n01.cac.psu.edu> NNTP-Posting-Host: daacdev1.stx.com X-Newsreader: NN version 6.5.0 #2 (NOV) bauer@eetsg08.bd.psu.edu (Kenneth J. Bauer) writes: >We do work for local companies, and they will bring a tape of their >files in for us to load onto our SGI machines. Then we will look at >their files and do whatever to them. Well, usually an engineer will >bring the tapes to us, and usually, they don't know how they were put >onto the tape (tar, bru, .... option from their S/W program, etc.). >They hand the tape to me, and say here, get this up for us. >Well, that is the case here. I can't seem to read this tape. It came from >a Sun machine (I think), and I have tried everything I can think of. >e.g. tar -tvb 20; tar -tvb 16; tar -tvb 8 ; tar -tvf /dev/nrtape .... > bru -tvb 20; bru -tvf /dev/nrtape ..... > dd if=/dev/rmt/tps0d7nrnsv bs=16b conv=swab | tar vtf - > dd if=/dev/rmt/tps0d7nrnsv bs=816b conv=swab | tar vtf - maybe its not in tar or bru format - it might just be a straight file dump. check out my mtutils package at ftp://daac.gsfc.nasa.gov/pub/system/mtutils.tar.Z see if mtfile can guess the format (just uses standard file "magic"): i probably should add a "swab" check to this script, but i rarely use it, only wrote it cuz it seemed handy and was fun.... #!/bin/ksh # # mtbs - return blocksize of next block on magtape # mtfile - run unix file "magic" on magtape # # 10-jul-1995 jrv initial release (fish) # # note: no support for rmt w/ this utility (due to dd and mt blksize) # if [ "${1:-}" = "-i" ]; then shift; fi tpdev="${1:-${TAPE:-/dev/nrtape}}" self=`basename $0` tmpdir="${TMPDIR:-/tmp}" tmpfile=$tmpdir/mtutils.$$ if [ ! -c $tpdev -a ! -b $tpdev ]; then # not a device file echo $tpdev is not a device file exit 1 fi if [ `uname` = IRIX ]; then # use irix blksize feature mt -t $tpdev blksize 1>/dev/null 2>&1 # reset irix/tps bug if [ $? -ne 0 ]; then echo "mt error encountered" mt -t $tpdev stat exit 1 fi bs=`mt -t $tpdev blksize 2>&1 | grep Maximum | cut -f5 -d" "` # get maxblksz let MAXDMASZ_BYTES="(1024-1)*4*1024" # max default DMA on irix if [ bs -gt $MAXDMASZ_BYTES ]; then bs=$MAXDMASZ_BYTES fi else bs=65533 # 64KB-3 is ok on most OS'es fi dd if=$tpdev of=$tmpfile count=1 bs=$bs >/dev/null 2>&1 if [ $? = 0 ]; then mt -t $tpdev bsr 1 >/dev/null 2>&1 if [ $self = mtbs ]; then bytes=`ls -l $tmpfile | awk '{ print $5 }'` let mod=bytes%512 if [ $mod -eq 0 ]; then let blocks=bytes/512 echo bytes=$bytes blocks=$blocks else echo bytes=$bytes fi elif [ $self = mtfile ]; then file $tmpfile | sed "s%$tmpfile%$tpdev%" fi if [ -f $tmpfile ]; then /bin/rm $tmpfile; fi else echo "dd error encountered" exit 1 fi -- "it all looks fine to the naked eye, but it don't really happen that way at all..." PT John R. <>< Vanderpool NASA/GSFC/HSTX