First of all, I strongly suggest, you first make copy (Snapshot of your existing HA) and try this method with new installation of Home Assistant and test it for few days, if there is no errors. Keep your SD Card with current Hass.io instance safe, so if in any trouble, you can simply replace SSD drive with SD Card and return to previous Home Assistant within minutes.
YOU HAVE BEEN WARNED!!!
Step 1: Requirements:
Raspberry Pi 3b and 3b+ (only Pi 3's support USB boot)
- OLD ResinOS Home Assistant version (HassOS currently DOES NOT support USB Boot)
- mSATA SSD drive (recommended minimum 16GB)
- x850 storage expansion board
- USB flash drive (minimum 1GB)
- GParted CD/USB boot image (https://gparted.org/livecd.php)
- Currently running or new ResinOS system (on SD Card)
If you have Raspberry Pi 3b+, probably you can skip step 1 (I don't have, so I am not sure of it). If you own Raspberry Pi 3b, proceed.
THIS PROCESS CAN NOT BE UNDONE. ONCE USB BOOT IS ENABLED, IT CAN'T BE REVERSED.
Although this this not affect anything, as you can still use SD card after that, if you wish.
You need to enable USB boot, by adding following code at the very bottom of config.txt file:
File is located on resin-boot partition. It is the only FAT partition on your SD Card, which is in Raspberry Pi. Simply put it in your computer and navigate to resin-boot partition, scroll down to last line and insert above code and save on exit. Safely remove SD Card from computer, put it back in your Raspberry Pi 3b and attach power cable. Let it boot. It should boot as normal.
Now your Raspberry Pi 3 is capable to boot from USB.
Download GParted Live CD/USB image and save it on your computer
Use Etcher, to flash it to USB stick.
Download and save OLD ResinOS version of Home Assistant (Raspberry Pi3 version)
Use Etcher, to flash it to your SSD Drive (Or different USB Device)
After flashing is complete, safely remove SSD drive and connect it again (if for any reason, resin-boot partition does not show up in My Computer, right click on My Computer > Manage > Manage drives > right click Resin-boot partition > Change Disk Letter and assign new drive letter manually).
Reboot your PC to BIOS and change boot options, so it boots from your GParted USB stick.
After computer boots from USB stick, you shouldn't really change anything, just press Enter 4x, so it loads to GParted GUI. (Your SSD drive should already be attached to computer, so GParted detects it properly).
Now, in GParted, make sure you have selected correct drive (SSD drive). Now you need to change size of two partitions:
dev/sdb4 and dev/sdb6 (This could also be sda4 or sdc4 and sda6 or sdc6, depending how many drives was discovered).
It should not really matter, how much you are going to change (increase) the size of dev/sdb4. Myself, I went from 1GB to 3GB (You can go ahead and simply try to use whole available space).
Now, you can increase the size of dev/sda6, which should be changed to whats availabe after changing size of dev/sdb4 (in a nutshell, sdb6 partition is within sdb4).
USE THE BAR ON TOP TO CHANGE SIZE. MAKE SURE THAT SIZE AT THE BEGINING OF THE PARTITION DOES NOT CHANGE (IN MY CASE IT WAS 4MB), OTHERWISE YOU MAY GET INFORMATION, THAT DRIVE MAY NOT BOOT PROPERLY.
After changing sizes, Apply it and wait till it is finished.
Now you can shut down GParted and boot to Windows again.
Navigate again to Resin-boot partition in My computer and find two files:
Editing config.txt is probably optional, as our Raspberry Pi 3 is already capable of booting from USB, but I simply followed others instructions:
In config.txt again, add following line at the very bottom of the file: program_USB_boot_mode=1
In cmdline.txt, change the following:
root=/dev/mmcblk0p2 (or similar) to root=/dev/sda2 (NOT sdb2 or sdc2, as you probably had it in GParted).
OPTIONAL: I have configured "resin-sample" file with my network settings (static IP assigned to my Raspberry Pi3). If you have one as well, you can replace oryginal file with yours in /resin-boot/system-connections/resin-sample)
After saving both files, safely remove SSD Drive and attach it to your Raspberry Pi 3.
Step 9: Finishing...
That's pretty much it, your Raspberry Pi 3 should now boot from USB and start installation process of Home Assistant, which should take about 10-15 minutes. After that, Home Assistant instance should be available at 192.168.xxx.xxx:8123 (whatever IP you set up for your Pi3).
Step 10: OPTIONAL...
Another steps below are also OPTIONAL:
- Setup new account
- Log in to your HA
- Install and configure samba addon
- Navigate to HASSIO share on you computer
- Copy Snapshots of previously made backups of your Home Assistant and paste them in backup share
- Restart Home Assistant
- Snapshots may not be available immediately, give it few minutes and press Refresh button in top right corner
- Select latest Snapshot and restore setting (I WOULD NOT restore Home Assistant itself, only config files, so make sure you untick Home Assistant)
- Press Restore Selected (DO NOT press WIPE & RESTORE) - Give it few minutes for the process to finish -
OPTIONAL: To avoid errors, delete home-assistant_v2.db file in config folder.