Skip to content

Instantly share code, notes, and snippets.

@lucas-mior
Last active January 3, 2025 04:42
Show Gist options
  • Save lucas-mior/b932b0e949ff6e3a3eca8708131699d8 to your computer and use it in GitHub Desktop.
Save lucas-mior/b932b0e949ff6e3a3eca8708131699d8 to your computer and use it in GitHub Desktop.

SSD for backups

Yes, you should use SSDs (and HDDs) for backups.

You should have at least 3 copies of your data. One of them is the master copy, with which you work from your computer. The other two are backups, which should be in 2 different locations, and use two different storage types. The easiest solution would be to use one external HDD and one external SSD. Also, use btrfs (for reasons explained below).

Don't buy external SSDs

For some reason, people waste money by buying extremely overpriced sandisk "external" SSDs. Don't do this. Instead, buy a normal price SSD (either NVME or SATA, depending on your budget) and a case/USB adaptor. Be sure to buy an adaptor with the right specification, or you might get one that has terrible speed.

But SSDs aren't meant for cold storage.

People say this because SSDs cells may lose bits after some time without writing to them. How much time, depends on the drive quality and the ambient temperature. But don't panic, this process takes months on the worst case. Some people also say that connecting them to power for some time is enough to have the controller "rewrite" the cells so that the degradation process is reset. I would like to see manufacturers actually specifing that.

What I do know is that you have to take measures to avoid losing bits in your cold SSD:

  • Do incremental backups regularly.
  • Do a btrfs scrub every now and then.
  • Every few months, use rsync to incrementally backup based on hashes so that corrupted files will get rewritten from the master copy.
    • Alternatively, if you are away from the master copy and want to reduce the chance of losing bits, do a btrfs balance without filters which should rewrite most of the bits. Beware that this will write extensively to your SSD, which causes wear.
  • Use software tools to check the health of your drive. If and you are careful enough to not write hundreds of gigabytes per day, a good drive should last decades.
    • If your drive is showing signs of failure, buy a new one.

What people forget is that external HDDs, while great at what they do, also are not perfect for cold storage. They are fragile and slow. SSDs, on the other hand, are immune to most mechanical issues, and are fast, which is great for making backups regularly. So don't fall for the meme, and use them both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment