After a new install I tried to unmount the usb stick but got only the response “Device is busy” even thought he copying finished long ago. So I tried from the command line:
sudo umount /dev/sdc1
umount: /run/media/uli/828B-A339: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
Hi
It may only appear to finish copying… are they big files your copying, try running sync from a terminal to ensure it’s actually finished the copy process.
Close all browsers that use that drive execute the commit command to assure all cache are flushed then umount. It is easier to simply use the notification widget to do that.
thank you, malcolmlewis and gogalthorp. The file was a video clip (approx 700MB) and it seemed to finish a while ago and nothing happened What is sync about to do? I just tried it with copying a small file and didn’t get any output except the prompt afterwards. gogalthorp, sorry I don’t understand your comment. I don’t know the commit command and how do you flush the cache? What notification widget do you mean? If you talk of the ‘copying finished’ window - that didn’t appear even though the copying had reached the full size quite a while ago and the blinking in the USB stick had finished.
Hi
The sync (flush file system buffers) command will ensure everything is flushed (as user gogalthorp indicated), I always use it on large files to USB, once that’s done, then unmount.
Thank you, malcolmlewis, that makes it clearer. I am just running another test copying two files (1.5GB and 800MB). 2 minutes after the filesize of the both files reached its full number I used the command sync. now 3 minutes the command sync is still running and the USB stick still blinking. On no other of my computers takes copying so long. I don’t know what is happening here. Now 6 minutes after typing sync this command finished and the copying finished window appeared. Then unmounting worked as usual. So it seems it is just taking 8 minutes after the copying appeared to finish (when the increasing of the file size reached its limit and stopped which was less than a minute) that the copying is actually finished? can that be right?
What options are used to mount USB (check in /proc/mounts when USB is mounted - file format is similar to /etc/fstab)? My guess is that it is mounted with some option that prevents caching in memory which explains why it appears so slow. Note that I routinely have similar situation on Windows where I cannot “Safely remove” USB stick even though operation appeared to have finished. It takes time to flush memory buffers to USB.
Thank you, arvidjaar, I will check that later (my wife is using this computer now). It seems odd to me that on this computer which is faster the copying is so much slower.
It is mounted with option “flush”. What this option does, is to sync filesystem (write memory cache to USB) when file is closed. This very well explains what you see - first file is “copied” into memory cache which happens very fast, then when file is closed it is written to USB; I believe this is done synchronously. Program that opened file (in your case file manager) appears to be “hung” at this point because it waits for kernel to complete writing data.