HASS.IO -> transfer from SD card to SSD or USB

you can see the ‘Used’ size of the dev/sda1 (/mount/data) increase over time as recorder is storing sensor data or when you install add-ons

Maybe a super stupid question. But how can I access the developer :22222 Port. By default :22 is for ssh. I know of course that you could use a parameter but if I do so it fails because the ssh add-on is only listening on :22. Advance Mode in HA is set but can’t find any option to enable a build-in ssh server. also documention doesn’t find anything if I search for 22222.

2 Likes

These are the instructions you need.

https://developers.home-assistant.io/docs/operating-system/debugging/#ssh-access-to-the-host

Basically you create a private/public key, upload the public to Home Assistant and then you can connect to HASSOS via SSH. It took me about 20 minutes to get it working but now I can SSH on 22222 and run all the OS level commands.

provided my pub key (as @fitool mentioned) and went through the steps @benmarshall mentioned and everything went through. the reboot took about 30 minutes (dunno, went to shower and grabbed some coffee) and then UI was unresponsive but ssh was working.

now everything runs smoothly and also boots up pretty nice and fast. I am however on 0.111.0b1

All you need to do is install ‘ SSH & Web Terminal’ and in the config set the port to 22222 (remembering to set a password in config and user to root).

Alternatively, install Portainer addon, go to containers and get a bash prompt on ‘homeassistant’ contain

that won’t work. see the post above. you’ll have to use the developer ssh access to it.
the addons protect the user to break stuff.

so you realy have to do it this way:
first: HASS.IO -> transfer from SD card to SSD or USB
second: HASS.IO -> transfer from SD card to SSD or USB

1 Like

so you boot from the MicroSD but then use the SSD for the storage? i assume this is going to help a lot with issues causing MircoSDs to die?
how does the performance look overall?

Smooth operation :smiley:
thanks for the tips

full booting from usb on pi4 is still under development ?
only sd botting, and setting data partition on ssd ?

Thanks dude for writing down the steps.
Without having the monitor cable connected and console access i would probably have wrecked it if i did not know it would take 15-20 min. :wink:

Just reiterating here to share after several test with pi3 and pi4 and mostly failing to be patient.

I would only try it on a fresh install or make sure to backup in case something goes sideways.

You connect to the host either directly with keyboard and monitor or debug ssh

You login as “root” to get to the HA custom cli and then enter “login” to get to the host. You can’t get to the host through a container, and you can’t use the command from any container. Portainer or otherwise.

I recommend directly connecting if you can, if only because you can see progress of sorts when you reboot after issuing the command. This is when I realized I hadn’t been waiting long enough when I was ssh’d to the host.

You confirm your usb SSD/HD is connected using fdisk -l.

As someone else mentions here, I also had better success when using fdisk to remove the existing partition(s) before proceeding.

  1. Type fdisk /dev/sdx (replacing x with your drive letter)
  2. Type d to delete a partition

You don’t have to make a new partition.

Then you would issue the datactl move /dev/sdX where X is your drive as seen in the previous command.
You get a response about hitting any key to continue, and then another saying it will happen at the next reboot. (it says “restart” but should probably be changed, since there will be some users who might think a restart of HA will do the job)

It took about 25-30 min for a 240G SSD for me, so if you aren’t using the direct connection where you can see the action, just be patient.

If this lines up with everyone else’s experience I would like to change the docs a bit to add details…or if anyone has other observations to chip in…

edit: docs added https://github.com/home-assistant/operating-system/blob/dev/Documentation/partition.md#data

9 Likes

Hello,
I am running HA on Docker on a Pi4 with the SD boot, SSD run trick.
It worked flawlessly for 4 months … until today.
I connected the Pi4 to a monitor and after I give it power, it stops in the console at 1.75s and it is stuck, no green led blinking.
If I connect disconnect the USB mouse then the console updates.
I read the SD card and it doesn’t seem corrupted.
Same for SSD.
How to debug/fix it without formatting the SSD and loose all my saved data ?
HA was running inside Docker btw

I did it with an existing installation and it took about 6 hours to complete with an 256 GB SSD and about 20GB of data on the SD card.

It works, but now I’m struggling with freezes of the host system. I just occours sometimes. Reboot fixes it for a few hours. I think it’s a USB3 related issue. Currently trying to find out if the issue exists on a USB2 port, too.

BTW, which SATA/USB adapter are you using?

1 Like

Can you provide details on what you’re changing in those files?

1 Like

Yes, same for me, please provide a repair guide on how to switch back to SD card, check/repair the SSD and then going back to SSD without formatting and loosing all the configs and databases.
If I remember correctly, to switch to SD card only, you need to modify cmdline.txt with the UUID of the SD card partition, and then root will run again from SD card only.
My understanding is that the SSD is a clone of the SD card.
But what this rsync that he mentioned between the SD card and SSD mean I can’t understand.
Also how to get the UUID of the SD card by reading it in Windows?

If I remember correctly, in the last video of Andreas Spies I saw that now on RPi4 it is possible to boot without SD card, so that would be even a better idea.

Is there any dedicated topic about restoring or backing up a Docker HA installation, I would consider this before any format of the SSD.

As a reply to your previous request, this is the adapter that I am using:

Eluteng SATA Cable USB to SATA Converter Adapter Super Speed USB3.0 to SATA Power Cable https://www.amazon.de/dp/B06XCV1W97/ref=cm_sw_r_cp_apa_i_ecC6Eb541HDY8

1 Like

As @bbogdanmircea mentioned there is a beta FW for the pi4 that enables direct USB boot so you can do without the SD card.


Has anyone tried that?
I’m still using the Sd+SSD combo for now with one of these SATA boards and they work great.

Unfortunately the tutorial requires to format the SSD.
How can I first save all my Docker containers for HA and add-ons so I can restore HA after that?

You don’t need to save containers - they are disposable. Just make a snapshot and restore it and HA will pull and recreate them.

Is there a dedicated topic about Docker save/restore?
I have 4 months worth of sensor data in InfluxDB, I don’t want to lose that, and I think that HA will restore based on a snapshot only the configuration but nothing else.
Anyway at the moment my RPi4 is not even booting, so first I have to understand:
1.how to make it work from SD only (UUID of SD in cmdline.txt )
2.save all relevant data from the SSD especially databases
2’.enable SSD only boot
3.format/fix SSD and reinstall Docker in HA which was a PITA btw
4.restore HA and databases