Konubinix' opinionated web of thoughts

Takes a Very Long Time to Eject My Usb Device


debian - It takes a very long time to eject my flashdrives - Super User

issue with USB in general.

If you copy large files or many files, the USB device will deliver a message to the host saying “I am about to send you these files”. The device will then asynchronously send all files and will take the time it needs to do so. This means that when you do a cp /my/flash/drive/foo.txt /home/bar/foo.txt the device will tell the operating system that files are being copied and then send the files.

The only way I know of to check if all data actually has been transferred is to enter sync after doing a command that copies/moves or deletes files on a flash drive. The sync command will then just block until the drive is finished with transferring data. After that it should be safe to unmount/eject an USB flashdrive.


watch progress of the sync operation: the number printed when you run

$ watch grep -e Dirty: -e Writeback: /proc/meminfo

should decrease down to zero as background data transfers occur. When it’s done, your sync will be completed and your flashdrive will eject.