What's the suggested way to disable usb memory stick write caching in solus budgie? Most of my usb memory sticks are super slow and I want to track the progress when moving files to them. And if I try to shutdown the computer it doesn't work nicely because it's still writing behind the scene. Also while waiting after copy operation supposedly finished I cannot mount other partitions even those located on an internal nvme drive. I can image scenarios where the user would even want to cancel the copy operation all together. With write caching enabled that is not possible or is it?

PS: I have tried copying the large file with terminal command cp, nemo and cli midnight commander. All claim to have done the copy operation way too fast. So it must be write caching. Or am I missing something here?

  • sync might be a useful command in this case?

    If you type sync in a terminal, you will know all files have not been written to disk until sync returns you to the command line.

    man page description: Synchronize cached writes to persistent storage

never tried but interesting reading. In ten minutes of reading the consensus looks like hdparm as 'accepted' method--never seen a consensus when it comes to linux problems until today! I've used that tool before, it's powerful.
But that's my impression. https://linuxconfig.org/improve-hard-drive-write-speed-with-write-back-caching
also https://forum.manjaro.org/t/root-tip-how-to-disable-write-cache-for-usb-storage-devices/135566
As far as UI apps that can do it, I don't know.

I found this in one sites brent posted and I tend to agree with it.

Disabling write cache and decreasing the buffer size does not increase the transfer speed to the device - it only ensures that when the copy is done there is no buffer left to flush.

The rest depends on the stick itself.

To me its more indication of worn out usb sticks (That is if you have writin to them alot)

    Generally when working with a slow cheap or worn USB stick I just wait until I can unmount it because that is when it has finished being written to.
    I think at one time I was running a tray icon that told me when the drive could be removed. In the end it was easier to employ more patience or replace the slow sticks.
    As frustrated as I got waiting for a copy to usb transaction to finish there was always the option of trying to do the same thing in Windows and it taking three times as long 😄

    sync might be a useful command in this case?

    If you type sync in a terminal, you will know all files have not been written to disk until sync returns you to the command line.

    man page description: Synchronize cached writes to persistent storage

    @BuzzPCSOS Axios Buzz, WIN could barely handle a handful of docx's..you both are right. USB's get the crap beat out of them and are a huge factor.
    In regards to @Jumpy's post here, maybe I've been poor so long alI know is slow HD to USB copies, most especially to stuff with a GB after it. I haven't bought a new USB and tried to copy mega GB's -- so long I can't remember. Sometimes a 4GB iso to USB (ventoy) can be half hour.

    Axios Disabling write cache and decreasing the buffer size does not increase the transfer speed to the device - it only ensures that when the copy is done there is no buffer left to fl

    that says it all. I always wondered if CPU mhz was the next biggest factor(?).

    I do have a Samsung T5 and a Samsung T7 as external usb storage that achieve constant decent 300MB/s speeds. But I think dedicating one for boot media would be overkill. So I have been using 15 MB/s memory sticks for the occasional need for boot media.

    @"brent": Sometimes a 4GB iso to USB (ventoy) can be half hour.

    This is what I'm currently trying to do - Writing Solus-4.5-Plasma.iso to a three year old Kingston 32 GB memory stick. Fortunately it doesn't take that long.

    @"Axios": Disabling write cache -- https://discuss.getsol.us/d/10846-whats-the-suggested-way-to-disable-usb-memory-stick-write-caching/4 -- ensures that when the copy is done there is no buffer left to flush.

    This is exactly what I want. I tried the udev-procedure you linked to, and it seemed to make a difference by showing slow speed from the start. But I couldn't safely unmount the memory stick right after copying the iso file to the usb was supposedly finished. I did run sync in terminal afterwards and it took a few minutes to return succesfully. Booting to the plasma iso worked, so copying the file was a success. Previously booting had failed in some error messages as I was rebooting my pc too fast after having supposedly copied the iso to the boot media.

    @"johano": If you type sync in a terminal, you will know all files have not been written to disk until sync returns you to the command line.

    Thank you for pointing this out. The sync program is not ideal as it seems to lack any indication of progress and estimated time remaining. But it's better than nothing.

    You can install (Dstat) the run (dstat -d) it will show you read and write activity
    Maybe it will help showing how long things linger.
    At times maybe some disk activity without doing anything but after watching awhile you will
    see when you do a disk write.

      Axios Dstat allowed me to ensure that the memory stick is being written to and that the process was not hung up. Dstat also revealed how slow the write speed gets during the sync phase (from 25M to 300k). Thank you very much for this tip.

      Axios You can install (Dstat) the run (dstat -d)

      I installed it simply out of curiosity, to take a look at what it outputs. When I wanted to quit, I could find no way to do that. Please tell me the magic incantation. All I could do was to shut down the terminal and restart it. Is there a better way?

        johano <kbd>Ctrl-C</kbd>

        Ahhh, thanks. It's been a long time since I've used Windows, I didn't even think of that. I use that all the time as a command for "copy." Silly me!

          WetGeek If you just do dstat gives you all and the (dstat -d is just read write)
          and of course (ctrl c)

          WetGeek Ahhh, thanks. It's been a long time since I've used Windows, I didn't even think of that. I use that all the time as a command for "copy." Silly me!

          those are also the keybindings for nano if you are editing .conf (CTRL+Whatever) files.

            brent those are also the keybindings for nano

            Thanks, but I stopped using Nano when I found Micro. IMHO, its shortcut keys are more sensible -- they match more of the Linux editors, like gedit, etc.