[2472] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: SCSI Tape driver

daemon@ATHENA.MIT.EDU (Richard B. Johnson)
Tue Sep 16 13:31:23 1997

Date: 	Tue, 16 Sep 1997 12:01:30 -0400 (EDT)
From: "Richard B. Johnson" <root@chaos.analogic.com>
Reply-To: root@chaos.analogic.com
To: Michael Weller <eowmob@exp-math.uni-essen.de>
cc: Ricky Beam <root@defiant.interpath.net>,
        Sameer Anja <sameer@securities.com>, linux-scsi@vger.rutgers.edu
In-Reply-To: <Pine.A32.3.95.970916165409.72568C-100000@werner.exp-math.uni-essen.de>

On Tue, 16 Sep 1997, Michael Weller wrote:
[SNIPPED]
> 
> UGH! NO! You must be able to position your tape using mt and/or using
> several backup commands (say: tar) on the non rewinding tape device
> (except of the last command issued). All this will result in several
> open/close transitions.

On the non rewinding device, i.e., the minor has its high bit set.
However, without this bit set, maybe previous bad stuff should be
forgotten???

All my 'mt' commands go to the no-rewind (save-state) device as do
the backup commands when a backup is in progress. The first access
off from /dev/st0 should probably clear history.

#
# Backup procedure
#
LOG="/root/logs/backup.log"
TAPE="/dev/st3"
CNTL="/dev/st3"
RSET="/dev/st0"
/bin/date>${LOG}
/bin/mt retension ${RSET}
/bin/mt rewind ${RSET} 
/bin/mt status >>${LOG}
cd /
if ! /bin/tar -cvlf ${TAPE} . >>${LOG} ; then
   /bin/date                  >>${LOG}
   /bin/mt status             >>${LOG}
   exit 1
fi
/bin/date                >>${LOG}
/bin/mt status           >>${LOG}
cd /home/users
/bin/mt eod    ${CNTL}
sleep 10 
if ! /bin/tar -cvlf ${TAPE} . >>${LOG} ; then
   /bin/date                  >>${LOG}
   /bin/mt status             >>${LOG}
   exit 1
fi
/bin/date                >>${LOG}
/bin/mt status           >>${LOG}
cd /dos/drive_C
/bin/mt eod    ${CNTL}
sleep 10 
if ! /bin/tar -cvlf ${TAPE} . >>${LOG} ; then
   /bin/date                  >>${LOG}
   /bin/mt status             >>${LOG}
   exit 1
fi
/bin/date                >>${LOG}
/bin/mt status           >>${LOG}
cd /dos/drive_D
/bin/mt eod    ${CNTL}
sleep 10 
if ! /bin/tar -cvlf ${TAPE} . >>${LOG} ; then
   /bin/date                  >>${LOG}
   /bin/mt status             >>${LOG}
   exit 1
fi
/bin/date                >>${LOG}
/bin/mt status           >>${LOG}
/bin/mt rewind ${CNTL}
sleep 10
/bin/mt status ${CNTL}   >>${LOG}
echo "`/bin/uname -a | /usr/bin/cut -d\  -f1,3`. (Posix)." > /etc/motd
echo "Last backup completed `/bin/date`">> /etc/motd
exit 0



The problem is, there doesn't seem to be any way to clear errors from
a previous bad tape! Once there's a media error the drive is unusable
until a reboot even if the tape is changed.

Cheers,
    DJ
Richard B. Johnson
Analogic Corporation
Penguin : Linux version 2.1.54 on an i586 machine (66.15 BogoMips).
Warning : It's hard to stay on the trailing edge of technology.
  Linux : Engineering tool 
Windows : Child's computer interface written in BASIC.
 Win-NT : Child's computer interface rewritten in C.
 


home help back first fref pref prev next nref lref last post