You are not logged in.

#1 2012-11-14 18:46:59

LiranV
Member
Registered: 2012-02-27
Posts: 57

USB file transfer too fast?!

Hi,
I'm running arch+gnome shell as DE.
When I connect a USB mass storage device (Flash drive, my phone etc.) to my PC it's auto-mounted.
But when I transfer a "lagre" file lets say 700mb the tranfer is complete in few seconds.
This is strange because my flash drive is slow and should write somthing like 5 mb/s.

this is the output from "mount" command to the flash drive:
/dev/sdd on /run/media/liran/12E8-6571 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

Is this OK? Is there anything I shoul'd change? And if so where I need to make the change?

Thanks ahead guys!

Offline

#2 2012-11-14 19:03:36

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: USB file transfer too fast?!

It's not actually transfered, it is being copied in background. I don't know why this happens on linux, but I got used to it.
LED on the stick (if yours has one) stops blinking when transfer is complete and it's enough for me.
There is a mount flag (flush I think), which enables correct progress display, but then file operations on stick are painfuly slow.
This is why you should always unmount stick before removal.

Offline

#3 2012-11-14 19:28:47

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: USB file transfer too fast?!

As far as I know this is because of the delayed allocation. It means, that the data is put into the RAM first and being actually written onto the hd or stick or whatever after some time or if the stick is being unmounted or if you run "sync" in a terminal.

Offline

#4 2012-11-14 19:30:45

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

Re: USB file transfer too fast?!

LiranV wrote:

when I transfer

Using what app?

Offline

#5 2012-11-14 19:31:21

LiranV
Member
Registered: 2012-02-27
Posts: 57

Re: USB file transfer too fast?!

Files/Nautilus

Offline

#6 2012-11-14 20:00:28

johni
Member
Registered: 2012-02-03
Posts: 102

Re: USB file transfer too fast?!

Yeah, the write is cached to RAM, and is writing to the flash drive in the background.  This is why you should always cleanly unmount a flash drive before removing it or rebooting.

You could add the "sync" mount option, which will write synchronously, and wait until the file is written before returning, but that will make it really slow, and is generally not a good idea with a flash drive, which according to the mount man page can shorten the write life cycle of the flash drive.

Offline

#7 2012-11-14 20:03:54

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

Re: USB file transfer too fast?!

No, "sync" is wrong - he's already using flush, which is correct.

Offline

#8 2012-11-15 14:00:55

LiranV
Member
Registered: 2012-02-27
Posts: 57

Re: USB file transfer too fast?!

Any way to correct this behavior?

Offline

#9 2012-11-15 15:01:47

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: USB file transfer too fast?!

brebs wrote:

No, "sync" is wrong - he's already using flush, which is correct.

The docs say flush is not as safe as sync.

I'm guessing here:

async - stuff can be read from source but hang around in memory before being written to output (makes sense usually because it can effeciently batch up any further data that might come along), and an umount or sync command should flush it to output

flush - writes records/blocks as fast as it can, emptying memory cache

sync - writes one record/block then won't fetch/read any more until the device confirms that record has been written so much slower.

I wonder if OP has a progess bar that is based on "reads" or disk light that doesn't work correctly with usb so  flush and async will both report a  transfer has finished when there are still data in memory not yet written?

Offline

#10 2012-11-23 17:20:07

LiranV
Member
Registered: 2012-02-27
Posts: 57

Re: USB file transfer too fast?!

bump.
Anyone?

Offline

#11 2012-11-23 18:13:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: USB file transfer too fast?!

LiranV wrote:

bump.
Anyone?

This is not tolerated around here.  There have already been a number of responses, and actually pretty informative ones at that.  If you want more help, it would be best if you tried to help yourself a little bit.  Do some research to see if you can find more information, then post here to see if there is a better understanding of what you are finding out.  I think the "bump" would be considered an empty post.  See here.  If you plan to have a continuous presence in these forums, it would probably be best if you read this entire page.

Offline

#12 2012-11-23 18:20:33

LiranV
Member
Registered: 2012-02-27
Posts: 57

Re: USB file transfer too fast?!

Understood.
Thank you smile

Offline

#13 2012-11-23 22:23:19

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

Re: USB file transfer too fast?!

LiranV wrote:

bump.
Anyone?

devmon (part of the udevil package) lets you mount you USB drives with sync. Using sync, the transfer progress bars will be more accurate but at the cost of speed/time.

It would up to you to decide if its worth it.

Offline

#14 2017-03-09 21:53:04

debek
Member
Registered: 2015-12-20
Posts: 32

Re: USB file transfer too fast?!

Does anybody fix it?
Devmon doesn't help for me: https://wiki.archlinux.org/index.php?ti … =no#devmon
I've got the same problem as LiranV. I'm using gnome with nautilus.

Last edited by debek (2017-03-09 21:53:24)

Offline

#15 2017-03-09 22:49:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: USB file transfer too fast?!

Your problem is that you are replying to a five year old thread: https://wiki.archlinux.org/index.php/Co … bumping.22



Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB