W. H. Heydt wrote: ↑
Sat May 26, 2018 3:20 pm
I'd have to check to see what Raspbian does, but most Unix/Linux systems do a "sync" command every 30 seconds to write modified pages to "disk" (SD card in this case).
In fact I believe the default is every 5 seconds.
See the "commit" mount option to ext4.
Here is mine, I up it to 10 minutes because power cuts are rare here, and I am careful to shut the Pi down cleanly each time - and it obviously increases the performance.
PARTUUID=28873ee6-02 / ext4 defaults,noatime,commit=600 0 1
Ext4 has "extents" which are sections of contiguous blocks in the file and it uses "delayed allocation" to try to allocate as much contiguous space as possible while writing the file.
This does does not work well if the commit interval is too short.