Dead microSD / SD - Did not save a copy of snapshot - RESTORE PROCEDURE -

A lot of us experienced dead microSD.

I have gone thru 2 dead microSD since I started using home assistant, we all know the reason being a lot of small writes on the microSD.

It happens to the best of us - HELP!!! I did not save a copy of snapshot.

Here’s the process to Restore after microSD card being dead.

What I meant on being dead is you cant get to boot it any longer.

This assumes that the microSD is still readable in windows.

Reading from Google microSD has a feature to protect the data and locks the card as write-protected.

This is actually a good thing.

After the microSD not longer boots in Pi, I was hoping to get the write-protect removed but I cannot find any write up in Google to do that.

I went as far as following guides - windows diskpart to clear read-only, formatting the micorSD card in Android tablet, digital camera but was unsuccessful, which was a good thing If I have succeeded then I would have lost my data.

So here’s the write up. Using Windows. - Likely will work with Linux but I have not tried.

Download DiskInternals Linux Reader

insert microSD

Open DiskInternals Linux Reader wait for the microSD card to be read.

Go to the following folder.
/var/log/journal/supervisor

save the following folders “backup, homeassistant, ssl(if you are using certificates)”

Hurray!! back-up saved.

Set up your home assistant per your new microSD or SSD(recommended)

I have now moved to SSD - Kingston A400 120Gb after having my HA down for 2 weeks. $40 CAD damage…

Now on to moving on to a more softer database…

2 days of scratching my head and digging into the forum and I cant get the MariaDB Add-On to work keep getting “could not connect” in log.

Tried the following lines - one at a time on the recorder:

recorder:

  db_url: mysql://hassuser:password@localhost/homeassistant?charset=utf8
  db_url: mysql://hassuser:password@localhost:3306/homeassistant?charset=utf8
  db_url: mysql://hassuser:[email protected]/homeassistant?charset=utf8
  db_url: mysql://hassuser:[email protected]:3306/homeassistant?charset=utf8
  db_url: mysql://hassuser:password@IP/homeassistant?charset=utf8 # IP being the local(internal)IP address of the hassio
  db_url: mysql://hassuser:password@IP:3306/homeassistant?charset=utf8

Nothing works above!

Command below fixed it.

  db_url: mysql://hassuser:password@core-mariadb/homeassistant?charset=utf8

Hope this helps!