Networker

Re: [Networker] detecting read/write status of tape

2006-11-01 00:13:56
Subject: Re: [Networker] detecting read/write status of tape
From: Rolf <rolf AT SES.TAS.GOV DOT AU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Wed, 1 Nov 2006 16:06:39 +1100
Hi

Thanks, but no it doesn't seem to report anything different. An example output:

cdi_get_status -f /dev/rmt/0cbn
CDI_GET_STATUS returns:
DRIVE_STATUS_READY
current density code = 42
position is absolute block number 0

The -v flag adds nothing useful and the -t flag to set query method returns errors for all but the default query type.

When the a tape is in the drive, wthere write protected or write enabled or the drive is empty the output does not change; reports "DRIVE_STATUS_READY", as above.

While reading some more about this command I also read about cdi_inq and cdi_ta neither of which seems to be able to extract whichever particular setting indicates "DRIVE_STATUS_WRITE_PROTECT", which I think is the code needed.

rolf.


On 01/11/2006, at 3:17 PM, Peter Viertel wrote:

Try running /usr/sbin/cdi_get_status -v -f /dev/rmt/Xcbn

If you compare the output from when the drive is empty or a WP tape is
in there and a writeable one is you may see some difference in the
outputs.... There are various flags reported but they're not documented
anywhere I've found so we need someone to try it out....


-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT listserv.temple DOT edu] On
Behalf Of Rolf
Sent: Wednesday, 1 November 2006 1:54 PM
To: NETWORKER AT listserv.temple DOT edu
Subject: Re: [Networker] detecting read/write status of tape

hi

Thanks for the responses but I can't find any reference in NSR device
to the actual read/write status as determined by the tab on the tape.

As suggested i did mount the volume but nsrwatch does not report its
status consistently with respect to the tab.  It reports write
enabled but that is set at the Networker level (the tape's read only
tab was set), presumably using the read only instruction to nsrmm
Similarly nsradmin's output from querying type: NSR device shows read
and write attributes, set to enabled.

The closest I can get to determining the tab setting was to attempt
to write to the tape and read the output.  I did this by attempting
to label it:

nsrmm -y -l SOMELABEL which failed with the useful error
"DRIVE_STATUS_WRITE_PROTECT".  I could act on this, though it seems a
little clumsy.
Furthermore labelling a tape is destructive, which I would prefer
such a test of its read/write status not to be.

If I did indeed test by attempting a write and monitored the output
and hence could act on seeing that error, what would be a simple way
to write to the end of the tape some small trivial data that if
succeeded would not affect the integrity of the other data, and if
fails with that error, answers the query?

I ask as I don't know quite enough to manipulate the volume at this
low a level.

thanks again

r.

I can't seem to find a way to determine the read only or read write
status of an LTO2 tape.  Using Solaris.  mt won't tell me.

I thought nsrmm would report the status but I can't see how if it
can.

No, it can't.  That information isn't stored in the database.  Such
information isn't required, and it could change without the server
knowing, so storing it isn't useful. You have to check on each mount.

If anyone knows how to find out the status of the read/write tab in a
form suitable for incorporation into a script I'd be most grateful.

Ugh, I'm well away from my test system, so I can't flip a tab to
investigate.

I believe that (when mounted), the state appears in the GUI and
nsrwatch. If true, then I'd wager that either the 'NSR device' or the
'NSR' resources would have the information.  I just don't see the
correct field by a quick scan at the manual.

--
Darren Dunham
ddunham AT taos DOT com
Senior Technical Consultant         TAOS            http://
www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay
area
         < This line left intentionally blank to confuse you. >

To sign off this list, send email to listserv AT listserv.temple DOT edu
and type "signoff networker" in the
body of the email. Please write to networker-
request AT listserv.temple DOT edu if you have any problems
wit this list. You can access the archives at http://
listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER



This message may contain confidential information which is intended only
for the individual named.
If you are not the named addressee you should not disseminate,
distribute or copy this email.
Please notify the sender immediately by email if you have received this
email by mistake and delete this email from your system.
Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or
omissions
 in the contents of this message which arise as a result of email
transmission.
If verification is required please request a hard copy version.

To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the
body of the email. Please write to networker- request AT listserv.temple DOT edu
if you have any problems
wit this list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER


NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank.



This message may contain confidential information which is intended only for 
the individual named.
If you are not the named addressee you should not disseminate, distribute or 
copy this email.
Please notify the sender immediately by email if you have received this email 
by mistake and delete this email from your system.
Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of email transmission.
If verification is required please request a hard copy version.

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>