Math for calculating file system wear

On argons and borons, what would the math be for filesystem wear?


  • file is 1kb
  • this is the only file that will be saved
  • it might get saved around 500 times a day

How many times can it be saved safely in the lifetime of the device?

There is no formula. It mostly depends on how full the file system is. If the file system is mostly empty that is well within the capability of the chip.

The flash memory uses 4K (4096 byte) sectors. For a 2 MB file system, this is 512 sectors.

With the file metadata, a 1K file should use two sectors. For 500 times a day, that's 1000 sector writes per day.

The reason it's non-deterministic is that LittleFS does wear leveling across free sectors. It will never move existing data that did not change. Thus if you have 500 sectors free, it will write each of those 500 sectors once before reusing it. If you have 5 sectors free, a sector is reused on the 6th write.

The minimum expected lifetime is 100,000 cycles. So if you're reusing a sector twice per day, the flash should last a minimum of 137 years if mostly empty.


That's helpful, thanks Rick.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.