Unix Technical Forum

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

This is a discussion on Closing /dev/st0 return EIO error, /dev/nst0 not within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hello, I have a old tape streamer Exabyte EXB-8200. Backup and restore work fine. However, when I use the ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 04:35 PM
Gilles Hamel
 
Posts: n/a
Default Closing /dev/st0 return EIO error, /dev/nst0 not

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 ?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 04:35 PM
Gilles Hamel
 
Posts: n/a
Default 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 ?
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 04:35 PM
Rob Turk
 
Posts: n/a
Default Re: Closing /dev/st0 return EIO error, /dev/nst0 not

"Gilles Hamel" <hamel_g@club-internet.fr> wrote in message
news:3fad1a95$0$6980$7a628cd7@news.club-internet.fr...
> 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/onlin...fm?prod_id=104

Rob


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 04:42 PM
Gilles Hamel
 
Posts: n/a
Default Re: Closing /dev/st0 return EIO error, /dev/nst0 not

GREAT, Problem solved !

Thank you very much.


"Rob Turk" <_wipe_me_r.turk@chello.nl> wrote in message news:<3fad6964$0$18487$e4fe514c@dreader4.news.xs4a ll.nl>...
> "Gilles Hamel" <hamel_g@club-internet.fr> wrote in message
> news:3fad1a95$0$6980$7a628cd7@news.club-internet.fr...
> > 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/onlin...fm?prod_id=104
>
> Rob

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:41 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com