1

I am referring directly to raspberry pi (4) but im also not sure what to do if i boot from an SD Card on my Laptop.

It makes sense to me that it would be increasing write cache - which in windows I can use a program called "Primo Cache" which gives me an X second latency (delayed write)

However, I realize I have no idea how to achieve this in linux - and im rather embarrassed not knowing, it feels like it must be something simple that im forgetting about...

any ideas?

TardisGuy
  • 357

1 Answers1

1

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
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • I have noticed I can read and write (DD) to the SD card faster if I change the bs size. So block write size seems to matter... – TardisGuy Mar 22 '20 at 16:37
  • I agree with everything you said, but it doesn't really help bit drive performance... It may be this question has no answer. – TardisGuy Mar 22 '20 at 16:38
  • @TardisGuy, I agree that 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