# How can microSD flash memory wear be minimized?

**URL:** <https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896>\
**Category:** Raspberry Pi Gateways\
**Created:** [July 14, 2018, 9:25am UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896 "2018-07-14T09:25:54Z")\
**Posts on this page:** 5\
**Page:** 4

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [April 2, 2019, 4:20pm UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896/62 "2019-04-02T16:20:37Z")

</div>

> [@cultsdotelecomatgmai](#):
>
> Using the hdparm --fibmap command I can see that the SQLite3 databases are staying in the same ext4 Logical Block Addresses (LBAs) so SQLite3 and ext4 are not moving the database files around on the block storage.

That the flash translation layer is probably not writing those _logical_ blocks back in the same _physical_ location is pretty much a given, for reasons of simple _impatience_ - doing a block erase to write back in the same place would simply take too long.

So a fairly _implicit_ migration of data around the actual storage is a reasonable assumption.

IMHO, the proper question is not “does the translation layer level wear” - it is “can you trust the translation layer not to get confused about where it put things when a metadata block fails, and fail the entire card”.

What’s particularly insidious about that issue is that not only is the translation layer secret and proprietary rather than many-eyes-audited code, _nothing_ you do at operating system level (short of duplicating data to a distinct physical device) can protect against it. If the FTL metadata gets corrupted, OS-level concepts like partitions are not meaningful firewalls against loss.

And as the memory cells reach the point where _read life limitation_ requires the FTL to periodically move and refresh data just to preserve it, even treating the entire card as being _logically write protected_ in operation is not really enough.

---

<div class="post-metadata">

**Author:** ![peter-32\_HX3\_OLZ\_UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/peter-32_hx3_olz_uk/32/28485_2.png) [@peter-32\_HX3\_OLZ\_UK](https://www.thethingsnetwork.org/forum/u/peter-32_HX3_OLZ_UK)\
**Post date:** [September 10, 2019, 6:36pm UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896/63 "2019-09-10T18:36:07Z")

</div>

Personally I’ve always used one brand, Sandisk, and bought cards that have more capacity than I’ll need.

Most of my Pi’s (I have 12) run 24/7 with a variety of server software and I’ve had 2 or 3 failures in 3 years.

Regular backups using rpi-clone are a great help!

---

<div class="post-metadata">

**Author:** ![peter-32\_HX3\_OLZ\_UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/peter-32_hx3_olz_uk/32/28485_2.png) [@peter-32\_HX3\_OLZ\_UK](https://www.thethingsnetwork.org/forum/u/peter-32_HX3_OLZ_UK)\
**Post date:** [September 15, 2019, 4:57pm UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896/64 "2019-09-15T16:57:55Z")

</div>

I use these - they are bulletproof!

---

<div class="post-metadata">

**Author:** ![Fremen2001](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/fremen2001/32/34544_2.png) [@Fremen2001](https://www.thethingsnetwork.org/forum/u/Fremen2001)\
**Post date:** [October 16, 2020, 4:22pm UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896/65 "2020-10-16T16:22:03Z")

</div>

you can use Alpine Linux arm image, the distro run from RAM and there’s a command to commit  
changes to the sd card reducing the wear of the latter. Just keep in mind you need enough RAM to hold the running OS plus any service hosted, you can read the related info on their site.  
Happy hacking 🙂

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [October 16, 2020, 8:36pm UTC](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896/66 "2020-10-16T20:36:22Z")

</div>



[Previous page](https://www.thethingsnetwork.org/forum/t/how-can-microsd-flash-memory-wear-be-minimized/15896.md?page=3)
