Raspberry Pi 3 With Bootable SSD Drive

55K1610

Intro: Raspberry Pi 3 With Bootable SSD Drive

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.

WARNING:

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.

STEP 2:

You need to enable USB boot, by adding following code at the very bottom of config.txt file:

program_USB_boot_mode=1

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.

STEP 3:

Download GParted Live CD/USB image and save it on your computer

https://gparted.org/livecd.php

Use Etcher, to flash it to USB stick.

STEP 4:

Download and save OLD ResinOS version of Home Assistant (Raspberry Pi3 version)

https://github.com/home-assistant/hassio-build/rel...

Use Etcher, to flash it to your SSD Drive (Or different USB Device)

STEP 5:

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).

STEP 6:

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).

STEP 7:

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).

WARNING:

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.

STEP 8:

Navigate again to Resin-boot partition in My computer and find two files:

config.txt

cmdline.txt

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.

8 Comments

Is this procedure still valid and working ?
Up to my knowledge, yes. Although I have to admit, I no longer use that solution.
Any idea how long you have to wait for the pi to boot from the msata? I did all the above and I got a solid blue LED from the msata board but no booting. Is this normal?
No, it is not normal. If you have the same board as me, red and green leds should be flashing all the time, indicating activity. Of course, first boot (after flashing ssd with hassio image) is taking longer (even 20 minutes), but after that, each RPi3 restart takes about a minute. What I would suggest, is to change USB bridge (the one that powers and sends data between Pi and board). Simply use a USB cable instead of bridge. Other possibility could be faulty SSD drive, not enough power from power suply to RPi3.
Thank you very much for you answer.
I have the revised board by the same company which should be as good if not better for booting up.

I gave up in the end. Repeated the process 3 times to no avail. The blue LED of the ssd board was initially switching 4-5 times and then remained solid forever. Of course, there was no GUI at :8123 or any indication on the Ethernet port (leds) that the network part of the server is working.

I would have claimed I'm doing something wrong but it's not possible as I followed all the above you wrote in every detail as well as what others have done in the original post over at the Home Assistant forum.

I ended up flashing the new Hass.io image onto an sd and hoping there will be an easy way soon to transfer the filesystem to a USB drive.

I'm coming from Openhab where moving root filesystem to USB drive is being done by a single command and wasn't expecting such a hassle here really.
I am sorry to hear that. And yes, I agree, there should be an easy (or at least easier) way to port whole system from SD to SSD (or any other media in fact). But Hassio is still in its toddler age, so let's hope it will be available one day.
Thanks. I simply followed others instructions, making some amendments and that is the result.