Skip to content

Instantly share code, notes, and snippets.

@henri
Last active November 27, 2025 04:55
Show Gist options
  • Select an option

  • Save henri/a824ebefa87eacf05a6bb8ad071e0633 to your computer and use it in GitHub Desktop.

Select an option

Save henri/a824ebefa87eacf05a6bb8ad071e0633 to your computer and use it in GitHub Desktop.
ssd maintance / types of flash memory storage
#
# SSD's and flash memory is available in a variety of different flavours.
# As power drains from souch a system you stand to lose those bits!
#
# Firmware plays an important role in all of this.
#
# If your SSD is not powered up then the firmware will not be able
# help you out. Most firmware is propriortary and as such, you can
# power the drive up for a while (...?...) and hope for the best.
#
# The best approach is to use write cycles
# delete the data and put it back. Then you will
# have some level of certianty that the data has been
# written again.
#
# Below are possible ways to mitigate or work around
# the problem. Best idea is if it is important
# have mulitple copies.
#
# Some quicker fixer-uper approaches, below
# may prove useful in preserving your data.
#
# if your firmware behaves
dd if=/dev/sdX of=/dev/null bs=2M
# if your drive is offline
dd if=/dev/sdX of=/dev/sdX bs=2M iflag=fullblock conv=sync,noerror status=progress
# zfs scrub (software checksums)
zpool scrub poolname
# btrfs (software checksums)
btrfs scrub start
# If you just want to know if bits have flipped
# then checksum your data. There are many
# ways to checksum data on a file system
# with a computer.
# fingerprint
https://github.com/ioquatix/fingerprint
# gammar radition is problimatic and should be avoided
# video links
# error testing
https://www.youtube.com/watch?v=rx3Y5x6uzKQ
# how they are made
https://www.youtube.com/watch?v=dX9CGRZwD-w

types of NAND flash memory

consumer options

  • 3D NAND : about 1 year?

    • QLC (Quad-Level Cell) 3D NAND flash, which stores four bits of data per cell
    • TLC (Triple-Level Cell)
  • About 3 years? - MLC (Two bits per Cell) NAND flash memory

  • SLC Single-Level Cell

    • 1 bit per cell (typical)

somewhat higher end options

  • eTLC (enterprise TLC) NAND Flash months?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment