Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #158530 > unrolled thread

KDE file copy to usb device without file cache

Started bySerkan KURT <ssserkkk@yahoo.com>
First post2015-10-03 01:10 +0200
Last post2015-10-03 11:10 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  KDE file copy to usb device without file cache Serkan KURT <ssserkkk@yahoo.com> - 2015-10-03 01:10 +0200
    Re: KDE file copy to usb device without file cache "Thomas Schmitt" <scdbackup@gmx.net> - 2015-10-03 08:50 +0200
      Yan: KDE file copy to usb device without file cache Serkan KURT <ssserkkk@yahoo.com> - 2015-10-03 09:40 +0200
        Re: KDE file copy to usb device without file cache "Thomas Schmitt" <scdbackup@gmx.net> - 2015-10-03 10:40 +0200
          Re: KDE file copy to usb device without file cache Stuart Longland <stuartl@longlandclan.id.au> - 2015-10-03 15:20 +0200
    Re: KDE file copy to usb device without file cache Tony van der Hoff <tony@vanderhoff.org> - 2015-10-03 11:10 +0200

#158530 — KDE file copy to usb device without file cache

FromSerkan KURT <ssserkkk@yahoo.com>
Date2015-10-03 01:10 +0200
SubjectKDE file copy to usb device without file cache
Message-ID<qfhCG-P8-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

How can i a file copy to usb device without file cache? 
KDE notifier shows copy completed but actually copy process does not finished. 

How can I solve it?
Debian Jessie amd64, KDE.

[toc] | [next] | [standalone]


#158534

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2015-10-03 08:50 +0200
Message-ID<qfoNQ-2uQ-3@gated-at.bofh.it>
In reply to#158530
Hi,

Serkan KURT wrote:
> How can i a file copy to usb device without file cache?
> KDE notifier shows copy completed but actually copy process does not
> finished.

After the GUI programs reported success, execute command "sync"
in a shell and wait until it is done.


If you really want to write unbuffered:
There is an i/o mode named "Direct I/O", which is not well-deemed
by the kernel developers. Your mileage may vary.
Program "dd" has an option "oflag=direct".
C function open(2) has flag O_DIRECT. 


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#158535 — Yan: KDE file copy to usb device without file cache

FromSerkan KURT <ssserkkk@yahoo.com>
Date2015-10-03 09:40 +0200
SubjectYan: KDE file copy to usb device without file cache
Message-ID<qfpAd-3DX-3@gated-at.bofh.it>
In reply to#158534

[Multipart message — attachments visible in raw view] — view raw

Thank you Thomas. I use sync but how can i this with GUI for newbie users? Because it creates problems for these users.
I tried UDEV rules as follows but i can't.
ACTION=="add",KERNEL=="sd[a-z][0-9]", RUN+="su -l $USER -c '/usr/bin/pmount --sync --umask 000 %k'"
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="su -l $USER -c '/usr/bin/pumount %k'"
Debian Jessie, KDE
 


     3 Ekim 2015 9:42 Cumartesi tarihinde Thomas Schmitt <scdbackup@gmx.net> şöyle yazdı:
   

 Hi,

Serkan KURT wrote:
> How can i a file copy to usb device without file cache?
> KDE notifier shows copy completed but actually copy process does not
> finished.

After the GUI programs reported success, execute command "sync"
in a shell and wait until it is done.


If you really want to write unbuffered:
There is an i/o mode named "Direct I/O", which is not well-deemed
by the kernel developers. Your mileage may vary.
Program "dd" has an option "oflag=direct".
C function open(2) has flag O_DIRECT. 


Have a nice day :)

Thomas



  

[toc] | [prev] | [next] | [standalone]


#158537

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2015-10-03 10:40 +0200
Message-ID<qfqwh-4YI-1@gated-at.bofh.it>
In reply to#158535
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

[toc] | [prev] | [next] | [standalone]


#158539

FromStuart Longland <stuartl@longlandclan.id.au>
Date2015-10-03 15:20 +0200
Message-ID<qfuTf-2Sn-3@gated-at.bofh.it>
In reply to#158537

[Multipart message — attachments visible in raw view] — view raw

On 03/10/15 18:31, Thomas Schmitt wrote:
> 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.

I would concur here… yanking a removable storage device just after the
host has written to it without first informing the computer that it's
about to lose said device is just asking for it.

Macintosh computers required you to "eject" the media via the OS,
sometimes achieved by dragging the icon for the mounted media to the
"trash".

Windows computers (modern ones) have a system tray icon for "safely
removing" media.

Under KDE, pretty sure removable devices have an "unmount" option when
you right-click on them.
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

[toc] | [prev] | [next] | [standalone]


#158538

FromTony van der Hoff <tony@vanderhoff.org>
Date2015-10-03 11:10 +0200
Message-ID<qfqZj-5LI-7@gated-at.bofh.it>
In reply to#158530
On 03/10/15 00:02, Serkan KURT wrote:
> How can i a file copy to usb device without file cache?
> KDE notifier shows copy completed but actually copy process does not
> finished.
> 
> 
> How can I solve it?
> 
> Debian Jessie amd64, KDE.

In KDE click on the USB icon in the task bar, and then click on the
"safely remove" (uparrow) before removing USB device.

You should get into the habit of doing this each time you remove a USB
device.

-- 
Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web