gtar failing, please help!

Kevin A. Pieckiel pieckiel+freebsd-questions at sdf.lonestar.org
Thu Feb 3 05:25:30 PST 2005


On Wed, Feb 02, 2005 at 06:22:21PM -0700, David Bear wrote:
> since you are using a tape, have you checked with 
> dmesg (for kernel message about the tape)
> mt errstat (cryptic output, but maybe someone here could help)

I get this in my dmesg output:

(sa0:ahc0:0:1:0): AutoSense Failed
(sa0:ahc0:0:1:0): WRITE FILEMARKS. CDB: 10 0 0 0 2 0 
(sa0:ahc0:0:1:0): CAM Status: SCSI Status Error
(sa0:ahc0:0:1:0): SCSI Status: Check Condition
(sa0:ahc0:0:1:0): ILLEGAL REQUEST asc:24,0
(sa0:ahc0:0:1:0): Invalid field in CDB: Command byte 3 bit 1 is invalid
(sa0:ahc0:0:1:0): Unretryable error
(sa0:ahc0:0:1:0): failed to write terminating filemark(s)
(sa0:ahc0:0:1:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM command to clear this state.

Of course, I can't use an OFFLINE, REWIND, or MTEOM command:

# mt rewind
mt: /dev/nsa0: Invalid argument

# mt offline
mt: /dev/nsa0: Invalid argument

# mt mteom
mt: mteom: unknown command

# camcontrol reset 2:1:0
Reset of 2:1:0 was successful

# mt status
Mode      Density              Blocksize      bpi      Compression
Current:  0x28:X3.224          variable       37871    0x4
---------available modes---------
0:        0x28:X3.224          variable       37871    0x4
1:        0x28:X3.224          variable       37871    0x4
2:        0x28:X3.224          variable       37871    0x4
3:        0x28:X3.224          variable       37871    0x4
---------------------------------
Current Driver State: at rest.
---------------------------------
File Number: 0  Record Number: 0        Residual Count 0


What's funny is that I tried using bsdtar for the same backup used to
produce the results above and, although it appears the tar command
worked (no error messages on terminal), the tape is inaccessible, just
like when I use gtar.  This also gets put in dmesg:

(sa0:ahc0:0:1:0): AutoSense Failed
(sa0:ahc0:0:1:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM command to clear this state.


Here are some other dmesg messages that came across during playing
with this thing.  Do I need to get my tape drive serviced?

(sa0:ahc0:0:1:0): parity error detected in Data-in phase. SEQADDR(0x55) SCSIRATE(0x93)
(sa0:ahc0:0:1:0): parity error detected in Data-in phase. SEQADDR(0x1a1) SCSIRATE(0x93)
(sa0:ahc0:0:1:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM command to clear this state.
(sa0:ahc0:0:1:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM command to clear this state.
(sa0:ahc0:0:1:0): AutoSense Failed
(sa0:ahc0:0:1:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM command to clear this state.


Occasionally I can get output from an mt errstat command:

Last I/O Residual: 0
 Last I/O Command: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   Last I/O Sense:

         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Last Control Residual: 0
 Last Control Command: 08 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00
   Last Control Sense:

         F0 00 08 00 00 20 00 18 00 00 00 00 00 05 00 00
         00 00 00 81 00 80 00 1D 0E 00 00 00 0C 00 00 00


This stuff means nothing to me.


> or rather try
> 
> dd if=/dev/zero of=/dev/nsa0 bs=512 count=10000
> 
> then play with different bs and count number. This will show you what
> your tape block size is -- and if your tape has some kind of crc
> error at a block, will also stop consistently at the same location.

Interestingly enough, I get ZERO errors with this, for any (valid) value
for bs or count:

# dd if=/dev/zero of=/dev/nsa0 bs=512 count=10000
10000+0 records in
10000+0 records out
5120000 bytes transferred in 9.709399 secs (527324 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=1024 count=10000   
10000+0 records in
10000+0 records out
10240000 bytes transferred in 10.987526 secs (931966 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=2048 count=10000    
10000+0 records in
10000+0 records out
20480000 bytes transferred in 11.537724 secs (1775047 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=4096 count=10000    
10000+0 records in
10000+0 records out
40960000 bytes transferred in 11.511335 secs (3558232 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=8192 count=10000    
10000+0 records in
10000+0 records out
81920000 bytes transferred in 11.398908 secs (7186653 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=16384 count=10000    
10000+0 records in
10000+0 records out
163840000 bytes transferred in 12.226020 secs (13400927 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=32767 count=10000     
10000+0 records in
10000+0 records out
327670000 bytes transferred in 14.960698 secs (21902053 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=65536 count=10000     
10000+0 records in
10000+0 records out
655360000 bytes transferred in 18.496691 secs (35431202 bytes/sec)

# dd if=/dev/zero of=/dev/nsa0 bs=65536 count=983040
983040+0 records in
983040+0 records out
64424509440 bytes transferred in 1710.457231 secs (37665081 bytes/sec)

# mt status
Mode      Density              Blocksize      bpi      Compression
Current:  0x28:X3.224          variable       37871    0x4
---------available modes---------
0:        0x28:X3.224          variable       37871    0x4
1:        0x28:X3.224          variable       37871    0x4
2:        0x28:X3.224          variable       37871    0x4
3:        0x28:X3.224          variable       37871    0x4
---------------------------------
Current Driver State: at rest.
---------------------------------
File Number: 1  Record Number: 0        Residual Count 0


More information about the freebsd-questions mailing list