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

My SSD and enclosure work well on hassos 3.10. You could order it in Amazon and install a 3.10 hassos powered hassio version. I had lots of issues with 3.11, that’s why I don’t dare to go above 3.10.

@Albertowue, not sure what’s going on why your’s isn’t working, but a few months ago I upgraded to a pi4 (so had to start over on the ssd) and I ended up using a different procedure, which is likely to work with the pi3 as well. In a nutshell, it requires a linux system (you can use a live usb for this if you only have windows rigs), you install just like you’re using an sd card, then you move the data partition from the sd to your ssd, and rename the partition on the sd card to something random (so hassos won’t use it). Then you resize the partition to fill out the ssd, boot it up, and all should work fine (more files on the ssd than just bootcode.bin, but same difference in that the files are only used at bootup… so all the heavy lifting is done in the data partition).

Here is a c/v with more detailed notes I took as I did it:

1- Flash latest hassos 32bit to sd card, and boot pi4 completing basic install.
2- Shutdown pi4, remove sd card.
3a- No Linux rig? Use etcher to make a live usb of linux mint, and boot that from any pc (note you may need to change your bios settings to boot from the usb).
3b- Open Gparted in Linux, format ssd with a primary ext4 partition, using all of the space
4- In Gparted locate the device names of the “data” partition on the sd card, and the ssd partition.
5- Use the command to copy the data partition to the ssd, this takes lots of time
(in my case, sdc8 is the sd card data partition, sdb1 is the ssd partition.
note the r/w byte size bs=10000000 speeds it up significantly vs the default 512):
sudo dd if=/dev/sdc8 of=/dev/sdb1 bs=10000000
6- Once complete, change the sd card partition label to “hassos-data-old”:
sudo e2label /dev/sdc8 hassos-data-old
7- Resize filespace to fit ssd partition (perhaps optional if HA does it for you?):
sudo resize2fs /dev/sdb1
7- Plug both the sd card and ssd back in to the pi4, boot up, and enjoy!

Hope this helps anyone who’s having issues with other methods mentioned above.

12 Likes

Thank you very much for this method! I didn’t know that it also works with HassOS. Now I have my data on a SSD attached via USB 3.
The first test didn’t work as the Pi 4B doesn’t like my USB-SATA M.2 Adapter (it worked on USB 2, but that was not what I wanted!). I am using now an enclosure for a 2,5" SATA SSD which works with a Pi 4B.

2 Likes

@carsten_h which enclosure are you using? I abondaned my Pi4b because of it not liking my enclosure. I would like to get back to using it.

I have three here that are working fine. All are for 2,5" SATA SSD/HDD.
https://www.amazon.de/gp/product/B07D2BHVBD
https://www.amazon.de/gp/product/B073TQZ1NJ
https://www.amazon.de/gp/product/B01G8OFFF6

This is not working:
https://www.amazon.de/gp/product/B07VGJLTRF

1 Like

I have been running Hassio without any issues on a USB SSD on a 4B for a few months now.

My understanding is that the 4B currently can only boot from the MircoSD.

To setup, I followed this: https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/ as mentioned above by kanga_who.

Basically, it keeps the boot partition on the MicroSD card, but uses the SSD drive for the other partitions. (You burn Hassio on both the MicroSD and the SSD, then make the MicroSD point to the SSD.)

For me, this means being able to can keep Hassio as the operating system. I don’t think there are any particular advantages in using one operating system or another. For me, though, the really big advantage was having the supervisor (putting updates and other OS-level operations into the HA UI). Also, being as close to default as I could, means I have less maintenance and fiddling to do (not that that’s bad, it’s just not for me).

Impressions
Going to an SD drive speeds things up amazingly. Just do it, it is worth it.

On a negative side, I had a 3B+ which booted directly to the SD drive (with no MicroSD in the slot), and it seemed a lot faster than the above at booting. Of course, the 4B with the SD drive connected via USB 3 will be faster during normal running, but really, it doesn’t seem that much faster. After all, how much computing power is needed on a deployed system?
I wonder about the worth of upgrading to a 4B.

The 4B is more power hungry, meaning it costs more to run every minute of every day or every year. But it’s faster, which I can notice as Node Red seems smoother. But does the extra speed for the occasional update justify the extra cost all round?

This is the case on my 4B:


(from: https://core-electronics.com.au/pimoroni-aluminium-heatsink-case-for-raspberry-pi-4-black.html)

I like that it’s a heatsink - and that it doesn’t have a fan (why spend energy to remove wasted energy?). (If you get one, the thermal conductive pads you get break easily, so take care!) Still, it’s very warm to the touch.

1 Like

truglodite’s method confirmed working by myself and others e.g. https://github.com/home-assistant/operating-system/issues/164#issuecomment-602145682

I have to agree with your comments on the pi4 being overkill for most use cases with HA. Even with my pi3b+, normal activity never had what I would call major issues. The web pages were generally a bit slower to load, but it’s not like I spend all day browsing my HA server, LOL. It was fast enough. For certain, if I had to process my ip cameras on my pi, I’d probably feel that even a pi4 isn’t enough. However, I bought an older Dell desktop for $200 to do all my VMS work with blue iris, so my HA pi sits idling most of the time.

For me the ‘do or die’ reason I upgraded to a pi4 was kind of silly really; to get esphome to compile reliably on the pi. The 3b+ would occasionally have issues with low ram when compiling; it would crash, and have to be power cycled to get it going again. That never happens on my pi4. That said, I could have persevered at setting up esphome compilation on my desktop instead (almost got that working, but I personally stumbled on some configs in PIO and couldn’t find the right help to get me through it… perhaps better docs here might save the world of a few wasted pi4’s).

So, should everyone get a pi4? Nah… maybe if you run your vms with HA, then maybe you need a full scale CPU anyways… or if you get annoyed with esphome compiling issues and you don’t want to work around that by compiling on a desktop, then yeah. Those are 2 commons reasons I could think of to reason having more than a pi3b+… and I’m sure there are other use cases that warrant more… but I think for the majority of use ‘non-advanced’ use cases a pi3 is plenty.

Matter of fact, if I ever do get esphome compiling on my desktop (any help appreciated :wink: ), I’d take that pi4 and use it to upgrade my retropie right away. :smiley:

1 Like

This was exactly what I was looking for, thanks @truglodite!

Are you referring to the USB Config stick that is used to import network settings? That doesn’t need to remain once the settings have been imported to the system.

Agreed @cogneato. However there was something that seemed to be related to having the old USB drive in place that once caused my former configuration with the Eluteng mSATA adapter and SSD drive to work. I don’t know if it was a timing issue involved with reading the USB drive or a drop back to an older protocol to support the old USB stick or what, but having the USB drive present seemed to enable my system, at least in the past, to boot from my mSATA. Can’t explain it, but that’s what I observed. Really wish I could get the mSATA solution to work on my RPi3b+

Looks like Pi4 USB boot is now out in beta… https://tynick.com/blog/05-22-2020/raspberry-pi-4-boot-from-usb/

2 Likes

Now as the USB boot is in beta, is there a way back to normal Installation?
Is it possible to shrink the filesystem on the SSD back and copy it to the SD card to make a complete clone of it on SSD?

When usb boot for pi4 is released, I plan on reinstalling hassos from scratch and restoring a snapshot. My guess is the official install method for usb boot with pi4 will be flashing the image to ssd using etcher, etc… and they probably wouldn’t add anything that breaks restoring snapshots along the way. So I am pretty confident this method will end up working well.

You are taking snapshots right? … and you have tested that they restore correctly? I have, and snapshots are working fine with the 'sd+ssd’s method. Don’t take backups for granted, especially if this isn’t a new system and there are many hours worth of configuration work to lose… never know what/when something might take out your drive.

Yes, I do.

No, not until now. But I think it is the time to do it.

I will look into a Howto to see how a snapshot is restored and what it all restores! Thank you, I also think that this is the better way.

New 5.4.42 Kernel is out!!! Time to try the SSD boot again on RPi4.

Since I have direct boot from SSD working on my RPi4 on Raspbian 5.4.42 kernel, I am pretty sure this should now be working on Home Assistant with 5.4.42.

EDIT: No joy. Still not working even with new 5.4.42 kernel.

So, with with HassOS rel 4 being now officially out (and after a successful update on my RPi4), has anyone tried the “move the data partition” feature in HassOS rel 4 yet? Any good guides available anywhere?

Of course the full SSD boot option would be an even better solution but I would be happy with boot partition being in SD and everything else being in SSD as well.

https://github.com/home-assistant/operating-system/pull/651

4 Likes

Answering to myself, the instructions seem to be here:

Time to invest on a suitable USB SSD adapter and a hard drive then :).

4 Likes

Did you found the datactl command? I’ve upgraded to hassos 4.8 but datactl is not available.

Same issue here. I SSH into port 22222 as root. Tried to execute datactl command, but returns

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