Problems unmounting USB drive

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).)

The command ps -ef showwed the following line:

uli       5164  1739  3 12:19 ?        00:00:03 /usr/bin/dolphin /run/media/uli/828B-A339

So I used the kill kommand:

uli@linux-7b8y:~> kill 5164

Then the dolphin window disappeared and the window copying finished appeared.
This happened several times - how can that be resolved?

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.

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?

In a USB 2.0 port maybe? What filesystem on the USB device?

In this case it is USB2.0 and FAT as most USB drives have. However I didn’t notice any big difference in speed if the are formatted to ext2 or ext3.

Just have to be patient for those big files and FAT…

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.

yes, arvidjaar, here are the mount options for the USB drive. It all looks OK to me

/dev/sdc1 /run/media/uli/ADATA\040UFD vfat rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0


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.

Thank you for this explanation, arvidjaar, is this the best setting for this?

What is the “commit” command? I don’t seem to have it on my 42.1 system.


Ah, got that:)