:: Re: [DNG] I've got the automounter …
Top Page
Delete this message
Reply to this message
Author: Steve Litt
Date:  
To: dng
Subject: Re: [DNG] I've got the automounter running
On Mon, 28 Dec 2015 12:20:01 +0100
Didier Kryn <kryn@???> wrote:


>      Congratulations, Steve.

>
>      There remains a fundamental problem with automatic mount/umount. 
> While automounting is safe, auto-unmounting is not if it is triggered
> by device removal. Unmounting must be done *before* removing the
> device if anything has been written to it, otherwise data is lost and
> the filesystem may be corrupted; also running applications with open
> files in the mountpoint can broken.

>
>      Didier


Hi Didier,

:-)

I've given that quite a bit of thought. My thought pattern was like
this: If you yank it out without unmounting, it's already as corrupt as
it's going to get, so you might as well clean up.

To the extent that the preceding sentence is *not* true, I could make
auto-unmounting on removal an option, although not in this version.

I did a test. I created hello.txt, put "hello world" in it, saved it,
and yanked out the thumb three seconds later. Of course the
whole /media/sdd1 tree vanished. When I plugged in the thumb again,
hello.txt contained exactly what I'd typed in it. Now of course, this
is an anecdote, not a mathematical proof or a statistical study, but it
does point to the possibility that sometimes all your stuff gets
written to the thumb and everything's OK when you yank.

Connected to the point you make is eventually I'll have a second app
that will list thumbs by id or dev or path or label, enable you to
assign an action (like unmount) to one of them. This will make it much
less likely that a person will yank before unmounting.

Thanks,

SteveT

Steve Litt 
November 2015 featured book: Troubleshooting Techniques
     of the Successful Technologist
http://www.troubleshooters.com/techniques