Write caching does not help
In current Ubuntu systems (for example 18.04.x LTS) in computers with a lot of RAM, the write operations are cached automatically. But it does not help the final write speed from the cache to the actual target device (the SD card in your case).
Put many small files into a [compressed] archive and write the archive
What might help is putting many small files into an archive (for example with tar
). Things will be even faster if you compress the archive
sudo tar -cvzf file.tar.gz pattern
where pattern
can simply be .
or an expression with files and/or directories maybe containing wild cards in order to select the files that you want to put into the archive.
Writing the archive or compressed archive to the SD card will be much faster than writing the files separately.
Edit: Wipe the whole SD device
Memory cards and USB pendrives will often get slower than the original write speed after writing to it repeatedly. Finally they may get completely choked, 'gridlocked'. I have found it helpful to wipe the whole device by overwriting with zeros.
- The write speed is restored to almost the original speed
- The risk decreases that the drive is choked and get gridlocked.
- But do not do this too often because of the wear of memory cells. i do it when the write speed drops below half of the original speed.
- You can do it in a convenient and safe way with mkusb
- Link: Pendrive lifetime
dd
bs size matters. It should be at least 4096 according to this link. - Sorry, but I don't know any more software tweaks for this purpose. - You have probably already tried to find a faster SD card (better memory cell hardware and/or better internal electronics to manage mapping from logical addresses to the physical memory cells). – sudodus Mar 22 '20 at 16:54