Command to get tape capacity status?

Nigel Wade nmw at ion.le.ac.uk
Mon Apr 14 13:22:21 UTC 2008


Scott R. Ehrlich wrote:
> Hello to all:
> 
> I have an Overland tape library connected, via SCSI card, to an 
> out-of-box, full install of CentOS 5 install on an old PC.
> 
> I have a script that uses tar to archive data to tape and mtx to change 
> tapes. What I don't know, if possible, is to obtain the status of how 
> much tape is left in the drive.   If I get a write failure, I'd like to 
> know if the tape is bad or has run out of space.
> 
> I know of bacula, amanda, and other backup methods, but I prefer to use 
> the simplest options possible, mainly because if a hard drive failure 
> occurs, which has happened at the last minute, I can take the original 
> CentOS 5 media from CD, install it, and get back up and running in no time.
> 
> So, any way to inquire remaining tape status and [estimated] capacity?
> 
> Thanks.
> 
> Scott
> 

AFIAK there is no command within Linux to determine the capacity of a 
tape. Probably because there is no general/generic way of doing this, if 
it is possible at all.

Some tape drives are capable, if you send them the right SCSI command, 
of reporting the remaining capacity. Whether your tape drive can do 
that, and the exact command needed to get that information, would 
require detailed knowledge of the SCSI command set it supports. Unless 
you have that information it's very unlikely you'll be able to get what 
you want.

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw at ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555




More information about the redhat-list mailing list