Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2007 13:09:37 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Kris Moore <kris@pcbsd.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: removing external usb hdd without unmounting causes reboot?
Message-ID:  <20070718200937.GA15560@eos.sc1.parodius.com>
In-Reply-To: <469E61DB.4000402@pcbsd.com>
References:  <200707181541.l6IFf4ht051775@lurza.secnetix.de> <20070718170559.GA11915@eos.sc1.parodius.com> <20070718173406.GA16748@soaustin.net> <200707181942.45045.idiotbg@gmail.com> <469E61DB.4000402@pcbsd.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 18, 2007 at 11:54:19AM -0700, Kris Moore wrote:
> That being said, I think it would be a good idea to at least have the
> kernel / HAL or some process maybe warn the user that they should
> unmount the USB disk first, to prevent data loss at minimum. But I think
> this can be improved, so you don't have to deal with an entire system
> panic :P When that happens you gotta reboot, fsck, and run the risk of
> something really being corrupted on the drive :(

So there's two issues here:

1) Kernel panics when a device (regardless of type (USB, SATA, etc.))
is removed from the system with filesystems mounted,

2) Concern over data loss when device is removed.

As I mentioned earlier in the thread, Windows addresses #2 by marking
all filesystems on USB storage devices (thumb drives, HDDs, etc.) as
synchronous (e.g. mount -o sync).  The impact is slow I/O, but it's
safe.

It seems like we'd be able to implement such a transparent "feature"
into the subsystem where filesystems mounted from USB devices would use
synchronous I/O (mount -o sync).  I don't know how this would be coded,
since there would have to be some way to figure out a physical device
type (USB mass storage devices show up as /dev/daXXX).

Providing an override option for those who know what they're doing,
(umount /mnt then physically remove device) would be nice too.

This would alleviate concerns over data loss, would it not?

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |




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