Closing /dev/st0 return EIO error, /dev/nst0 not

Closing /dev/st0 return EIO error, /dev/nst0 not

Post by Gilles Hame » Mon, 10 Nov 2003 00:34:49



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 ?

 
 
 

Closing /dev/st0 return EIO error, /dev/nst0 not

Post by Gilles Hame » Mon, 10 Nov 2003 01:32:21


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


> 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 ?


 
 
 

Closing /dev/st0 return EIO error, /dev/nst0 not

Post by Rob Tur » Mon, 10 Nov 2003 07:08:36



Quote:> 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

Ah, memories from the past... I think your problem may be that the drive
reports 'BUSY' when receiving the rewind, while it's flushing data from it's
memory buffer to tape. Most programs wait a short while and retry the
command upon busy status. Others like dd do not retry and fail.

There's a DIP switch on the MX boards, the second logic board from the back
of the drive. One of the switches is the 'No Busy Enable' switch, which
changes the behaviour of the drive to disconnect and wait for the flush to
complete. I don't remember which one it was (hey, last one I touched was
years ago), but you may want to browse the manuals which you can still
download from our website:
http://www.exabyte.com/support/online/documentation/tp_manuals.cfm?pr...

Rob

 
 
 

Closing /dev/st0 return EIO error, /dev/nst0 not

Post by Gilles Ham » Mon, 17 Nov 2003 07:00:38


GREAT, Problem solved !

Thank you very much.




> > 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

> Ah, memories from the past... I think your problem may be that the drive
> reports 'BUSY' when receiving the rewind, while it's flushing data from it's
> memory buffer to tape. Most programs wait a short while and retry the
> command upon busy status. Others like dd do not retry and fail.

> There's a DIP switch on the MX boards, the second logic board from the back
> of the drive. One of the switches is the 'No Busy Enable' switch, which
> changes the behaviour of the drive to disconnect and wait for the flush to
> complete. I don't remember which one it was (hey, last one I touched was
> years ago), but you may want to browse the manuals which you can still
> download from our website:
> http://www.exabyte.com/support/online/documentation/tp_manuals.cfm?pr...

> Rob

 
 
 

1. /dev/st0 /dev/nst0

Hello, I recently had a HDD crash. But I had fortunally backed everyting
up on tape.

I used KBackup-1.2.4

Now I want to restore things. But I seem to have made by hand a entry
in /dev for st0 and nst0 (I have a Wangtek SCSI tapedrive).

/dev/st0 and /dev/nst0 arent't in my /dev

Who knows how I can make these devices..

I can't read my tapes anymore.

TNX for any help.

Walter

2. Incorrect eth0 settings on boot-reset

3. /bin/tar: /dev/nst0: Warning: Cannot close: Input/output error

4. Maximum filesystem limit in Solaris 2.5.1

5. Changing Tape Drive To Use /dev/nst1 From /dev/nst0

6. Installation Process

7. Use /dev/st0 or /dev/ht0 - which one for a AIT IDE drive?

8. Kdevelop

9. HELP: /dev/hda1 to /dev/st0

10. Printtool not seeing my printer on /dev/lp0, /dev/lp1 or /dev/lp2

11. What is the difference between /dev/sg0, /dev/scd0 /dev/hdd and /dev/cdrom ?

12. /dev/dsp, /dev/audio, /dev/midi., /dev/sndsta

13. tar error: cannot open /dev/nst0