You are not logged in.

#1 2012-01-10 16:23:13

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Issues copying data to USB key

Since I installed arch, I have a peculiar problem with copying data onto USB keys (not USB HDDs, though).

Even if the file is large (1-4GB), the copying progress  bar completes in just few seconds, but if I unplug the USB then, the data will not copy.  I need to keep the USB plugged in for how long I might THINK it needs to complete it, and then hope it was enough. Otherwise, the data is not be copied, or is corrupted.

The same issue occurs when using PCmanFM, which is my main file manager, and Nautilus.

Offline

#2 2012-01-10 16:40:33

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Issues copying data to USB key

I don't know all the details, but I suspect keys are being mounted as async, hdds as synchronous.  Or something like that.

What I am certain of is that you can enter sync in the terminal and once you get the prompt back, you can be certain that it's ready to unmount and unplug.  I think it forces all buffered disk operations to flush to disk.

...Or something like that.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-01-10 16:53:39

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

Is there a way to get USB flash memory to mount properly? I remember not having such issues on Ubuntu 2 years ago.

Offline

#4 2012-01-10 17:21:37

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Issues copying data to USB key

In retrospect I should have been more cautious about the async/synchronous stuff.  That was just something I 'overheard' on some USB related thread at some point.  I found some threads by searching 'flash synchronous' but the related ones are pretty old.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2012-01-10 17:58:02

apaige
Member
Registered: 2008-06-15
Posts: 96

Re: Issues copying data to USB key

Do you properly unmount the drive before unplugging it? That should sync all data to the drive.

Offline

#6 2012-01-10 18:52:31

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

I click 'unmount' but it freezes the file manager for the duration of the actual copying.
What I want is to see the real progress of copying, and not meaningless progress bar reaching 100% in 3-4 second on files of several GBs.

Offline

#7 2012-01-10 18:58:44

piratebill
Member
From: Sol System
Registered: 2011-10-20
Posts: 133

Re: Issues copying data to USB key

I have the same problem, and it drives me insane.  What desktop manager are you using?  Maybe it has something to do with it?

Offline

#8 2012-01-10 19:00:12

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

I am using gutted XFCE with PCmanFM handling desktop and file operations, but the same is true for Nautilus.

Offline

#9 2012-01-10 19:21:46

piratebill
Member
From: Sol System
Registered: 2011-10-20
Posts: 133

Re: Issues copying data to USB key

The only thing I could find after a quick google search were these posts about using sync. In regards to alphaniner's last post, these are all recent.

http://www.linuxquestions.org/questions … ng-920266/
http://crunchbanglinux.org/forums/topic … sb-sticks/

Offline

#10 2012-01-11 03:44:29

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Issues copying data to USB key

If you mount your USB drive with the sync option, you will get the "real progress of copying". Two way to accomplish this:

1. Mount your USB manually from the terminal (or add it to fstab)
2. Use devmon to mount your USB drive(s); it has a --sync | -s flag.

Offline

#11 2012-01-11 15:10:36

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

anonymous_user wrote:

2. Use devmon to mount your USB drive(s); it has a --sync | -s flag.

Is there a way to run devmon daemon (?) automatically with sync option so it mounts all future usb plugins properly, or does it have to be done manually each time?

Offline

#12 2012-01-11 15:50:17

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Issues copying data to USB key

Use the flush option. And no, "sync" is not used with hard drives - it would ruin performance, by disabling buffering.

"flush" is a reasonable compromise for buffering.

Offline

#13 2012-01-11 16:41:09

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Issues copying data to USB key

Lockheed wrote:
anonymous_user wrote:

2. Use devmon to mount your USB drive(s); it has a --sync | -s flag.

Is there a way to run devmon daemon (?) automatically with sync option so it mounts all future usb plugins properly, or does it have to be done manually each time?

Just specify "devmon --sync" in your DE/WM's startup file.

Offline

#14 2012-01-11 17:50:42

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

Would that not conflict with the current way devices are being mounted?
Also, would this affect internal HDD, too? I read --sync causes slower transfers.

Offline

#15 2012-01-11 17:57:55

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Issues copying data to USB key

If you just want the sync option for a specific device, you could try the --mount DEVICE flag. I never tried using devmon to only mount a specific device though. Also it does not affect internal drives unless you use the --internal flag

Offline

#16 2012-01-11 18:08:44

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

But this brings us back to manual mounting. What I would like is to have interhal HDDs and USB HDDs running at full speed, while USB flash drives mounted in a proper way.

Offline

#17 2012-01-11 18:40:00

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: Issues copying data to USB key

Scratch that. I did some more testing, and running devmon --sync does not actually change a thing.

Offline

#18 2012-09-11 02:33:33

afulm
Member
Registered: 2012-01-31
Posts: 20

Re: Issues copying data to USB key

Any solution to this problem? I have it to.

Offline

#19 2012-09-11 10:00:00

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Issues copying data to USB key

Like someone else already said, after the progress bar goes away, run:

$ sync

A dirty hack would be to copy a file upward of 100 MB (like an .avi file or something) after you copy whatever you want copied 100% intact. Then remove this 100MB+ file. This way it makes sure that whatever was copied last, was copied completely.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#20 2012-09-12 14:38:42

afulm
Member
Registered: 2012-01-31
Posts: 20

Re: Issues copying data to USB key

I guess sync kind of works, though had hoped for a more satifying solution.

Offline

Board footer

Powered by FluxBB