Erase all tapes script?

danielparker

Member
Aug 29, 2010
11
0
21
Hi,

I have a Dell TL4000 Tape Library, and I thought I would have a play with PBS with it.. All of my tapes have been used by Bacula in the past, so I have to erase them prior to labeling them. I have not found a way to erase all tapes from the GUI.. so I was hoping someone has written a script that they could share to automate this process?

Thanks in advance.

Daniel
 

davlaw

Active Member
Apr 4, 2012
179
1
38
its dirty messy, but its what I use when I have to. Maybe others have a more elegant solution. Looking , I think it first revinds, writes weof, goes off line

Anyway I have to edit it each time for what I do since I have several libraries I have worked with.

the line for i in # # # # # #, would be the slots the tapes are in, so below tapes 1-6 are done in squence
if you where to do the whole libary, 1 2 3 so on 29 30

As a matter of fact I found this when working with bareos, a cousin, sister, brother of backula

Code:
#!/bin/sh

#LIBRARYB="scsi-1ADIC_A0C0316328_LLA"
LIBRARYB="scsi-ADICA0C0607908_LLA"
#DRIVE="scsi-3
#DRIVE="1"
#DRIVEPHY="scsi-F09C7CF004-nst"
DRIVE="0"
DRIVEPHY="scsi-F09C7CF000-nst"
for i in 1 2 3 4 5 6
  do
echo $i
#mtx -f /dev/tape/by-id/$LIBRARYB inquiry
mtx -f /dev/tape/by-id/$LIBRARYB status
#mtx -f /dev/tape/by-id/$LIBRARYB load $i /dev/tape/by-id/$DRIVE
mtx -f /dev/tape/by-id/$LIBRARYB load $i $DRIVE
echo "rewind "
mt -f /dev/tape/by-id/$DRIVEPHY rewind
echo "weof "
mt -f /dev/tape/by-id/$DRIVEPHY weof
echo "rewoffi "
mt -f /dev/tape/by-id/$DRIVEPHY rewoffl
mtx -f /dev/tape/by-id/$LIBRARYB unload $i $DRIVE
done
exit 0
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!