Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2002 10:28:22 +0100
From:      Bob Bishop <rb@gid.co.uk>
To:        Ian Dowse <iedowse@maths.tcd.ie>, "Vladislav V. Zhuk" <admin@dru.dn.ua>
Cc:        stable@FreeBSD.ORG
Subject:   Re: very old bug 
Message-ID:  <4.3.2.7.2.20020411100657.00c4f970@gid.co.uk>
In-Reply-To: <200204110155.aa50726@salmon.maths.tcd.ie>
References:  <Your message of "Wed, 10 Apr 2002 14:06:05 %2B0300." <20020410110605.GJ82820@dru.dn.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

At 01:55 11/04/02 +0100, Ian Dowse wrote:
>In message <20020410110605.GJ82820@dru.dn.ua>, "Vladislav V. Zhuk" writes:
> >After attempt to write data to write-protected floppy
> >(or diskette with bad blocks) FreeBSD die.
> >
> >It's VERY VERY annoying...  :(
> >
> >Who can fix this bug??
>
>Unfortunately, this is believed to be very hard to fix, so the best
>recommendation is that you avoid mounting filesystems from floppy
>disks. [etc]

IMHO, panic or hang is an unacceptable response to a media bad block 
(except possibly in the case of the root filesystem).

The write-protect thing is hard but not impossible. The problem is that 
most floppy drives will only tell you about write-protect in response to a 
write attempt, by which time (in the case of a mount) it's a bit late. On 
our (picoBSD-powered) routers, we use a script that checks the write 
protection before attempting to mount the floppy.

The test is to read block 0 off the raw flop and attempt to write it back. 
This will trip the write-protect check reliably. I entertain the theory 
that the floppy driver could do this test on open for write.

To make it harder to shoot oneself in the foot, use an fstab entry like:

/dev/fd0a       /flop   <type>  ro,noauto       0       0

and mount /flop, followed by mount -uw if you really want to write.


--
Bob Bishop		    +44 (0)118 977 4017
rb@gid.co.uk		fax +44 (0)118 989 4254


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.3.2.7.2.20020411100657.00c4f970>