File copy to USB appears to finish too fast

On both my laptops, file copying to USB thumb drives seem to go impossibly fast, both in Caja and in the terminal. One gigabyte finishes in a few seconds. The actual file copy appears to finish in the background, so if I wait a while before ejecting the drive then it works fine. But if I eject immediately afterwards, I end up with a corrupted file.

Does anyone else experience this? Should I file a bug report?

Check the discussion in this post:

2 Likes

You can!
U-M 16.04 or U-M 18.04 same problem, the transfert bar goes a LOT faster than it should
And this problem is on all the 7 computers and laptop (total of my home and at my work) which are on Ubuntu-MATE.
I have a flashing light on the USB sticks i am using and i remove the sticks when the light stops to blink, so this bug does not really bother me :wink:

I made a script for Xfce Generic Monitor applet that tells me how much data is written to usb disks. Runs periodically every few seconds. With Mate Desktop, I think Command applet can be set to run this script. At least it tells you when the drive is in idle state or writing. Along with some indication about how much data was written since the drive was plugged in.

[code]#!/bin/bash

if ls -l /dev/disk/by-path/usb &>/dev/null; then

USB_DET=($(ls -l /dev/disk/by-path/*usb* | grep -v "part" | awk '{print $NF}' | awk -F "/" '{print $NF}' | sort))

for usb in "${USB_DET[@]}"
do
	if [ $(awk "{ print \$9 }" /sys/block/$usb/stat) -gt 0 ]
	then
		sector_size=$(cat /sys/block/$usb/queue/hw_sector_size)

		DATA_WRITTEN=$(awk '{load = $7*sector/1000/1000
					printf "%.1f", load}'  sector="$sector_size" /sys/block/$usb/stat)
    		printf "%s: %s%s " "$usb" "$DATA_WRITTEN" "MiB"
	else
		printf "%s: %s " "$usb" "idle"
	fi
done

else
echo “None”
fi[/code]

As of today and having few updates from the begining of this week (Ubuntu core etc…), today i did transfer 2.8GB to my USB dongle and Wow the speed was a lot more slower than usual and the transfer bar matched the blinking of the USB dongle.
To be sure i did the same (to test) at home and it worked too (same updates of the week)

So it seems that Ubuntu have fixed the problem :sweat_smile:

For references: I am still on U-M 16.04.5 (LTS) both at work and home USB formated as ext4 and no dongle died during the experience.

2 Likes

It depends on the flash memory and flash controller models.
For example cheap Transcend JF500 and JF790 are writing data very slow. They may close copy dialog fast, but data is still transfers from the buffer to the flash.
I can’t believe that it is kernel issue. I hope that modern cheap TLC memory is a root cause.

Currently I know only two normal USB-flashes: Sandisk Extreme Pro and ADATA UE700. They drop their caches just after closing copy dialog. Both have LEDs, LEDs go off just after closing copy dialog.

I use only the same USB dongle for the last 2 years, cheap Chinese USB dongle not branded (just the logo of my company on it)
and yesterday it was the very same USB I did my back up :wink: