st: EIO upon almost full tape?

From: Richard Weinberger
Date: Fri Sep 27 2019 - 11:39:07 EST


Hi!

Recently I got access to a tape library and as a side project I try to
turn it into something useful.
First tests showed that it seems to work fine until it tried to fill a tape:

dd if=/dev/urandom of=/dev/st0 ibs=1M obs=512K

After around 1.8TiB dd terminates with EIO and in dmesg I see:
[535116.858716] st 0:0:0:0: [st0] Sense Key : Medium Error [current]
[535116.858720] st 0:0:0:0: [st0] Add. Sense: Write error
[535116.874357] st 0:0:0:0: [st0] Sense Key : Medium Error [current]
[535116.874370] st 0:0:0:0: [st0] Add. Sense: Write error
[535116.874373] st 0:0:0:0: [st0] Error on write filemark.

After a reinsert of the tape it works fine again. But any other attempt
to fill it results into EIO. Every single time after ~1.8TiB (-/+
10GiB) have been written.

I expected to terminate dd after around 2.5TiB with ENOSPC.

First I thought the tape is bad, but even with a new one I face the same issue.
Tape is LTO-6 and drive a IBM ULTRIUM-HH6.

Is my test wrong? There is a high chance that I'm doing something
horrible wrong,
I fear I'm a little too young for tape drives. ;-)

Maybe the tape drive is faulty but why is it always failing after 1.8TiB?
According to the tape library the drive is good and passes all self-tests.
And yes, I have a cleaning tape in my library too.

--
Thanks,
//richard