Lately I've been using USB2 flash drives to transfer a lot of data to my company.
When copying the Data to the flash drive, I noticed that the data is not written directly to the drive. It wrote with 200MB/sec to cache(?). I then umount
or sync
the drive and it takes hours to actually write the data to the
drive.
I also tried using cp
instead of Nautilus, but it had the same behavior. dd
is not an option for copying normal files.
Is there any way to make Linux write the data directly without caching when writing on USB storage? Or maybe reduce caching so that I don't have to wait for hours when unmounting the drive?
What's annoying me most is that the progress bar finishes copying and I then have to wait a unspecified time for sync
to write the data.
I'm on a Fedora 25 machine.
[Update] Tried to clarify my question.
[Update 2] Found a similar question without answer:Reduce cache size of flash storage devices
sync
aftercp
can be useful? You'd wait for that to finish. – Paul Stelian Jul 07 '17 at 12:10umount
withwatch -n 5 iostat /dev/your device
' – Ashutosh Gupta Dec 30 '20 at 12:58sync
mount option. If it is auto-mounting, I don't know where the config is. There is also a command (I thinkunbuffer
, that can run other commands with no caching. None will make it faster, it will slow the writes, and speed up the unmount. Over all it will be a little slower, but safer. – ctrl-alt-delor Jan 24 '21 at 18:24