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

you need to login to the os first

Welcome on Home Assistant command line.

For more details use 'help' and 'exit' to close.
If you need access to host system use 'login'.

ha > login
# datactl 

2 Likes

@grunjol, you da’ man!

@Blueman2 So did you get hass.io booting and working without sd card in the Rpi4?

So you can only do that when connecting to the host system?
Is there an easier way? Because to connect to the host system, one has to plug-in another USB-Stick formatted and with that authorized_keys file, ai?

Would love to see a step-by-step guide to move data partition to USB stick.
ha login does not exist for me either.

→ ~ ha login
Error: unknown command "login" for "ha"
Run 'ha --help' for usage.
FATA[0000] Error while executing rootCmd: unknown command "login" for "ha"

No joy with direct boot from USB drive. But I am now able to access the datactl command and today plan to move my data partition to a USB SSD. It will still require I keep the MicroSD card in my RPi4, but this is a step closer!

I am planning on doing the same thing this evening. I have a USB3 to sata cable and SSD arriving in the post and will try and use datactl to move the data partition across to the external drive.

Let us know how you get on @blueman2 and I’ll hopefully post an update later.

Sorry, I got side tracked on a small roofing project for a shed in back. Hopefully I will have the couple of hours to devote to this today or tomorrow and will report back as well. @benmarshall, one of the things I was going to do was to run tests on 2 different USB3 to SATA adapters I have to make sure which works best. From what I have read there is a lot of variation in what works and what speeds you get based on the adapter.

There is a great guide to testing and adjusting USB-STAT adapters here:

I saw this link somewhere else previously and have bought the Startech adapter at the top of list. Hoping to get to try this out after work today.

1 Like

Well I can confirm that the datactl method has worked perfectly for me on a Raspberry Pi 4B.

My set up now consists of the Pi 4B connected to a Kingston A400 SSD using a Startech USB3 to SATA cable (USB3S2SAT3CB). The Pi is still booting from the sdcard but the data partition is on the SSD. I am running the full Home Assistant (standard install). Home Assistant reports the disk space metrics correctly and I have confirmed the partition has been moved across correctly.

All I had to do was:

  1. Backup (Just in case!)
  2. Connect the SSD to Pi using the cable
  3. Login into Home Assistant CLI over SSH (needs to be via develop port 22222).
  4. Get to a host shell using the ‘login’ command.
  5. Check the new disk is seen using ‘fdisk -l’, it showed up as an un-formatted disk /dev/sda.
  6. Use the datactl command to move the data partition - ‘datactl move /dev/sda’.
  7. Reboot as advised by the datactl command output - ‘ha host reboot’.
  8. Wait a while - mine took maybe 15-20 mins for a 120GB drive - Home Assistant will eventually boot up.
  9. Profit?

At some point it would be interesting to further investigate a USB boot solution, but I’m happy enough with this for now!

14 Likes

I just noticed that my system is asking me to revert to the old OS, 3.13. Did they pull the updated 4.0 OS? That would impact my attempts to get native boot since that requires the 5.4.42 kernel.

1 Like

@Blueman2 I have an update available for 4.9 (currently on 4.8). No message about reverting.

I likewise have an update available for 4.9 (currently on 4.8). No message about reverting. Running rpi4-64.
https://s3.amazonaws.com/hassio-version/stable.json
https://dev.azure.com/home-assistant/Operating-System/_build?definitionId=58

I’m having trouble getting to the datactl command. There are multiple flavours of ssh server. Which one did you use

  • Terminal & SSH std one from Official add-ons
  • SSH & Web Terminal from Home Assistant Community Add-ons
  • the SSH configuration for developer via port 22222

@brucek1642 I found I had to ssh in via the developer port 22222 method.

I also have the community add-on SSH & Web Terminal configure but this didn’t allow access to datctl command for me. I’ll add that to my post above!

Starting to make sense… thanks

Doh! It was my old Rpi3 that I was looking it. It was at 4.x and went back to 3.13. There was an issue so the developers pulled the kernel update for RPi3.

FYI when you run datactl this is what displays on the console.

I’m trying the move with 4.9, tried 4.9 solo with USB SSD, blank screen as before. I’ll report back if it works.

So the command finished, the Pi4 rebooted, but I can’t tell if it’s working?

I only see the SD card listed for drives, should I also see the SSD? It was /dev/sda ??

I also managed to do the datactl command as explained by @benmarshall ; just had to remove all existing partitions first using fdisk because I put Hassio image on the disk with Etcher in a previous attempt to run from SSD and this created 8 partitions. Once my SSD was free of partitions, the datactl command worked fine

To check if the SSD is being used, you can use the ‘df’ command over the developer SSH

PS:

1 Like

I just did this on a rpi4 4gb and it’s insanely slow. Going to try the quirck to see if it helped

So what in the image shows you’re using the external drive? I ran the same command but don’t see anything that indicates my 40gb SSD is in use?

Thank you