Bug 72119

Summary: Detaching USB Memory Stick w/o umount causes zombie devfs node
Product: Base System Reporter: fireball
Component: kernAssignee: freebsd-usb (Nobody) <usb>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.3-BETA4   
Hardware: Any   
OS: Any   

Description fireball 2004-09-27 01:20:19 UTC
      Removing the USB Stick without a prior umount of the node, will 
leave the device node, e.g. /dev/da0s1 and /dev/da0 (both affected) 
unusable for any further mounts; i.e. they had to be deleted and recreated
manually using mknod. I discovered this after I prepared a devd.conf piece
of script for devd, which does an automatic mount after umass0 connects 
and a umount -f on the mountpoint after I remove the device.

Fix: 

A recommended workaround, of course, is to umount any device before removing it. 

But as time progresses and other modern operating systems allow removal of
similar devices without problems, I hope FreeBSD goes that way too, sooner
or later. At least it shouldn't be a problem to re-attach the device again.
How-To-Repeat:       Attach USB Stick, mount it to a mountpoint e.g. mount -t msdosfs /dev/da0s1 /mnt, remove USB stick, umount -f /mnt, then re-attach usb stick, try to mount -t msdosfs /dev/da0s1 /mnt again -> device not found.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2004-11-04 07:12:46 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-usb

Reassign to appropriate mailing list.
Comment 2 iedowse freebsd_committer freebsd_triage 2005-03-23 02:53:56 UTC
State Changed
From-To: open->closed


Duplicate of kern/46176
Comment 3 fireball 2005-03-23 22:44:33 UTC
I don't understand how this is supposed to be a duplicate. The issue
might be similar but in my case, the OS does NOT crash.

My issue lies within the devfs, where a zombie device node remains,
which has to be deleted and then recreated, while in the other case it's
a straight kernel panic.

But you might have deeper insights into the issue within...

-- 
Jonas Nagel <fireball@zerouptime.ch>
Comment 4 Julian Elischer 2005-03-24 00:47:18 UTC
Jonas Nagel wrote:

>I don't understand how this is supposed to be a duplicate. The issue
>might be similar but in my case, the OS does NOT crash.
>
>My issue lies within the devfs, where a zombie device node remains,
>which has to be deleted and then recreated, while in the other case it's
>a straight kernel panic.
>
>But you might have deeper insights into the issue within...
>  
>
I believe that the device node continues to exist until the dead mount 
is forcibly unmounted..

probably one for Poul-Henning  (CC'd )
Comment 5 fireball 2005-03-24 09:50:44 UTC
> I believe that the device node continues to exist until the dead mount 
> is forcibly unmounted..

You believe wrongly. While it is unfortunate that my original problem
report has no line breaks, I did write that a umount -f on the device
node after pulling the USB plug did NOT help.

I HAD to delete and manually recreate the device node, before I could
mount the USB stick again. This is the main issue.

-- 
Jonas Nagel <fireball@zerouptime.ch>