mt and tar fail on LTO-5 drives
Corinna Vinschen
corinna-cygwin@cygwin.com
Mon Aug 19 10:19:00 GMT 2013
On Aug 17 20:35, bartels wrote:
> Hello People,
>
> I have here two SAS connected LTO-5 drives: one IBM and one HP.
>
> Both drives work work fine, but sadly mt does not.
> The size reported by mt is a meager 35 GB, instead of the expected 1.5TB
>
> I have tried both an older 32 bit and the 'current' 64 bit cygwin: same result.
>
> Writing to tape works fine with tar, but the tape is quickly considered 'full'.
> Is there any hope of fixing this? LTO-6 is already out there.
I don't know. Cygwin uses the Win32 tape API. The OS function
GetTapeParameters returns the capacity and the # of remaining bytes as 8
bytes LARGE_INTEGER value. The size of LT)-5 or LTO-6 should fit easily
into that.
I just checked that the value is stored within Cygwin as 8 byte long
long value, so no problem there. The mt tool prints the value as %lld
value, so it should print it correctly as 8 byte value. From what I can
see, the wrong value *seems* to be returned by the OS.
Also, the write(2) function does not check for the remaining bytes, so I
wonder why tar should fail prematurely, unless there's a problem with
the block number. The OS function GetTapePosition returns the current
block number as LARGE_INTEGER, but Cywin stores it in a 32 bit int. So
the block number overflows after 4 billion blocks. But even with a
small blocksize of 512 bytes this would only occur at about 2 TB of
data, long after the end of the tape. Despite that this is more of a
theoretical problem, the mtop struct to pass parameters to ioctl(fd,
MTIOCTOP, ...) only allows 4 byte count values anyway, even on Linux.
Another potential problem is if you try to use blocksizes > 64K. I don't
know if that's still a problem in newer Windows versions, but with older
versions including Windows XP, the OS didn't handle blocksizes > 64K
correctly and we got spurious error messages. Something about this
should be in the mailing list archives of old.
But the bottom line is, I have no way to test and debug that, since I
don't have access to an LTO-5 drive, nor do I have a Windows machine
with SAS controller. However, since Cygwin as well as the mt tool are
Open Source, maybe you can have a look and debug this issue?
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130819/4480be09/attachment.sig>
More information about the Cygwin
mailing list