I wiped my SSD by accident

I thought I would never need it. I thought it was unnecessary. I thought it would be a struggle to set it up. But, boy am I glad I setup a simple backup system anyway.

I believe we should use our electronic devices as long as possible by repurposing them to new tasks as we replace them with new ones when absoletely necessary. I even wrote a blog post about it. But I didn’t say much until now about protecting our data simply because I didn’t have a proper system for it. I thought it would be hypocritical of me to write about it. But things changed when I accidentally wiped my SSD clean by accident on 2022-09-07.

The accident

I attemptet to install Pop!_OS on a 32GB flash drive to create a portable Pop!_OS system with secure boot support. I decided to use the recovery partition on my laptop, Lemur Pro by System76, since it is not different from booting into the installation ISO, it seemed simple enough. But I believe I encountered either a bug or a quirk of Pop!_OS installer which resulted it targeting my SSD instead. I created an issue on GitHub and developers started looking into it.

Duplicati with B2

Anyway, this post is about how my simple backup system helped me recover my personal data. I wasn’t expecting everything to go this way but hey, this is what backups are for ain’t it.

I looked into few remote storage options and BackBlaze seemed like the most affordable option. So I followed their guide to set up Duplicati with B2 back-end. I guess it was working just fine, at least the bucket was getting larger with .aes files. If I only had an accident, I would have an opportunity to test it.

This small heart attach enducing mistake on my side probably the worst opportunity for me to test my backups. Only after reinstalling Duplicati I realized that Duplicati configuration was gone too. Why the heck didn’t I think about exporting it 🤦
But again, I had all the stuff like access keys and encryption passphrase recorded in my password manager. Oh am I glad I made a habit of using a password manager. It truely can be a life saver.

screenshot of a bitwarden entry holding my Duplicati secrets and passphrases. confidential data is replaced with big dots to hide them

Restoration

Recreating the configuration was as simple as following the guide again. All I had to do was clicking restore button on Duplicati config. It would connect and download my backups. But instead it hang midway while recreating the database. CPU was idle, fan wasn’t running, it was like the silence before the thunder all again.

I decided to download the files first, then restore from a local source rather than loading work of downloading on Duplicati too. Now B2 wasn’t letting me create snapshot for some reason, because snapshots are the only way to download more than 5 files at a time. I guess I am downloading everything with using the command line now.

$ b2 authorize-account
Backblaze application key ID: $B2_keyID
Backblaze application key: $B2_applicationKey
Using https://api.backblazeb2.com
$ mkdir ~/B2bucket
$ b2 sync --threads 10 b2://revenge-subarctic-canopy-glorifier ~/B2bucket

I cancelled the old job and started a new restoration job but using the ~/B2bucket folder as the backup source this time. Everything was a smooth sail from this point onward. I just had to not open or edit any files while it was restoring (I think).

Don’t let backups scare you

I think I do know why I never used backups in the past. To me, backups always appeared as that complicated, expensive, burdensome thing that was so easy to postpone. But my overall experience was nothing but peace of mind. Sure I had few moments when I thought everything was lost and nothing would be back. It turns out, those were just a rookie’s growing pains.

Duplicati's web based user interface showing the home page

So please, if you haven’t already, give yourself the gift of peace of mind. Setup backups using Duplicati with any of the storage options. You don’t have to use B2 like I did, you can even use Amazon’s S3 for all I care. Backup will be encrypted before upload anyway (hopefully you used a passphrase with 4 or 5 random words). Or, maybe repurpose an old HDD for this if you have one.

Also, I owe a massive THANK YOU to past Murteza. He saved the day.

Comments

Comment on Fediverse or via email

This article was updated on 9 Sep 2022