mt and tar fail on LTO-5 drives

bartels bartels@mailme.ath.cx
Tue Aug 20 11:57:00 GMT 2013


On 08/20/2013 11:05 AM, Corinna Vinschen wrote:
> On Aug 20 10:29, Corinna Vinschen wrote:
>> On Aug 19 21:10, bartels wrote:
>>> On 08/19/2013 07:12 PM, Corinna Vinschen wrote:
>>>> It would be interesting to see the OS error codes.  If you run tar under
>>>> strace, the trace output should contain a line like
>>>>
>>>>    [...] write: Win32 error XXXX
>>>>
>>>> or
>>>>
>>>>    [...] close: Win32 error XXXX
>>>>
>>>> The value of XXXX is what I'm curious about.
>>> Here is the error:
>>>
>>>   15692 21364024 [main] tar 5700 mtinfo_drive::error: write: Win32 error 1100
>> ERROR_END_OF_MEDIA.  The OS really thinks the medium is at its end...
>>
>> ...or the *partition* is at its end.  Something occured to me this
>> morning.  Are you using used tapes, rather than fresh ones?  Are the
>> tapes you're using partitioned, by any chance, maybe because LTFS
>> partitions the tape in two partitions, one for the files and one for
>> metadata?
>>
>> This would explain the low capacity you see in mt status output.  If the
>> tape is partitioned, the capacity returned by GetTapeParameters is not
>> the size of the entire tape, but the size of the current partition(*).
>> And partition 0 is probably the metadata partition.
>>
>> This also explains why you get a supposedly early ERROR_END_OF_MEDIA.
>> The partition is just not bigger.
>>
>> Try this:
>>
>>    $ mt -f /dev/nst0 setpartition 0
>>    $ mt -f /dev/nst0 status 2
>>    $ mt -f /dev/nst0 setpartition 1
>>    $ mt -f /dev/nst0 status 2
> Make that
>
>      $ mt -f /dev/nst0 setpart 0
>      $ mt -f /dev/nst0 status 2
>      $ mt -f /dev/nst0 setpart 1
>      $ mt -f /dev/nst0 status 2
>
> I wrote the setpart and mkpart commands before mt on Linux had them and
> naturally they are now using different strings.  I'll have another look
> into mt to make it more compatible with mt on Linux.
>
>
Well, Corinna, you really saved the day. I missed the partition stuff completely.

     $ mt -f /dev/nst0 status 2
     drive type       :       56 (STK 9840)
     tape capacity    : 1419369472 KB remaining        : 1324161024 KB
     current file     :       -1             active partition :        1
     current block    :       -1             cur logical block:   195351
     General status bits on (1090000):
       ONLINE IM_REP_EN HW_ECC
     min block size   :        2             max block size :   524288
     def block size   :   131072             cur block size :        0
     density code     :       58 (Ultrium LTO-5)


Thanks, I think we can close this one!

- Bartels



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



More information about the Cygwin mailing list