USB Boot on Raspberry Pi 4

@McGiverGim, after reading your post, i never checked the logs if the quirk is really applied and after studying the OS log, i saw that the usb.quirks was not applied, so it seems i am now running with UAS enabled stable for already more then 1 week :grinning:

I made the mistake not reading well and applied the quirk in the config.txt instead of cmdline.txt so that explains why usbquirk was not applied in my case.

I report now the following speed (with UAS), :

# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads:  899 MB in 3.00 seconds = 306662 kB/s
# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads:  815 MB in 3.00 seconds = 277945 kB/s
# hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads:  976 MB in 3.00 seconds = 333051 kB/s

I am using a Geekworm X825 with a Curcial BX500 240 GB SSD

Would be nice if everybody reports the speed they get with :

hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads:  802 MB in 3.00 seconds = 273685 kB/s
➜  ~ hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads:  803 MB in 3.00 seconds = 273752 kB/s

ELUTENG USB 3.0 to SATA Cable for 2.5" HDD or SSD Adapter 5Gbps High Speed Plug and Play Support UASP SATA I II III Hard Disk Drive USB S-ATA Converter

Crucial BX500 120 GB CT120BX500SSD1(Z)-Up to 540 MB/s (Internal SSD, 3D NAND, SATA, 2.5 Inch)

I am using quirks usb-storage.quirks=174c:55aa:u

If you are interested, it seems there is an addon to monitor SMART data of the SSD, that executes a test:

[Thu Aug  6 09:16:39 CEST 2020][Info] Run performance test
     Category                  Test                      Result              
HDParm                    Disk Read                  MB/s                    
HDParm                    Cached Disk Read           MB/s                    
DD                        Disk Write                171 MB/s                 
FIO                       4k random read            4599 IOPS (18396 KB/s)   
FIO                       4k random write            IOPS ( KB/s)            
IOZone                    4k read                   21472 KB/s               
IOZone                    4k write                  16395 KB/s               
IOZone                    4k random read            15465 KB/s               
IOZone                    4k random write           22464 KB/s               
                          Score:                                             
Compare with previous benchmark results at:
https://storage.jamesachambers.com/ 
[Thu Aug  6 09:18:22 CEST 2020][Info] Performance test end

You can get it from here:

EDIT: When I start the addon Home Assistant restarts at the end of the test. It seems only once, but I don’t know why.

1 Like
RandRead: 15004 - RandWrite: 21512 - Read: 22311 - Write: 16936

     Category                  Test                      Result              
HDParm                    Disk Read                 160.46 MB/s              
HDParm                    Cached Disk Read          246.51 MB/s              
DD                        Disk Write                117 MB/s                 
FIO                       4k random read            4139 IOPS (16556 KB/s)   
FIO                       4k random write           4813 IOPS (19252 KB/s)   
IOZone                    4k read                   22311 KB/s               
IOZone                    4k write                  16936 KB/s               
IOZone                    4k random read            15004 KB/s               
IOZone                    4k random write           21512 KB/s               

                          Score: 4988             

My own results

Hi all
may I ask a dummy question
how download the dev image for rasp pi usb boot?
tks

Maybe to much, but for those who want Debian 10(buster) 64Bit running on SSD/USB on RPi4

https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip

Flash image on a SDCard. Add SDcard and your SSD to your RPi4
You can also add already ssh option and you wifi settings on the /boot/ partition of SDcard

Remove the old dphys version

sudo /etc/init.d/dphys-swapfile stop
sudo apt-get remove --purge dphys-swapfile

Refresh your OS

sudo apt-get update
sudo apt-get full-upgrade

Prepare RPi4 for USB Boot

Refresh your OS with the latest firmware

sudo nano /etc/default/rpi-eeprom-update
sudo rpi-eeprom-update -d -a
reboot

Install RPICLONE (For cloning from SDCard to my SSD, my SSD is /dev/sda, yours can be different)

git clone https://github.com/billw2/rpi-clone.git 
cd rpi-clone
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin
sudo rpi-clone sda

After RPICLONE is done open a new terminal window

nano /mnt/clone/boot/cmdconfig.txt

Add rootdelay=5 cgroup_memory=1 cgroup_enable=memory to the line and save the file.
Exit the terminal

shutdown now

Remove the SDCard and boot from SSD now.
Correct location and timezone

raspi-config

Install Docker

sudo -i
apt-get install software-properties-common -y
apt-get update
apt-get install modemmanager
reboot now

Reason I install modem manager first and reboot, because when do with network-manager my RPi freeze

apt-get install network-manager
apt-get install apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq socat bash curl 
curl -fsSL get.docker.com | sh

Install Hass.io

systemctl stop ModemManager
systemctl disable ModemManager
curl -sL https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh | bash -s -- -m raspberrypi4

DONE

Here some links I get the information from:


https://www.uberbuilder.com/using-rpi-clone/

Things went downhill fast today…

This afternoon I had a perfectly running HassOS 5.1 x64 image running from a USB thumb drive, installed two weeks ago. But I ran into trouble when trying to add a Arduine Mega peripheral, as I couldn’t boot the device due to the Arduino messing up the boot order.

First I’ve tried to put in a bootable SD card (with a fully updated minimal install) and put the exact PARTUUID in the boot order to get it to boot. That didn’t work as planned.

So after hours of trials and failing, I upgraded the firmware today to the latest version and fiddled a bit with the bootloader and bootorder. I have checked the boot order and it looks correct (0xf41) but somehow my Pi won’t boot into the USB thumb drive any longer. No matter what I try. All it does is the 4x-blinking green LED, telling me there is nothing to boot.

As I have a recent backup of my hassOS install, I decided to re-flash the thumb drive with the HassOS image. Nothing but the green blinking LED. Any idea of what I’m doing wrong? Might have to revert to a manual Hassio install…

UPDATE 1
I realized this doesn’t work without me posting used hard- and software specs.
Raspberry Pi 4B 4GB
Raspberry Pi USB-C power supply
Sandisk Extreme Pro USB 3.0 128GB (flashed with HassOS 64-bit v.5.1 dev image for the Pi)
Raspbery Pi OS (5.4.61-v7l+)
Bootloader version: Jul 31 2020 14:43:39 (release)
Bootloader config:

[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
TFTP_IP=
TFTP_PREFIX=0
BOOT_ORDER=0xf41
[none]
FREEZE_VERSION=0

Eeprom status

BCM2711 detected
Dedicated VL805 EEPROM detected
BOOTFS /boot
BOOTLOADER: up-to-date
CURRENT: Fri 31 Jul 13:43:39 UTC 2020 (1596203019)
 LATEST: Fri 31 Jul 13:43:39 UTC 2020 (1596203019)
 FW DIR: /lib/firmware/raspberrypi/bootloader/stable
VL805: up-to-date
CURRENT: 000138a1
 LATEST: 000138a1

UPDATE 2
Must have been an integrity issue with the bootloader. Quick fix was a reset to the latest stable release

sudo rpi-eeprom-update -a -d

And all is well. My apologies for taking your time.

Hi, A have the same problem! It works fine with Raspbian, but black screen with Hassio!

I’m using a PI4 4GB + CSL USB 3.0 Type A adapter - this works fine on my PI3B+ with 4.13. PI4 arrived today and i’ve upgraded to the Sep bootloader fine but drive plugged in i see the ‘bios’ screen and then things go black… no boot. Tried 5.1 dev build (32bit) to no avail so far…

Going to blow raspian onto the drive to see if that boots.

…and it does. Oh dear.

Am sitting looking at a working Raspian desktop entirely running orf SSD.

HassOS be dead :frowning:

USE 64BIT version

3 Likes

With 64bit HA runs better then ever before!

I also mention this in my install steps some posts before

Hilarious - booted first time - thanks!

Hello all
Initially I though it will be easy task, but…

I have Pi4 8GB. upgraded its firmware to recent one (Sept 3rd). Succeeded to boot from SSD with HassOS v5.2 image burned on it.

Unfortunately, it refuse to boot up again after toggling power off and on.
This is the last thing which is displayed before Pi repeatedly restarts on its own

BTW is it possible to ssh to hassos with no containers/supervisor running? All guides point to ssh addon which is pointless without supervisor

with regards

I think I found the root cause of failing boot after reboot, but not double checked it. I don’t know is it expected behaviour or issue I should report on github.

Initially I started testing ssd boot at place where there is no wired connectivity available. I thought I can temporally use wifi. Unfortunatelly I failed connecting hassos with my wifi network.
Anyway, the first boot gave access to hassos but none containers got up bacause it required network connection (to download docker images I suppose).

Failing in the midfle of first boot process likely caused some damage to the system.

Anyway, when I connected my RPi do LAN, whole process went flawless. It boots from usb2 as well as usb3 without quirks.

Interesting thing, connecting the ssd to usb3 under Raspbian causes increased cpu load and makes keyboard/mouse both connected to usb2 not responding. Under HassOS I see no such problems with the keyboard.

For reference:
RPI 4 8GB
SSD Samsung V300 connected through some SATA-USB3 cable

Sorry to jump in here. This seems to be the best thread on this.

Im trying to get HA on a new RPi4 2gb-64bit.

It appears the usb(SSD) booting was just added not to long ago, but I’ve yet to get mine working. Can anyone point me in the newest install option?

I can confirm with Vlad’s instructions that this is working on Raspberry pi 4 8GB when previously it was not. The big thing I think everyone is hitting a wall at is the bootloaders being up to date and not being able to go backwards on the version. I had to download the July version of the bootloader on the 16th.

  1. I had to go to the following URL: https://github.com/raspberrypi/rpi-eeprom/releases
  2. Look for the eeprom listed: rpi-boot-eeprom-recovery-2020-07-16-vl805-000138a1-STABLE
  3. Extract the files from the zip and winscp or SCP transfer the files into the /home/pi directory.
  4. Run the following command to revert the eeprom to July 16th. Please note you must be in the same directory in where you put the files via SCP. sudo rpi-eeprom-update -d -f ./pieeprom-new.bin
  5. sudo reboot the system and wait for it to boot up and shut it down and replace the MicroSD card with the SSD in the USB 3.0 Port.

Please note as well, now that I started to think about this. You can use wget to receive the files into the /home/pi directory and unzip it from there.

I have been able to boot my Rpi4 HA installation (installation described here) from a USB flash drive for sometime. Originally I needed to use a SD card for the boot process but with the FW update this card is no longer needed

Recently I installed HA ( This version as well as This version) on a flash drive. Neither of these versions would boot using the same Rpi4 as above.

Is there another step I have to do to get either of these versions to boot? Bear in mind I do have the Rpi4 booting this version without issue.

Update the bootloader as described above and then apply version 5.2 64bit

1 Like