From zach@gaffaneys.com  Fri Aug 29 00:27:27 1997
Received: from murkwood.gaffaneys.com (dialup3.gaffaneys.com [208.155.161.53])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA17131
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Aug 1997 00:27:25 -0700 (PDT)
Received: (from zach@localhost)
	by murkwood.gaffaneys.com (8.8.7/8.8.6) id CAA10903;
	Fri, 29 Aug 1997 02:27:16 -0500 (CDT)
Message-Id: <199708290727.CAA10903@murkwood.gaffaneys.com>
Date: Fri, 29 Aug 1997 02:27:16 -0500 (CDT)
From: Zach Heilig <zach@gaffaneys.com>
Reply-To: zach@gaffaneys.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: No way to unmount a floppy that goes bad while mounted.
X-Send-Pr-Version: 3.2

>Number:         4413
>Category:       kern
>Synopsis:       No way to unmount a floppy that goes bad while mounted.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 29 00:30:01 PDT 1997
>Closed-Date:    Mon May 15 06:34:04 GMT 2006
>Last-Modified:  Mon May 15 06:34:04 GMT 2006
>Originator:     Zach Heilig
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
>Environment:

	

>Description:

I had a bsd formatted floppy mounted in /fd0 that went bad while it was in the
drive.  When I went to unmount it, I got these errors on the console:

$ umount /dev/fd0
fd0c: hard error reading fsbn 56 of 56-63 (ST0 44<abnrml,top_head> ST1 
      4<sec_not_fnd> ST2 10<wrong_cyl> cyl 1 hd 1 sec 3)
fd0c: hard error reading fsbn 56 of 56-63 (ST0 44<abnrml,top_head> ST1
      4<sec_not_fnd> ST2 10<wrong_cyl> cyl 1 hd 1 sec 3)
umount: /dev/fd0: Invalid argument
$ mount
/dev/sd0a on / (asynchronous, local)
/dev/sd0s1f on /usr (asynchronous, local, nodev)
/dev/sd1s1e on /home (asynchronous, local, nodev, nosuid)
/dev/sd0s1e on /var (asynchronous, local, nodev, nosuid)
procfs on /proc (local)
/dev/fd0 on /fd0 (asynchronous, local)

	

>How-To-Repeat:

I guess you would just have to wait for a floppy to go bad while it is
mounted.
	

>Fix:

I umounted it by puting a different write-protected floppy in the drive
and running umount.

	

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, zach@gaffaneys.com
Cc:  Subject: Re: kern/4413: No way to unmount a floppy that goes bad while mounted.
Date: Sat, 30 Aug 1997 11:05:12 +1000

 >>Description:
 >
 >I had a bsd formatted floppy mounted in /fd0 that went bad while it was in the
 >drive.  When I went to unmount it, I got these errors on the console:
 >
 >$ umount /dev/fd0
 >fd0c: hard error reading fsbn 56 of 56-63 (ST0 44<abnrml,top_head> ST1 
 >      4<sec_not_fnd> ST2 10<wrong_cyl> cyl 1 hd 1 sec 3)
 >fd0c: hard error reading fsbn 56 of 56-63 (ST0 44<abnrml,top_head> ST1
 >      4<sec_not_fnd> ST2 10<wrong_cyl> cyl 1 hd 1 sec 3)
 >umount: /dev/fd0: Invalid argument
 
 This is a new bug in -current.  In 2.2, errors for the superblock update
 in ffs_unmount() are ignored.  The fussier checking came from Lite2.
 Other I/O errors in ffs_umount() are ignored in all versions.  I/O errors
 for the superblock update in ffs_mount() are ignored even in -current.
 
 Bruce

From: Zach Heilig <zach@gaffaneys.com>
To: Bruce Evans <bde@zeta.org.au>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/4413: No way to unmount a floppy that goes bad while mounted.
Date: Sat, 30 Aug 1997 06:01:05 -0500

 On Sat, Aug 30, 1997 at 11:05:12AM +1000, Bruce Evans wrote:
 > This is a new bug in -current.  In 2.2, errors for the superblock update
 > in ffs_unmount() are ignored.  The fussier checking came from Lite2.
 > Other I/O errors in ffs_umount() are ignored in all versions.  I/O errors
 > for the superblock update in ffs_mount() are ignored even in -current.
 
 > Bruce
 
 Are you sure this only affects -current?  This is what uname on my system
 puts out (broken up to fit 80 columns):
 
 FreeBSD murkwood.gaffaneys.com 2.2-STABLE
 FreeBSD 2.2-STABLE #0: Mon Aug 25 03:01:54 CDT 1997
 zach@murkwood.gaffaneys.com:/usr/src/sys/compile/ZACH  i386
 
 
 This is the system that couldn't unmount the floppy.
 
 -- 
 Zach Heilig (zach@gaffaneys.com) -- Actually it's all quite simple.  A
 technician at JPL messed up, and mixed a couple of frames between different
 films.  The 'missing' engine flames from the apollo 11 LM ended up as the
 'muzzle flashes' on the grassy knoll in the Zapruder film... Chris Stratton

From: Bruce Evans <bde@zeta.org.au>
To: bde@zeta.org.au, zach@gaffaneys.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/4413: No way to unmount a floppy that goes bad while mounted.
Date: Sun, 31 Aug 1997 08:28:26 +1000

 >Are you sure this only affects -current?  This is what uname on my system
 >puts out (broken up to fit 80 columns):
 >
 >FreeBSD murkwood.gaffaneys.com 2.2-STABLE
 >FreeBSD 2.2-STABLE #0: Mon Aug 25 03:01:54 CDT 1997
 >zach@murkwood.gaffaneys.com:/usr/src/sys/compile/ZACH  i386
 >
 >This is the system that couldn't unmount the floppy.
 
 I was sure :-).
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Sun Mar 22 22:30:43 PST 1998 
State-Changed-Why:  
You should have tried ``umount -f''. 

Anyways, I trashed a floppy trying to duplicate this, and, while it 
will never mount again, it umounted quite happily (even without -f) 
(although perhaps the floppy was doubly wasted since now that I think 
of it, I didn't actually write anything to the floppy before umounting :-(. 
State-Changed-From-To: closed->open 
State-Changed-By: hoek 
State-Changed-When: Mon Mar 23 00:08:31 PST 1998 
State-Changed-Why:  
Ah.  Originator did try -f but didn't mention that in his pr.  Sorry 
for not bothering to ask you (Zach Heilig -- originator), first.  All 
your examples omitted the -f. 

It would seem I did in fact completely waste my 720KB floppy, then... :-( 

From: Zach Heilig <zach@gaffaneys.com>
To: Tim Vanderhoek <hoek@FreeBSD.ORG>, freebsd-bugs@FreeBSD.ORG
Cc:  Subject: Re: kern/4413
Date: Mon, 23 Mar 1998 01:58:19 -0600

 On Sun, Mar 22, 1998 at 10:33:28PM -0800, Tim Vanderhoek wrote:
 > Synopsis: No way to unmount a floppy that goes bad while mounted.
 
 > State-Changed-From-To: open->closed
 > State-Changed-By: hoek
 > State-Changed-When: Sun Mar 22 22:30:43 PST 1998
 > State-Changed-Why: 
 > You should have tried ``umount -f''.
 
 > Anyways, I trashed a floppy trying to duplicate this, and, while it
 > will never mount again, it umounted quite happily (even without -f)
 > (although perhaps the floppy was doubly wasted since now that I think
 > of it, I didn't actually write anything to the floppy before umounting :-(.
 
 I did try 'umount -f' at that time.  Someone else responded back then, noting
 that the floppy driver returned an error, which the filesystem paid attention
 to (and refused to unmount it).  I'm pretty sure I had dirty buffers when the
 floppy went bad.
 
 However, this may have been fixed near that time (he seemed to know what the
 problem was), but the PR left open.
 
 -- 
 Zach Heilig -- zach@gaffaneys.com
 Real Programs don't use shared text.  Otherwise, how can they use
 functions for scratch space after they are finished calling them?
 

From: Zach Heilig <zach@gaffaneys.com>
To: Tim Vanderhoek <hoek@FreeBSD.ORG>, freebsd-bugs@FreeBSD.ORG
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/4413
Date: Mon, 23 Mar 1998 03:26:04 -0600

 On Mon, Mar 23, 1998 at 12:10:34AM -0800, Tim Vanderhoek wrote:
 > Synopsis: No way to unmount a floppy that goes bad while mounted.
 > 
 > State-Changed-From-To: closed->open
 > State-Changed-By: hoek
 > State-Changed-When: Mon Mar 23 00:08:31 PST 1998
 > State-Changed-Why: 
 > Ah.  Originator did try -f but didn't mention that in his pr.  Sorry
 > for not bothering to ask you (Zach Heilig -- originator), first.  All
 > your examples omitted the -f.
 
 This may have been before I realized you had to cc: freebsd-gnats-submit to
 get stuff into the PR database.  There was more correspondence.
 Unfortunately, the hard drive containing particular mail archive died [with
 the rest of /home :-(] shortly after I replaced my motherboard (the old one
 wouldn't boot from the hard-drive, the reason for using floppies so much), so
 
 > It would seem I did in fact completely waste my 720KB floppy, then... :-(
 
 If you could not reproduce it, it probably really was fixed.  I suppose one
 way to really check would be to mount a floppy (ufs formatted), write to it/
 sync/eject it (do not unmount it yet), put a few pinholes through the section
 where the meta-data sits, and put it back in.  Now try to unmount it.
 
 -- 
 Zach Heilig -- zach@gaffaneys.com
 Real Programs don't use shared text.  Otherwise, how can they use
 functions for scratch space after they are finished calling them?

From: Tim Vanderhoek <ac199@hwcn.org>
To: Zach Heilig <zach@gaffaneys.com>
Cc: freebsd-gnats-submit@FreeBSd.ORG
Subject: Re: kern/4413
Date: Mon, 23 Mar 1998 16:35:52 -0500 (EST)

 On Mon, 23 Mar 1998, Zach Heilig wrote:
 
 > If you could not reproduce it, it probably really was fixed.  I suppose one
 > way to really check would be to mount a floppy (ufs formatted), write to it/
 > sync/eject it (do not unmount it yet), put a few pinholes through the section
 > where the meta-data sits, and put it back in.  Now try to unmount it.
 
 I suppose just mounting the floppy and then physically removing
 it before umounting it is not a valid test.  In your pr you said
 that you had to insert a write-protected floppy...  Did you try
 umount -f'ing with the floppy drive empty?
 
 
 --
  tIM...HOEk
 OPTIMIZATION: the process of using many one-letter variables names
               hoping that the resultant code will run faster.
 
 

From: Zach Heilig <zach@gaffaneys.com>
To: ac199@hwcn.org
Cc: freebsd-gnats-submit@FreeBSd.ORG
Subject: Re: kern/4413
Date: Tue, 24 Mar 1998 03:39:22 -0600

 On Mon, Mar 23, 1998 at 04:35:52PM -0500, Tim Vanderhoek wrote:
 > > If you could not reproduce it, it probably really was fixed.  I suppose one
 > > way to really check would be to mount a floppy (ufs formatted), write to it/
 > > sync/eject it (do not unmount it yet), put a few pinholes through the section
 > > where the meta-data sits, and put it back in.  Now try to unmount it.
 
 > I suppose just mounting the floppy and then physically removing
 > it before umounting it is not a valid test.  In your pr you said
 > that you had to insert a write-protected floppy...  Did you try
 > umount -f'ing with the floppy drive empty?
 
 Thats just too obvious and practical of a test... It will never work :-).  I
 thought of that right after I sent this last mail... [why didn't I ever do
 that??].  Unless it's getting some valid looking data from the hosed tracks
 that confused the filesystem, just removing the disk should work.
 
 I'm trying that now and same problem.  umount -f doesn't unmount a
 floppy removed from the drive:
 
 BTW, I'm not entirely sure what 'Old Mount_msdosfs, flags=0' is doing there.
 I get it whenever I mount any filesystem after mounting a dos filesystem.
 
 Script started on Tue Mar 24 03:27:36 1998
 # mount /dev/fd1 /mnt
 Old mount_msdosfs, flags=0
 < removed floppy here .. >
 # umount /mnt
 fd1: Operation timeout
 fd1c: hard error writing fsbn 64 (No status)
 umount: /mnt: Input/output error
 # umount -f /mnt
 fdc0: cmd 4 failed at out byte 1 of 2
 fdc0: Sense Drive Status failed
 fd1c: hard error writing fsbn 64 (No status)
 umount: /mnt: Input/output error
 # umount -f /mnt
 fdc0: cmd 4 failed at out byte 1 of 2
 fdc0: Sense Drive Status failed
 fd1c: hard error writing fsbn 64 (No status)
 umount: /mnt: Input/output error
 # df
 Filesystem           1K-blocks     Used    Avail Capacity  Mounted on
 ...
 /dev/fd1                  1103        0     1015     0%    /mnt
 < replaced floppy here >
 # umount /mnt
 # 
 Script done on Tue Mar 24 03:28:33 1998
 
 This was -current of March 14 (kernel March 12).
 
 -- 
 Zach Heilig -- zach@gaffaneys.com
 Real Programs don't use shared text.  Otherwise, how can they use
 functions for scratch space after they are finished calling them?

From: "First Electronics Service" <firsttv@1sttv.omhcoxmail.com>
To: <freebsd-gnats-submit@FreeBSD.org>, <zach@gaffaneys.com>
Cc:  
Subject: Re: kern/4413: No way to unmount a floppy that goes bad while mounted.
Date: Sat, 21 Dec 2002 12:26:29 -0600

 Try swapping floppies before running "unmount -f".
 

From: Ryan Sommers <ryans@gamersimpact.com>
To: freebsd-gnats-submit@FreeBSD.org, zach@gaffaneys.com
Cc:  
Subject: Re: kern/4413: No way to unmount a floppy that goes bad while mounted.
Date: Mon, 1 Dec 2003 09:34:20 -0600

 I just played around with this on 5.2-BETA and couldn't get a panic. I was 
 always able to 'umount -f' when just umount wouldn't work.
 
 Considering the age,
 I think this PR can be closed.
 -- 
 Ryan "leadZERO" Sommers
 Gamer's Impact President
 ryans@gamersimpact.com
 ICQ: 1019590
 AIM/MSN: leadZERO
 
 -= http://www.gamersimpact.com =-
 
State-Changed-From-To: open->closed 
State-Changed-By: rodrigc 
State-Changed-When: Mon May 15 06:33:25 UTC 2006 
State-Changed-Why:  
Closed, as per recommendation of Ryan Sommers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4413 
>Unformatted:
