Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Oct 1999 17:00:28 +0300
From:      d e a t h <charon@hades.hell.gr>
To:        "Ronald 'Ko' Klop" <ronald@node11a94.a2000.nl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ro floppy mounted rw crashes system
Message-ID:  <19991015170028.A304@hades.hell.gr>
In-Reply-To: <Pine.BSF.4.05.9910150549140.669-100000@dlanor.evertsen.nl>
References:  <Pine.BSF.4.05.9910150549140.669-100000@dlanor.evertsen.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 15, 1999 at 05:55:47AM +0200, Ronald 'Ko' Klop wrote:
> Hello,
> 
> If I mount a ro dos-floppy, why doesn't mount_msdos complain
> about it, if I try to mount it rw?

While experimenting, I managed to hang my 3.3R too, but there is one more
interesting thing that I found out.

I `newfs' an empty floppy.  Then remove it from the drive, and write-protect
it.  I mount the disk as read-write with

	# mount /dev/fd0 /mnt

and I try to create a file on the disk, say with a command like:

	# echo > /mnt/test_file

Then, although the command fails with an 'Input/output error' the kernel will
keep retrying to write the data on disk, effectively making it impossible to
umount the disk, without some dirty trick.  And it will keep retrying every
few seconds or so.  Trying to `umount' the disk will try to sync before the
unmounting takes place, and it fails too.  The only way out is to remove the
disk from the drive, write-unprotect it, put it back in and letting the kernel
do it's job of writing to the disk.

What the kernel does, i.e. try to put the data on disk, and keep retrying, is
probably the Right Thing(tm) since that is the job of the kernel, to make sure
it serves the requests of other programs.  All this would probably work fine,
if mount could realize somehow that the floppy is write protected and avoid
telling the kernel to mount it read-write.  Perhaps, the kernel could try and
detect if the disk is protected and return an error to the mount() call that
the mount program executes.

-- 
Giorgos Keramidas, <keramida@ceid.upatras.gr>
"That field hath eyen, and the wood hath ears." [Geoffrey Chaucer]


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




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