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

So the second line should be before the first (must do the update first) The upgrade is redundant if you do a dist-upgrade too. Can put the lot in one command:

sudo apt-get update && sudo apt-get Disto-upgrade -y && sudo apt-get autoremove -y
1 Like

Good to know. I’ve never had any issues running them they way I posted, but thanks for the pointer.

Hi, I’m facing here a weird situation, I will appreciate if someone can shed some light for me about what am I doing wrong -

The HW in question:
RPi 3B and RPi 3B+
SSD 120GB Kingston A400
no name USB3-SATA3 with power and access leds
all kind of USB flash drives - couple of kingstons and other no names

No matter which OS (HASSOS or 2019-04-08-raspbian-stretch), no matter if on SSD or USB flash drives, no matter if on RPi 3B+ or on RPi 3B with sdcard holding bootcode.bin + timeout files (no OTP change) - the RPi doesn’t load (only power red led is on, screen is black) and none of the leds of the flash drives or USB3-SATA3 adapter are on.

If I load an RPi with raspberry OS on sd card and then plug the flash drive and or the SSD adapter, their leds are shown clearly as the OS access their content.

Any idea?
Thanks!

Check my messages above and do the same tests I did, which are explained in the RPI forum

Thanks @kitus. I followed your posts + the link to the raspberry forum. Couldn’t find the culprit. Forgot to mention that I use original Raspberry 5V, 2.5A charger.
It seems like the SDD/Flash drives are not being accessed on the boot process. When booting using SD card with raspbian OS, they appear as external disks, allowing read/write. If at least the flash was working, I could suspect the USB3-SATA3 adapter, but as the flash doesn’t work, I have no reason to believe the SSD will work with different adapter. It’s not even about hassos/hassio as I’ve tested also with raspbian.
Any thoughts?

[EDIT]
After numerous retries it started to work. No clue why all of a sudden…

Today I tried to boot from an SSD but nothing worked.

This is the hardware I have

  1. Raspberry pi X850 mSATA SSD disk expansion board supports 1TB USB 3.0 (link)
  2. KingSpec mSATA SSD 64GB (link)
  3. Raspberry Pi 3 B+

I even added the following lines to my SD and SSD files:

I changed the “root” option in cmdline.txt

root=/dev/sda2

config.txt, at the end:

program_usb_boot_mode=1

Last part will give you option to boot from usb. Burn image in ssd and do nothing else. It will boot from ssd.

Whats the best way to burn image to ssd? Etcher keeps destroying my ssd…

Strange. Also use Etcher (BalenaEtcher). Burn the image to SSD. What you can do is before you start edit your cmdconfig.conf and remove the last part (resize). When you boot and done you can try this:

sudo fdisk /dev/sda

Command (m for help): p
Command (m for help): d
Partition number (1,2, default 2): 2
Command (m for help): n
Select (default p): p
Partition number (2-4, default 2): 2
First sector (532481-500118191, default 589815): 540672 (enter the start value exactly as it was)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (540672-500118191, default 500118191): (press enter to accept default which is the full disk)

Do you want to remove the signature? [Y]es/[N]o: n (don't remove signature)

Command (m for help): w

reboot now

after reboot

sudo resize2fs /dev/sda2

OK cool, I am currently checking my SSD for bad clusters (going to take a long time). Maybe my drive is no good.

1 Like

Keep us updated. Wanted to go for the same setup :slight_smile:

Here is how I did it in past on RPi3 (now have everything running on RPi4 ssd)

Burn Stretch Lite and !!! remove line for resize on bootup !!!

Enable SSH

touch ssh

Config WiFi

sudo nano /boot/wpa_supplicant.conf

Add line:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
network={
ssid=“YOUR SSID”
psk=“YOUR PASSWORD”
}
apt update -y*
apt upgrade -y

Resize SSD (only when resize action is removed in cmdconfig.conf

sudo fdisk /dev/sda

Command (m for help): p
Command (m for help): d
Partition number (1,2, default 2): 2
Command (m for help): n
Select (default p): p
Partition number (2-4, default 2): 2
First sector (532481-500118191, default 589815): 540672 (enter the start value exactly as it was)
Last sector, +/-sectors or +/-size{K,M,G,T,P} (540672-500118191, default 500118191): (press enter to accept default which is the full disk)
Do you want to remove the signature? [Y]es/[N]o: n (dont remove signature)
Command (m for help): w

reboot now

after reboot

sudo resize2fs /dev/sda2

Phyton 3.7.0 Compile

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev libncursesw5-dev libreadline-gplv2-dev libgdbm-dev libc6-dev libffi-dev
sudo apt-get install -y libreadline-dev libncurses5-dev
cd /usr/src
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
tar xvf Python-3.7.4.tgz
cd Python-3.7.4
./configure --enable-shared --enable-optimizations
make -j8
sudo make altinstall
python3.7 -V

Install Docker

sudo -i
apt-get install software-properties-common -y
apt-get update
apt-get install apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq socat
apt-get install* *network-manager
curl -fsSL get.docker.com | sh

Install Hass.io

curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s -- -m raspberrypi3

After about 20 Min login via WebUI.

Here my install method on SSD and RPi4

Flash on SD Card Debain Buster Lite Image

sudo touch ssh
sudo nano /boot/wpa_supplicant.conf

Add line:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
network={
ssid="YOUR SSID"
psk="YOUR PASSWORD"
}

Format SSD full with FAT Partition (don’t know if this needed for next step)

sudo mkfs.ext4 /dev/sda1 -L root
sudo mkdir /media/newdrive
sudo mount /dev/sda1 /media/newdrive
sudo rsync -avx --progress / /media/newdrive
sudo nano /boot/cmdline.txt

replace “root=” with follow line

root=/dev_/sda1 rootfs_type=ext4 root_wait rootdelay=5
reboot now

First part (boot) from SDCard, rest from SSD :slight_smile:

That is just for the OS right? And for hassio after? Just use generic linux host install method?
And if I use ethernet just ignore this part?

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=NL
network={
ssid="YOUR SSID"
psk="YOUR PASSWORD"
}

When connected to eth0 then you don’t do anything else. Maybe something to make your IP static.

My current cmdline.txt is this:
console=serial0,115200 console=tty1 root=PARTUUID=6c58e13-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspbi-config/init_resize.sh

What do I change it to?

Also sudo mkfs.ext4 /dev/sda1 -L root gives error: /dev/sda1/ is mounted; will not make a filesystem here!

umount sda first

remove the part

init=/usr/lib/raspbi-config/init_resize.sh

root=PARTUUID=6c58e13-02 > root=/dev/sda1

Ok so here is what I am doing:

  1. Balena etcher Raspbian buster lite onto 64GB SD card
  2. 120gb OCZ SSD connected via X825 SATA board for the pi4.
  3. Boot to the raspbian console and execute:
sudo mkfs.ext4 /dev/sda1 -L root
sudo mkdir /media/newdrive
sudo mount /dev/sda1 /media/newdrive
sudo rsync -avx --progress / /media/newdrive
sudo nano /boot/cmdline.txt

I can see all files copying across just fine.
4. Update cmdline.txt to: console=serial0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
5. Reboot
7. Keep getting error and the command line is not loading (until I unplug the SSD)

Not sure where it’s failing over

Got it to work in the end but with the desktop version of raspbian: https://www.element14.com/community/community/raspberry-pi/blog/2019/08/30/quick-sd-to-ssd-on-the-pi-4 not sure why the buster lite doesn’t work

1 Like

Hi, I’ve made a video about installing home assistant on a SSD with a Raspberry pi 3B. Hope this will help someone.

7 Likes