USB write: delay between when Ubuntu says its done and it actually being done

Solution 1:

It happens because Ubuntu takes all the data from the disk that is to be written to the USB and save it in the RAM buffer (Depends on the capacity of RAM). Then Ubuntu shows that the data has been written to the USB but actually data is being transferred from the buffer to the USB at that time. So, if you remove your USB during the transfer (although Ubuntu has shown you the transfer is done), you'll find that all data has not been transferred. You can use

sudo iotop

to check for real time transfer between disk and other I/O and when you found that the transfer has really been done then you can safely remove the USB.

Solution 2:

Unmount the drive properly before you pull it out.. From terminal, use sync to make it write now, sudo umount /path/to/stick to properly unmount it. From GUI file manager, there are quite a lot of ways to do this - you may have a symbol next to the drive icon, or right-click it & eject or unmount.

You can't reliably just pull out a stick in any common OS, as writes are cached to let your commands take priority - if you did multiple edits & it made you wait for each write, you'd not like it. It's the same as Windows 'safely remove..'