Re: Closing /dev/st0 return EIO error, /dev/nst0 not I have compiled the tape driver (st.c) with DEBUG=1. I get the following
trace :
Nov 8 17:26:41 darkstar kernel: st: segment sizes: first 32768, last
32768 bytes.
Nov 8 17:27:48 darkstar kernel: st0: Error: 28000002, cmd: 0 0 0 0 0 0
Len: 0
Nov 8 17:27:48 darkstar kernel: st0: Mode sense. Length 16, medium 81,
WBS 10, BLL 8
Nov 8 17:27:48 darkstar kernel: st0: Density 0, tape length: 46720, drv
buffer: 1
Nov 8 17:27:48 darkstar kernel: st0: Block size: 0, buffer size: 32768
(1 blocks).
Nov 8 17:27:48 darkstar kernel: st0: File length 4096 bytes.
Nov 8 17:27:48 darkstar kernel: st0: Async write waits 1, finished 0.
Nov 8 17:28:31 darkstar kernel: st0: Buffer flushed, 1 EOF(s) written
Nov 8 17:28:31 darkstar kernel: st0: Rewinding tape.
Nov 8 17:28:31 darkstar kernel: st0: Error: 27070008, cmd: 1 0 0 0 0 0
Len: 0
Gilles Hamel wrote:
> Hello,
>
> I have a old tape streamer Exabyte EXB-8200.
> Backup and restore work fine. However, when I use the device file
> /dev/st0 (rewind on close),i get the error EIO on close() and the
> streamer doesn't rewind the tape :
>
> $ dd if=/dev/zero of=/dev/nst0 bs=4096 count=1
> works fine, no error
>
> $ strace dd if=/dev/zero of=/dev/st0 bs=4096 count=1
> dd write the block, and failed when it close /dev/st0 :
> ...
> close(0) = 0
> open("/dev/zero", O_RDONLY|O_LARGEFILE) = 0
> close(1) = 0
> open("/dev/st0", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 1
> rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGINT, {0x80493b0, [], SA_RESTORER, 0x40048988}, NULL, 8) = 0
> rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGQUIT, {0x80493b0, [], SA_RESTORER, 0x40048988}, NULL, 8)
> = 0
> rt_sigaction(SIGPIPE, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGPIPE, {0x80493b0, [], SA_RESTORER, 0x40048988}, NULL, 8)
> = 0
> rt_sigaction(SIGUSR1, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGUSR1, {0x8049410, [], SA_RESTORER, 0x40048988}, NULL, 8)
> = 0
> brk(0) = 0x8051000
> brk(0x8053000) = 0x8053000
> read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0"...,
> 4096) = 4096
> write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0"...,
> 4096) = 4096
> write(2, "1+0 records in\n", 151+0 records in
> ) = 15
> write(2, "1+0 records out\n", 161+0 records out
> ) = 16
> close(0) = 0
> close(1) = -1 EIO (Input/output error)
> write(2, "dd: ", 4dd: ) = 4
> write(2, "closing output file `/dev/st0\'", 30closing output file
> `/dev/st0') = 30
> write(2, ": Input/output error", 20: Input/output error) = 20
>
>
> There is no errors from kernel.
>
> To rewind the tape I must use "mt -f /dev/nst0 rewind".
> "mt -f /dev/st0 status" also works fine, the streamer rewinds the tape.
>
> $ uname -a
> Linux darkstar 2.4.22 #4 Thu Oct 30 22:11:45 CET 2003 i686 unknown
> unknown GNU/Linux
> $ cat /proc/scsi
> cat: /proc/scsi: Is a directory
> $ cat /proc/scsi/scsi
> Attached devices:
> Host: scsi0 Channel: 00 Id: 04 Lun: 00
> Vendor: EXABYTE Model: EXB-8200 Rev: 2618
> Type: Sequential-Access ANSI SCSI revision: 01
> $ cat /proc/scsi/tmscsim/0
> Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f 2000-12-20
> SCSI Host Nr 0, DC390 Adapter Nr 0
> IOPortBase 0xe000, IRQ 10
> MaxID 7, MaxLUN 1, AdapterID 7, SelTimeout 250 ms, DelayReset 1 s
> TagMaxNum 32, Status 0x00, ACBFlag 0x00, GlitchEater 24 ns
> Statistics: Cmnds 4695, Cmnds not sent directly 0, Out of SRB conds 0
> Lost arbitrations 0, Sel. connected 0, Connected: No
> Nr of attached devices: 1, Nr of DCBs: 1
> Map of attached LUNs: 00 00 00 00 01 00 00 00
> Idx ID LUN Prty Sync DsCn SndS TagQ NegoPeriod SyncSpeed SyncOffs MaxCmd
> 00 04 00 Yes No Yes No No (100 ns) 01
> Commands in Queues: Query: 0:
>
> Any ideas ?
> |