How do I establish whether the tape in a tape drive is writable ?

From: Niall Macpherson (niall.macpherson_at_moneyline.com)
Date: 06/20/03


Date: 20 Jun 2003 02:37:30 -0700

I have a backup script which runs at 2 am in the morning every day.

However , I would like to run a cron job in the afternoon on the
previous day which will mail someone if the backup tape is not present
or not writeable.

I have tried using the output from the mt command using the status
option.

This is fine if there is no tape in the drive since I get this output

# mt -f /dev/rmt/0 status
HP DDS-3 4MM DAT tape drive:
   sense key(0x6)= Unit Attention residual= 0 retries= 0
   file no= 0 block no= 0

if there is a tape , and this output

# mt -f /dev/rmt/0 status
/dev/rmt/0: no tape loaded or drive offline

if there is not . However when there is a tape , but it has been set
read only I get the same output from mt as I get when it is writeable.

Is there a simple way to check whether or not the tape is writeable
without actually trying to write something to it ?

Thanks

Niall



Relevant Pages

  • Tar -tav takes 3 hours to complete
    ... I am testing a new backup script and after completion of the backup (1.5 Gig ... I attempted to check the contents of the tar ... From looking at the tape drive, ... it read the entire tape rather than a file catalog. ...
    (comp.unix.aix)
  • Vdump on 5.1b pkt6
    ... Before PK6, vdump will fail when the end of tape is reached. ... backup script can check for the message "out of space", ...
    (Tru64-UNIX-Managers)
  • Removable Storage
    ... We have a standalone server with a standalone tape drive. ... The backup script that we use ... specifies the tape name as Week1 or Week2. ...
    (microsoft.public.windows.server.general)
  • Re: Tar -tav takes 3 hours to complete
    ... > I am testing a new backup script and after completion of the backup (1.5 Gig ... > it read the entire tape rather than a file catalog. ... There is no file catalogue with a tar file on tape. ...
    (comp.unix.aix)
  • Re: Exabyte 221L Auto Loader
    ... I have a Promise 15100 raid with 2 logical drives ... requires you to take the drive offline before performing tape move ... script at the end of a session. ... This takes the drive offline, ejecting the tape, uses mtx to place ...
    (freebsd-questions)