From owner-freebsd-questions Fri Oct 15 14: 7:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from athserv.otenet.gr (athserv.otenet.gr [195.170.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 3BEBD15431 for ; Fri, 15 Oct 1999 14:07:08 -0700 (PDT) (envelope-from keramida@diogenis.ceid.upatras.gr) Received: from hades.hell.gr (patr364-a100.otenet.gr [195.167.112.196]) by athserv.otenet.gr (8.9.3/8.9.3) with SMTP id AAA01640 for ; Sat, 16 Oct 1999 00:07:14 +0300 (EET DST) Received: (qmail 384 invoked by uid 1001); 15 Oct 1999 14:00:28 -0000 Date: Fri, 15 Oct 1999 17:00:28 +0300 From: d e a t h To: "Ronald 'Ko' Klop" Cc: freebsd-questions@freebsd.org Subject: Re: ro floppy mounted rw crashes system Message-ID: <19991015170028.A304@hades.hell.gr> Reply-To: keramida@ceid.upatras.gr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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, "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