tar to DDS4 tape - small capacity

Gaspar Bakos <[email protected]> Fri, 28 Nov 2003 13:03:11 -0500 (EST)
Newsgroups gmane.linux.tape
Message-ID <[email protected]>
Hi,

I encounter a problem when writing to DDS4 tapes under Linux: I can write
far less (sometimes 10Gb) than the nominal capacity (20Gb) in uncompressed
mode. I was wondering if anyone has a clue where the error could be.
Basically the tar exits as:

-rw-rw-r-- hatuser/hatuser 5694575 2003-11-10 11:15:01 6-20031107/15641.fits.fgz
tar: /dev/nst0: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now

$ echo $?
2

After the error occurs, I don't see EOT or EOD with "mt status". But I
have the suspicion that the tape might be at the end. Unfortunately, if
I eject it to check what is going on, it automatically rewinds itself.
This might be related to
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=79027

Any advice regarding the following (blocksizes, the way I archive, etc.)
are welcome.

Thanks
Gaspar

Software
--------
Linux redhat 7.3
kernel 2.4.18
mt-st v. 0.7
tar (GNU tar) 1.13.25
Adaptec AIC7xxx driver version: 6.2.4
aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs

Hardware
--------
Drive: Seagate STD6401LW-S DDS4 external DAT
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: SEAGATE  Model: DAT    9SP40-000 Rev: 9100
  Type:   Sequential-Access                ANSI SCSI revision: 03

Tape: Sony premium 150P DDS4


The way I archive:
------------------

mt -f /dev/nst0 rewind
tar cvf /dev/nst0 --totals -v -b 126 DIR1
tar cvf /dev/nst0 --totals -v -b 126 DIR2
...
tar cvf /dev/nst0 --totals -v -b 126 DIRN

Size of one DIR is typically 1.5Gb with du -s -k.
The files in DIR are 8Mb and few kB (large and small ones, alternating).

Stinit.def (I am using mode1)
----------

manufacturer=SEAGATE model="DAT    9SP40-000" revision="9100" {
scsi2logical=1
can-bsr can-partitions auto-lock
#
#modes
mode1 blocksize=0 compression=0
mode2 blocksize=512 compression=0
mode3 blocksize=0 compression=1
mode4 blocksize=512 compression=1
}

Some further questions

- Can archiving capacity crucially depend on
type of tape
retensioning
cleaning heads?

- Is there a way to tell how much length from the tape we actually
  consumed up at a given point?

======== DEBUG LOG =======
strace -f -o tar.trace tar cvf /dev/nst0 --totals -v -b 126

After 10Gb dump: at block 164176.
Attempt for further tar:
-rw-r----- hatuser/hatuser 8470080 2003-11-22 17:42:46 6-20031122/17652.fits
-rw-r----- hatuser/hatuser 8470080 2003-11-22 17:43:36 6-20031122/17654.fits
Total bytes written: 85929984 (82MB, 1.8MB/s)
tar: /dev/nst0: Wrote only 0 of 64512 bytes
tar: Error is not recoverable: exiting now
At block 165509.

===================
Output from strace:

12650 read(4, "\224\221\224z\224|\224\207\224y\224\234\224\202\224\247"..., 6451
2) = 64512
12650 write(3, "\224\221\224z\224|\224\207\224y\224\234\224\202\224\247"..., 645
12) = -1 ENOSPC (No space left on device)
#
#It says: no space left on device!
#
12650 time(NULL)                        = 1069962134
12650 open("/usr/share/locale/en_US.iso885915/LC_MESSAGES/tar.mo", O_RDONLY) = -
1 ENOENT (No such file or directory)
12650 open("/usr/share/locale/en_US/LC_MESSAGES/tar.mo", O_RDONLY) = -1 ENOENT (
No such file or directory)
12650 open("/usr/share/locale/en.iso885915/LC_MESSAGES/tar.mo", O_RDONLY) = -1 E
NOENT (No such file or directory)
12650 open("/usr/share/locale/en/LC_MESSAGES/tar.mo", O_RDONLY) = -1 ENOENT (No
such file or directory)
12650 write(2, "Total bytes written: 85929984 (8"..., 46) = 46
12650 write(2, "tar: ", 5)              = 5
12650 write(2, "/dev/nst0: Wrote only 0 of 64512"..., 38) = 38
12650 write(2, "\n", 1)                 = 1
12650 write(2, "tar: ", 5)              = 5
12650 write(2, "Error is not recoverable: exitin"..., 37) = 37
12650 write(2, "\n", 1)                 = 1
12650 munmap(0x4002a000, 4096)          = 0
12650 _exit(2)                          = ?

===============
mt -f /dev/nst0 status
SCSI 2 tape drive:
File number=12, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x26 (DDS-4 or QIC-4GB).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN

-
To unsubscribe from this list: send the line "unsubscribe linux-tape" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html