Networker

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

2006-11-01 00:14:57
Subject: Re: [Networker] detecting read/write status of tape
From: Tim Mooney <Tim.Mooney AT NDSU DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Tue, 31 Oct 2006 23:10:00 -0600
In regard to: Re: [Networker] detecting read/write status of tape, Peter...:

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....

The Write Protect status of a SCSI device is generally returned from
the MODE SENSE (10h) SCSI command.  If the original poster were on
a Linux system with the sg-utils installed, the sg_modes command could
be used to send the MODE SENSE command and read the returned data.

It's possible that Solaris has some command that would do the same
thing, but although I have access to x86_64 Solaris 10, I don't know
what that command would be.  I have the man page for lusbinfo installed,
which *might* return useful information (esp with -v), but I don't have
the command installed so I can't tell if it's relevant or not.

I've done SCSI programming on Linux, but never on Solaris.  It looks like
there's enough source code out there that it wouldn't be a "start from
scratch" effort, but I would explore the Solaris SCSI-related commands
before the O.P. should try that route.

Tim

-----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.

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


--
Tim Mooney                                           Tim.Mooney AT ndsu DOT edu
Information Technology Services                      (701) 231-1076 (Voice)
Room 242-J6, IACC Building                           (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

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>