public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* mt LTO 6 Unknown type of tape device AND online status not correct
@ 2018-06-22 17:47 Timo Maier
  2018-06-25 12:08 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Timo Maier @ 2018-06-22 17:47 UTC (permalink / raw)
  To: cygwin

Hello,

the following is done with: mt V2.5.2, Corinna Vinschen, Aug 26 2013

I have a Quantum LTO 6 Tape Drive (QUANTUM_ULTRIUM-HH6) which works in general with the latest cygwin64. I can use mt to rewind or eject and tar can write and read the tape.

Before starting to write I want to check if the tape is ready with "status", but no matter if the tape is in or not, status always says ONLINE.

Can anyone help, please? Thanks in advance.

***************

C:\Tools\cygwin64\bin>mt -f /dev/nst0 status 3

drive type       :       01 (Unknown type of tape device)
tape capacity    : 2328305664 KB          remaining        : 1651876953 KB
current file     :        0             active partition :        0
current block    :        0             cur logical block:        0
General status bits on (410b0000):
  BOT ONLINE IM_REP_EN HW_ECC HW_COMP
min block size   :        1             max block size   :  1048576
def block size   :    65536             cur block size   :        0
density code     :       00 (default)

Drive(r) Capabilities:
----------------------
fixed length blocks        : yes        var length blocks          : yes
set block size             : yes        fixed partitioning         : yes
select partitioning        : yes        initiator partitioning     : yes
get logical blockno        : yes        logical block spacing      : yes
get absolute blockno       : no         absolute block spacing     : no
logical block immediate    : yes        absolute block immediate   : no
relative block spacing     : yes        backward spacing           : yes
immediate rewind           : yes        fast EOM spacing           : yes
immediate spacing          : no         write marks immediate      : yes
filemark spacing           : yes        write filemarks            : yes
write long filemarks       : no         write short filemarks      : no
report setmarks            : no         setmark spacing            : no
write setmarks             : no         set report setmarks        : no
sequential filemarks       : no         sequential setmarks        : no
load and unload            : yes        un/load immediate          : yes
lock and unlock            : yes        un/lock immediate          : no
tape retension             : no         retension immediate        : no
erase on bop only          : no         erase immediately          : yes
long erase                 : yes        short erase                : yes
sw ejects media            : yes        report write protection    : yes
report EOT warn size       : no         set EOT warn size          : no
data padding               : no         set data padding           : no
returns capacity           : yes        returns remaining          : yes
hw error correction        : yes        set hw error correction    : no
hw compression             : yes        set compression            : yes
set comp. on bop only      : no         report cleaning request    : yes

C:\Tools\cygwin64\bin>mt -f /dev/nst0 status

Unknown type of tape device tape drive:
File number=0, block number=0, partition=0
Tape block size 0 bytes. Density code 0x00 (default).
Soft error count since last status=0
General status bits on (410b0000):
  BOT ONLINE IM_REP_EN

C:\Tools\cygwin64\bin>mt -f /dev/nst0 rewoffl

(Tape rewinds and is being ejected)

C:\Tools\cygwin64\bin>mt -f /dev/nst0 status

Unknown type of tape device tape drive:
File number=-1, block number=-1, partition=0
Tape block size 0 bytes. Density code 0x00 (default).
Soft error count since last status=0
General status bits on (10b0000):
  ONLINE IM_REP_EN


-- 
Timo


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mt LTO 6 Unknown type of tape device AND online status not correct
  2018-06-22 17:47 mt LTO 6 Unknown type of tape device AND online status not correct Timo Maier
@ 2018-06-25 12:08 ` Corinna Vinschen
  2018-06-28 18:04   ` Timo Maier
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2018-06-25 12:08 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

On Jun 22 14:33, Timo Maier wrote:
> Hello,
> 
> the following is done with: mt V2.5.2, Corinna Vinschen, Aug 26 2013
> 
> I have a Quantum LTO 6 Tape Drive (QUANTUM_ULTRIUM-HH6) which works in general with the latest cygwin64. I can use mt to rewind or eject and tar can write and read the tape.
> 
> Before starting to write I want to check if the tape is ready with "status", but no matter if the tape is in or not, status always says ONLINE.
> 
> Can anyone help, please? Thanks in advance.

The ONLINE status is a result of the following (pseudo) Windows calls:

  offline = false;
  if (GetTapeStatus (tape_handle) == ERROR_NO_MEDIA_IN_DRIVE
      || GetTapeParameters (tape_handle, GET_TAPE_MEDIA_INFORMATION, ...)
	 == ERROR_NO_MEDIA_IN_DRIVE)
    offline = true;

The actual code also ignores ERROR_MEDIA_CHANGED errors, but it does
*not* ignore ERROR_BUS_RESET.  Assuming the drive doesn't screw up
completely, maybe an ERROR_BUS_RESET is generated.  However, this
should have been catched by the GetTapeStatus call so the subsequent
GetTapeParameters call should return a sane error code.  Hmm.

If I give you the URL to a special Cygwin DLL just for testing this
situation via PM, are you willing to run it so we may find the cause of
this discrepancy?  No guarantee this can be fixed, but we can at least
try.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mt LTO 6 Unknown type of tape device AND online status not correct
  2018-06-25 12:08 ` Corinna Vinschen
@ 2018-06-28 18:04   ` Timo Maier
  2018-06-29 22:48     ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Timo Maier @ 2018-06-28 18:04 UTC (permalink / raw)
  To: cygwin

Hello Corinna,

yes, pls send me the DLL, I will try.

-- 
Timo


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mt LTO 6 Unknown type of tape device AND online status not correct
  2018-06-28 18:04   ` Timo Maier
@ 2018-06-29 22:48     ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2018-06-29 22:48 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On Jun 28 10:19, Timo Maier wrote:
> Hello Corinna,
> 
> yes, pls send me the DLL, I will try.

Thanks for testing!

Turns out the drive in question returns a non-standard error code,
ERROR_NOT_READY rather than ERROR_NO_MEDIA_IN_DRIVE to indicate that no
media is present.  This error code is not documented as a valid return
value for GetTapeStatus on MSDN.  I pushed a patch to handle this
error code and uploaded new developer snapshots with this patch to
https://cygwin.com/snapshots/

Please use the snapshot DLL for the time being if you need access to
your drive from Cygwin.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-29 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 17:47 mt LTO 6 Unknown type of tape device AND online status not correct Timo Maier
2018-06-25 12:08 ` Corinna Vinschen
2018-06-28 18:04   ` Timo Maier
2018-06-29 22:48     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).