What to do when write to USB appears to have become frozen?

How can a USB be safely removed from the computer if possibly still being written to?

I copied 4 GiB from computer to USB and a message stated completed but, when clicked the button to safely remove the USB, it just spins and states to wait. That was at least one-half hour ago and I know that it writes faster than that because I back up a 15 GB sqlite file in a couple minutes.

I didn’t want to just pull it out and would like to know if there is a way to check if it is truly writing and/or stop whatever it may be doing and try again if necessary.

This was initiated in Dolphin.

[Added: I was too stupid (until now) to think of just closing Dolphin and that worked. When the USB was again mounted, all the files had been written.

I don’t know why it got “stuck” that why.]

Thank you.

1 Like

filesystem cache → the USB may have hit a bad set of memory cells

pamac build udev-usb-sync

[root tip] [How To] Disable write cache for USB storage devices
Strict limit of write cache / 0s sync time policy for usb devices by default

4 Likes

Sometimes i had this too, it happens rarely to me but i could solve it when i close dolphin and reopen it again, also close all other unwanted applications.

You normally can show the copy progress in the Taskbar minimised (Dolphin) Window Tab (which works with KDE, not sure if thats a option with other DE’s :man_shrugging:).
There should be no guessing about a copy progress needed with the right settings.

If you still have problem, a normal system reboot should sync and unmount the USB stick also.

Sometimes i see unmounted Drives still powered on and can be remounted, then i use this command:

USB-Drive Shutdown (Replace X with actually drive label):
udisksctl power-off -b /dev/sdX

2 Likes

i noticed that the progress indication of copying to a usb in Dolphin is not clear at all,you never know where it’s at.
i just wait.

another easy option:

  • open terminal
  • type: sync and hit Enter
    when the command is back to prompt, it is finished
4 Likes

Thanks to all for all the information and links.

I recently switched kernels from 5.15 to 6.11; for no special reason other than finally learning how to get the external WIFI to work with kernels above 5.15. The RAM of my machine was also increased for no special reason other than that one of our better machines had a system board failure and, after replacing the machine, I found that it used a different type of memory (at least the old machine’s memory cards wouldn’t fit into it the new machine’s slots) and the only machine that it fit was mine. So, it went from 16 GB to 32 GB.

I read much of those links and some of the links that the links pointed to, and much of it is a bit over my head. It appears that the files to be written to USB are first cached in memory, and then written to the USB. Dolphin informs me that the write was successful when the files were written to memory rather than the USB.
If I then attempt to remove the USB, I’m told to wait and the progress indicator is no longer accessible or I don’t know “where it went” and all I see is a spinning arrow.

In the recent past, I recall watching the progress indicator details show me the number of files written and the amount written to the USB and that was for about 100 GB with most files no more than 2 MB and one 15GB. I’m using a Samsung 3.1 Flash Drive 256 GB.

I suspect, then, that either the added RAM or use of a different kernel has something to do with this.

Perhaps, when I closed Dolphin that forced a sync and is why when the USB was remounted all the files had been written? Or they were already written before I closed Dolphin and the spinning graphic was not removed.

However, overall, I don’t really care as long as I know what to do about it.

And, if all I have to do when this happens is open a terminal and request sync, that’ll be fine for me.

Is there a sync with show progress so I can have an idea of how much has been written to the USB?

Thank you.

No, but expect that up to 20% of your RAM is used for write cache by default.

That means that

  • the progress bar appears to be frozen, since it slows down to the real speed of the usb bandwidth after the write cache is filled.
  • the file manager will report that the files are written but still ( RAM * 0,2 ) is still writing.
  • it is impossible to safely remove the usb device until it is written.
  • the more RAM you have and the smaller the bandwidth, the more noticeable this bottle neck is. Solution: Adjust the bottle base (RAM) to the bottle neck (bandwidth). See: udev-usb-sync