I was trying to copy a file from my directory to USB, and the progress bar stuck in between, and it is not moving forward. I removed USB and inserted it again, and I found out that it was not copied. What to do here?
There are tons of reasons why it could have failed.
First of all, USB sticks have a limited rewritability. Their flash memory does not do garbage collection and does not support TRIM.
Secondly, USB sticks commonly come with a
vfat(FAT32) filesystem on them, which does not support files bigger than 4 GiB.
You removed the USB stick without unmounting it first, and in the middle of a write operation. You should never do that.
A write to a USB stick may appear stalled even when it is not, because first of all there is the speed limit of the USB bus, and secondly, there is an even greater speed limit on the USB stick itself. It’s not an SSD, and it cannot process the same throughput as an SSD or HDD either.
Next time, use a fresh USB stick and leave it plugged in, even if it takes all day. And then, safely unmount/eject it.
You can copy files with
rsync -ahr /from/source /to/destination.
After that the write cache must be written to stick with
After that, you can unmount the stick.