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

Re: KDE file copy to usb device without file cache



Hi,

Serkan KURT wrote:
> I use sync but how can i this with GUI for newbie users?

Find or make a GUI tool which uses fsync(2) or fflush(3) on
the output file before closing it.

But probably that's not the decisive point here.

If it is about a mounted filesystem, then your question should
rather be how to properly unmount the device before removing it.
Unmounting is supposed to flush pending filesystem data.


> ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="su -l $USER -c '/usr/bin/pumount %k'"

If this is triggered by hot unplugging of the USB device
then pumount(1) of course cannot flush. It can only remove
the debris in the running system.

Somehow the user has to announce the intention to pull the
plug. (Optical drives with tray motor can report their eject
button being pressed and then wait for the system to send an
eject command. But laptop drives normally have manual trays.)


> ACTION=="add",KERNEL=="sd[a-z][0-9]", RUN+="su -l $USER '/usr/bin/pmount --sync --umask 000 %k'"

Are you sure that this action is really performed and
not later overridden by another pmount run ?

Does "pmount --sync" yield the desired behavior if you
execute it manually (after pumount of the automatic mount) ?

The description of option --sync does not look appealing.
Decent performance can be expected only if you write a small
number of files (which may be large in size).
man 8 mount warns:
  sync   All I/O to the filesystem should be done synchronously.  In  the
         case  of  media with a limited number of write cycles (e.g. some
         flash drives), sync may cause life-cycle shortening.

But if the kids shall be able to pull the plug at any time ...


Have a nice day :)

Thomas


Reply to: