Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2007 16:50:35 +0800
From:      Julius Huang <juliushuang@gmail.com>
To:        Momchil Ivanov <idiotbg@gmail.com>
Cc:        "\[LoN\]Kamikaze" <LoN_Kamikaze@gmx.de>, freebsd-stable@freebsd.org, Norberto Meijome <freebsd@meijome.net>, olli@lurza.secnetix.de, josh@tcbug.org
Subject:   Re: removing external usb hdd without unmounting causes reboot?
Message-ID:  <ECCDB338-2C54-468C-B3FC-943AFBAD0ADB@gmail.com>
In-Reply-To: <200707190943.55428.idiotbg@gmail.com>
References:  <200707181703.07480.idiotbg@gmail.com> <20070719130252.6880b967@localhost> <469F101C.5060906@gmx.de> <200707190943.55428.idiotbg@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu 19 Jul 2007, at 15:43, Momchil Ivanov wrote:

> On Thursday 19 July 2007 09:17:48 [LoN]Kamikaze wrote:
>> Norberto Meijome wrote:
>>> On Wed, 18 Jul 2007 17:41:04 +0200 (CEST)
>>>
>>> Oliver Fromme <olli@lurza.secnetix.de> wrote:
>>>> another work-around
>>>> is to use the auto mounter daemon (amd(8)).  It umounts
>>>> file systems automatically that are not in use.
>>>> Another nice feature of amd(8) is that you don't have
>>>> to mount the file system either -- Simply plug the USB
>>>> stick in, then access it, and amd(8) will automatically
>>>> mount it for you.
>>>
>>> Now, something I dont understand  -  amd runs
>>> at user level, and it mounts filesystems, and nothing dies when the
>>> filesystems go away (other than the obvious cases for the  
>>> applications
>>> trying to write to the FS in question). Doesn't amd , at some  
>>> point ,
>>> have to tell the kernel 'please mount this filesystem' here or  
>>> there?
>>> Isn't the kernel STILL involved in all this? and why doesnt the  
>>> kernel
>>> panic when the FS goes away?
>>
>> The trick is that amd unmounts the device after a couple of  
>> seconds, so
>> when someone accidentally removes a usb drive, it doesn't really  
>> matter.
>> Amd will simply fail to mount it on the next access. If you remove  
>> the
>> device during or shortly after accessing it, it still will panic the
>> system.
>
> What is then the reason for the kernel not being able to unmount a  
> filesystem
> whose provider is no longer present? What in the process of  
> unmounting denies
> unmounting a filesystem whose provider is no longer available? Why  
> can the
> kernel not just inform all programs that files have to be closed  
> and are
> unaccessible any more, then consider the fs as unmounted and remove  
> any bits
> of it left in the VM. Why can kernel not just ignore interruped/ 
> pending
> writes to that fs, drop the data, return an error to the program that
> initiated the write and just go on.
>
> -- 
> PGP KeyID: 0x3118168B
> Keyserver: pgp.mit.edu
> Key fingerprint BB50 2983 0714 36DC D02E  158A E03D 56DA 3118 168B
>



Hi,

How Mac OS X handle this?  Method, tricks, code, etc...

Does Linux reboot when this happen?

The kernel is different between OS X, Linux and FBSD.

Why FBSD handle this by reboot?  Does reboot clean up everything?

BTW,
I hardly ever put a USB Disk on our FBSD Servers,
but never had problem disconnect USB/Firewire Disk on my Powerbook.

Julius






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ECCDB338-2C54-468C-B3FC-943AFBAD0ADB>