USB memory stick hotswap problems

Lucas James Lucas.James at LDJcs.Com.Au
Sat Sep 25 18:15:32 PDT 2004

On Sun, 26 Sep 2004 10:29 am, Jeremy Chadwick wrote:
> Can't usbd (or better yet, usbd.conf) be modified or changed in some way
> to automatically handle the unmounting of any existing filesystems that
> match the device which is mounted?

that won't work because usbd only gets the notification of something being 
unplugged *after* the fact, and it's too late to do unmounting then.

And it can't be modified, because the kernel has no idea when the user is 
going to yank out the cable.

> Seems like we're eventually going to need this to make hot-swappable USB
> devices more friendly.  I understand why you must unmount a device
> before SCSI CAM gets disconnected from it, but it just seems that this
> should be a job for usbd.

the only way you can ensure data integrity on user-removable devices is to 
mount them with -o sync.

We should be telling the kernel at some point that this is a removable device, 
and not have the kernel complain if we umount it when the device has already 
disappeared (assuming that we have mounted it with -o sync).

Lucas James
The only possible interpretation of any research whatever in the
`social sciences' is: some do, some don't.
  -- Ernest Rutherford
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list