*BSD News Article 73191


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!news.mathworks.com!fu-berlin.de!zrz.TU-Berlin.DE!news.tu-chemnitz.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: HP4020i (CD-R) Usage question (dd input/output error?)
Date: 8 Jul 1996 22:38:46 GMT
Organization: Private BSD site, Dresden
Lines: 53
Message-ID: <4rs2lm$1eu@uriah.heep.sax.de>
References: <franky.836557636@pwood1> <4rjk00$odq@uriah.heep.sax.de>
  <franky.836749507@pwood1>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

franky@pinewood.nl (Frank ten Wolde) wrote:

> >You should also quote the SCSI error message from the console (or from
> >/var/log/messages) here.  This one will lead further.
> 
> No errors on the console/syslog.
> I also noticed (now) that if I dummy write a larger image (257MB) I
> do *not* get the error from 'dd'.
> Could it have to do with the rediculous small file (1.1MB) I try to
> write?

Not that i could think of.

If you have a look into /sys/scsi/worm.c, there's only two occurences
of EIO.  One would always cause an "Oops, not queued" on the console,
the other one is:

	if (!(sc_link->flags & SDEV_MEDIA_LOADED) ||
	    bp->b_blkno * DEV_BSIZE > worm->n_blks * worm->blk_size||
	    (bp->b_bcount % worm->blk_size) != 0) {
		SC_DEBUG(sc_link, SDEV_DB3,
			 ("worm block size / capacity error") );
		bp->b_error = EIO;
		bp->b_flags |= B_ERROR;
		biodone(bp);
		return;
	}

As you can see, the message is hidden inside a debug conditional, so
if you compile your driver with SCSIDEBUG enabled, and increase the
debug level (using scsi(8)), you should see it.

The above snippet should make the possible error conditions rather
obvious:

  . media not loaded,
  . attempt to write beyond end of medium, or
  . illegal block size (2048 for CD-ROM, 2352 for CD-DA).

You should remember that ``dummy write'' means the CD-R drive
*remembers* all your write operations as if they were real; in
particular, they all sum up to the total amount of ``written'' data.
The only safe method to force the drive re-reading the tables from the
(still empty) medium is to unload and reload it again!

Hope this helps,
73!
-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)