If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:
echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes
I suggest you edit your /etc/rc.local
file to make this change persistant across reboots.
sudo nano /etc/rc.local
Go to the bottom of the file and leave a space then paste in those two lines.
Save the file with ctrl + x then press y.
To revert the changes enter this in console and remove the lines in /etc/rc.local
echo 0 > /proc/sys/vm/dirty_background_bytes
echo 0 > /proc/sys/vm/dirty_bytes
More info and references: https://unix.stackexchange.com/questions/107703/why-is-my-pc-freezing-while-im-copying-a-file-to-a-pendrive/107722#107722
I have tried "various" approaches, even completely disabling swap without any change. copying large files (and large amounts of files) to a USB exfat spinning HDD-drive freezes the system beyond usability. (POP_OS, asus TUF gaming, 16gigs of ram, 512 nvme)
Very frustrating. Funny enough - and I have no logical explanation, this does NOT happen to an exfat formatted SSD-USB. same USB enclosure, so not even the firmware of the case can be the problem. I don't even know where to start troubleshooting this anymore.
to add value to my rant; I found that gcp and rsync work flawlessly and fast, without causing a freeze / hog.
I used these two successfull for a large amount of files & large files (my 900gb steam library)
$ gcp -rv /whatever/* /some/other/place/
$ rsync --info=progress2 -auvz /whatever/* /some/other/place/