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
This fix did not fully work for me. After I applied the fix, I would still experience machine freeze but less frequently. What did work was disabling the swap file. I first tried increasing the swap file to 64 GB, this did not work, I then disabled the swap file altogether. I am on a dual CPU server with 32 GB memory. I did run memtest extensively, so I know it is not a memory issue. I did copy from exFAT 2 TB system (via usb) to ZFS Z2 6x10TB array.