Skip to content

Instantly share code, notes, and snippets.

@cogneato
Last active January 5, 2024 07:46
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cogneato/33bb0aaeb56e090059c6ad4ed38af623 to your computer and use it in GitHub Desktop.
Save cogneato/33bb0aaeb56e090059c6ad4ed38af623 to your computer and use it in GitHub Desktop.
Hassio Recovery

Recovery

Unless your SD card/data is corrupted, you can still get to your files or troubleshoot further. There are a few routes:

  • Connect a usb keyboard and hdmi monitor directly to the pi
  • Setup debug access to the host or if you're running a VM install, connect using a terminal which your hypervisor provides.
  • Remove the SD and access the files from another machine (preferably one running Linux)

Connect directly

Unfortunately, unless you're lucky and it comes right up, you're more than likely going to have to pull power on your pi in order to get your monitor recognized at boot. Pulling power has a risk of corrupting the SD, but you may not have another option.

USB keyboards should be recognized easily.

Once you're connected you'll see a running dmesg log. Hit the enter key interrupt the log. Sign in as "root". There is no password. You will then be at the Hassio CLI where you can run limited custom commands. These are the same you would run using the ssh addon but without using "hassio" in front. For example:

  • ha logs for homeassistant log
  • su logs for supervisor logs
  • ho reboot to reboot the host
  • etc (typing help will show more)

Type "login" and hit enter, and you will continue to the host console. You'll see a # prompt. From here you can check which containers are running using docker ps. You can check and change network settings using the network manager. nmcli

On HassOS, all the configuration files are found in /mnt/data/supervisor/. Inside that directory are the /backup, /share, /ssl, and /homeassistant directories. On a generic linux install such as Ubuntu, you find these in /usr/share/hassio.

If you're looking to undo a change you've made to configuration.yaml or anything else you can use cd /mnt/data/supervisor/homeassistant and look for a file you want to edit.

VI is the available editor on the host OS. If you're not familiar you're in for a real treat! Here's a cheat sheet

Setup debug access to the host

This is better to setup before you have a need for it. It involves generating authorized keys and importing or copying them to the correct location. See the link below for more. https://developers.home-assistant.io/docs/en/hassio_debugging.html

Remove the SD and access the files from another machine

The files are on an EXT4 partition (hassos-data) and the path being the same /mnt/data/supervisor as described above. These are easily accessed using another linux machine with EXT support.

For Windows or OS X you will need third party software. Below are some options.

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