- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to send a scsi log sense command?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2007 07:44 AM
тАО08-03-2007 07:44 AM
I want to write a program which sends a scsi log sense command to tape drives to see if the 'cleaning requested' bit has been set. This would allow us to get a message when it's time to clean drives. I have found doc on doing an inquiry data/mode sense, but nothing about a log sense - I don't know what IO function to call. Anybody know how to do this? THANKS!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2007 11:31 AM
тАО08-03-2007 11:31 AM
SolutionIf you ask nicely, I might be able to convince someone in VMS Engineering (or someone who otherwise has access to the sources) to return that information via $GETDVI, assuming that information is actually squirreled away somewhere in the tape device's UCB ($GETDVI cannot do any I/O as part of its item code processing).
-- Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2007 01:23 PM
тАО08-03-2007 01:23 PM
Re: How to send a scsi log sense command?
SYS$ETC:SCSI_INFO.EXE or
SYS$ETC:SCSI_MODE.EXE could be tweaked to do
this job. Strangely, I don't see anything in
SYS$EXAMPLES which looks like source for
these programs.
As for log v. mode, I know even less than
usual.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2007 03:50 PM
тАО08-03-2007 03:50 PM
Re: How to send a scsi log sense command?
Here's the quick tour:
acquire phy_io privilege, and try to keep share turned off if you have it. This to avoid hijacking a device.
assign an I/O channel to the device
build a scsi command data block (cdb)
build the parameter block required by the cdb, if any
call $qio with the IO$_DIAGNOSE function, with the cdb as the argument.
Process any return status.
You may need to lob a status or TEST UNIT READY command at the device, depending on how it reacts.
The approach can be improved by allocating the device, or otherwise tapping into the locking to prevent shared access. Random commands arriving at a SCSI device can cause the device to become tangled.
I've certainly written more than my share of this stuff. There's a more detailed tour of this sort of operation here: http://64.223.189.234/node/24
GKDRIVER applies if there's no other driver for the device, but you have MKDRIVER here. So you can and should use MKDRIVER here.
If you're on V8.3, the undocumented CDDVD/INQUIRE gets a whole lot more data back from your average device. See SYS$ETC:CDDVD$TOOLS.CLD and the referenced tools for some details. (I coded that tool to work with CD and DVD devices, as well as with tapes and magnetic disks.)
There's a baseline example of lobbing raw IO$_DIAGNOSE commands at a device in the DECwindows CD Player tool; in DECW$EXAMPLES:. There are other examples of IO$_DIAGNOSE around. Also look at T10DEF in LIB.
Stephen Hoffman
HoffmanLabs LLC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2007 08:06 PM
тАО08-05-2007 08:06 PM
Re: How to send a scsi log sense command?
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2007 05:05 AM
тАО08-06-2007 05:05 AM
Re: How to send a scsi log sense command?
If VMS does have/save this info somewhere, it would be brilliant to have getdvi and/or show dev/full return this info (there are two flags: cleaning requested and cleaning required). But I think doing a log sense might be needed to get the info from the drive, although when "cleaning required" is set, the drive begins to send errors back to VMS.
If I may have the temerity to ask a couple more questions:-)
Will I need diagnose privilege in addition to phy_io?
I want to run this on both directly-attached scsi and fibre attached. Any special considerations for MG devices?
Again, much thanks, the info-sharing here is incredible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2007 05:47 AM
тАО08-06-2007 05:47 AM
Re: How to send a scsi log sense command?
Special considerations? When tossing IO$_DIAGNOSE calls at devices, yes, there can be considerations. This sort of operation is device-dependent, so you'll be learning what happens for each device. Some device drivers have the API, some do not. Some devices respond to SCSI commands as expected, and some do not.
I've not tried tossing a log sense at a Fibre Channel SAN device driver, so I don't know what will happen here.
Probably my biggest concern here would involve avoiding interspersing your SCSI commands into another data stream active with the device. Some SCSI commands permit this, and some devices can get confused.
I'd not experiment on a production system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2007 06:21 AM
тАО08-06-2007 06:21 AM
Re: How to send a scsi log sense command?
Fortunately I do have a test system to work with. Also fortunate - I don't need to query already active devices, so I will allocate/deallocate strictly. I think/hope there is enough of a 'grace period' between cleaning requested and cleaning required (hitting the second threshold means the device stops working and throws errors until cleaned) that I can run this prog. before each backup starts. This program can alert us to proactively clean the drive, which is operationally much easier than: in the middle of the night, recognizing the error condition as cleaning required, cleaning during a backup operation, and successfully resuming/restarting that backup.