[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to flush cache of certain disk?



>> When I unplug stick, udev unmounts it from mountpoint. Pay attention
>> to moment of unmount - it happens *after* unplugging, so no cache can
>> be flushed as far as device is already disconnected.
>>
>> I though about running umount /mnt/sd[a-z] before unplugging, but then
>> decided to ask for a better way. If I won't find it, umount will be
>> the solution. So, any other options?
>
> I never do that way. I always first "umount" the device and then, I
> remove the stick, but not the reverse. Removable media has to be done
> that way, to prevent data loss or flash drive damage, or that is what
> manufacturers say :-?

Of course, "umount, then remove" is the normal way to remove USB stick
(and any other storage). But as far as main idea of automounting is
"easy (un)plug" (in my opinion at least), we have little weird but
working principle "sync, then unplug, and udev will carry out
everything else". As I already said, it's really weirds, but it works.

But all you said made me hard thinking about the way I mount and
unmount my removable media. Maybe I should forget about sync and use
'umount /mnt/sd[a-z]' instead, or even write little script which will
ask me which device I want to unmount… Dunno. But thanks for sharing
your thoughts with me!

P.S. Camaleón, please forgive me for sending previous mail directly to
you, not to the list. I think it's time to drop GMail web interface
and switch back to local email client…

With best regards,
Alexander Batischev


Reply to: