nikoee
Posts: 16
Joined: Thu Jun 03, 2021 10:14 am

Pi Zero Boot from SSD

Thu Jun 03, 2021 10:21 am

Hi,

I have done quite a lot of searching and can only find information to run the boot loader off a SD card and then run the OS off of the SSD.

I am interested in stability, not speed.
This is why I would like to know if it is possible to remove the need for a SD card, and run the Pi Zero completely off a SSD connected via SATA-USB2.0 cable.

From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 11:48 am

nikoee wrote:
Thu Jun 03, 2021 10:21 am
Hi,

I have done quite a lot of searching and can only find information to run the boot loader off a SD card and then run the OS off of the SSD.

I am interested in stability, not speed.
This is why I would like to know if it is possible to remove the need for a SD card, and run the Pi Zero completely off a SSD connected via SATA-USB2.0 cable.

From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.

https://www.raspberrypi.org/documentati ... /README.md
Take what I advise as advice not the utopian holy grail, and it is gratis !!

nikoee
Posts: 16
Joined: Thu Jun 03, 2021 10:14 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 12:48 pm

fruitoftheloom wrote:
Thu Jun 03, 2021 11:48 am
nikoee wrote:
Thu Jun 03, 2021 10:21 am
Hi,

I have done quite a lot of searching and can only find information to run the boot loader off a SD card and then run the OS off of the SSD.

I am interested in stability, not speed.
This is why I would like to know if it is possible to remove the need for a SD card, and run the Pi Zero completely off a SSD connected via SATA-USB2.0 cable.

From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.

https://www.raspberrypi.org/documentati ... /README.md
Hi - thank you very much.

I have worked my way into https://github.com/raspberrypi/usbboot

I followed the instructions:
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
sudo apt install libusb-1.0-0-dev
make
sudo ./rpiboot

Then all it says is rpiboot stuck on waiting for BCM2835/6/7/2711

Is usbboot correct for my application? Using SSD as boot drive?

Sorry I am not that experienced with this stuff.

fruitoftheloom
Posts: 27225
Joined: Tue Mar 25, 2014 12:40 pm

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 12:58 pm

nikoee wrote:
Thu Jun 03, 2021 12:48 pm
fruitoftheloom wrote:
Thu Jun 03, 2021 11:48 am
nikoee wrote:
Thu Jun 03, 2021 10:21 am
Hi,

I have done quite a lot of searching and can only find information to run the boot loader off a SD card and then run the OS off of the SSD.

I am interested in stability, not speed.
This is why I would like to know if it is possible to remove the need for a SD card, and run the Pi Zero completely off a SSD connected via SATA-USB2.0 cable.

From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.

https://www.raspberrypi.org/documentati ... /README.md
Hi - thank you very much.

I have worked my way into https://github.com/raspberrypi/usbboot

I followed the instructions:
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
sudo apt install libusb-1.0-0-dev
make
sudo ./rpiboot

Then all it says is rpiboot stuck on waiting for BCM2835/6/7/2711

Is usbboot correct for my application? Using SSD as boot drive?

Sorry I am not that experienced with this stuff.

The link clearly states USB Boot on the Zero is not supported, and an SD Card is required to boot up, whilst the Operating System is on the SSD.




Special bootcode.bin-only boot mode

........

This is useful for the Raspberry Pi 1, 2, and Zero models, which are based on the BCM2835 and BCM2836 chips
Take what I advise as advice not the utopian holy grail, and it is gratis !!

drgeoff
Posts: 13379
Joined: Wed Jan 25, 2012 6:39 pm

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 1:04 pm

You only have to read the bold sentence at the top of https://www.raspberrypi.org/documentati ... des/msd.md to know that you are wasting your time.
Quis custodiet ipsos custodes?

nikoee
Posts: 16
Joined: Thu Jun 03, 2021 10:14 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 1:12 pm

drgeoff wrote:
Thu Jun 03, 2021 1:04 pm
You only have to read the bold sentence at the top of https://www.raspberrypi.org/documentati ... des/msd.md to know that you are wasting your time.
I was sent links to that page and just assumed it was an instruction that would apply to the pi zero too because it was linked to it. I saw that but assumed since it was linked to me maybe its not recommended but would work.

ejolson
Posts: 10502
Joined: Tue Mar 18, 2014 11:47 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 3:30 pm

nikoee wrote:
Thu Jun 03, 2021 10:21 am
I am interested in stability, not speed.
This is why I would like to know if it is possible to remove the need for a SD card, and run the Pi Zero completely off a SSD connected via SATA-USB2.0 cable.
From a reliability point of view, using an SD card for the boot and a USB SSD for the root may be better than putting both on the same device. The reason for this is the wear and usage patterns for the boot partition are much different than the root.

In particular, heavy read write usage of the root partition coupled with wear leveling algorithms used for flash memory on hardware without power-loss protection is what generally leads to a non-bootable Pi. Placing root on the SSD means that boot is the only thing left on the SD card. Since very little read write activity occurs with the boot partition, the SD card consequently is much less likely to experience a fault and the Pi more likely to boot as a result.

jbudd
Posts: 2089
Joined: Mon Dec 16, 2013 10:23 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 3:39 pm

I am interested in stability, not speed.
With the Zero you must have an SD card, but it only needs the file bootcode.bin, everything else is on the SSD.
I don't think anything gets written to the SD card so it should be stable and long lasting.

W. H. Heydt
Posts: 16107
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 3:59 pm

nikoee wrote:
Thu Jun 03, 2021 10:21 am
From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.
That's because no Pi prior to the Pi4B has an EEPROM chip on the board.

The fundamental problem you are running into is that the BCM2835 (the SoC on the Pi0) has a ROM bootloader that only knows about the SD card. So it has to read something from the card that knows to look for another device to continue with the next boot stage.

It was only with the Pi3B (and, later, the Pi2Bv1.2) that the SoC ROM was able to look for USB attached mass storage devices. If you really want a smaller (than a B-series) board that will boot from USB, you might consider the Pi3A+.

ejolson
Posts: 10502
Joined: Tue Mar 18, 2014 11:47 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 4:10 pm

W. H. Heydt wrote:
Thu Jun 03, 2021 3:59 pm
nikoee wrote:
Thu Jun 03, 2021 10:21 am
From my understanding the Pi Zero doesn't have USB boot like the Pi 4 has. I used the 'sudo rpi-eeprom-update -d -a' method previously to run the Pi4 from SSD, but when I use the command on the Pi Zero it states it is a command only compatible with Pi 4.
That's because no Pi prior to the Pi4B has an EEPROM chip on the board.

The fundamental problem you are running into is that the BCM2835 (the SoC on the Pi0) has a ROM bootloader that only knows about the SD card. So it has to read something from the card that knows to look for another device to continue with the next boot stage.

It was only with the Pi3B (and, later, the Pi2Bv1.2) that the SoC ROM was able to look for USB attached mass storage devices. If you really want a smaller (than a B-series) board that will boot from USB, you might consider the Pi3A+.
It's also worth mentioning that if you want stability over speed with a Pi Zero, it might be a good to clock it back to 700 MHz and turn off the default overvolt as well.

My understanding is that 700 MHz was the design specification of the SOC. I've had good luck increasing the stability by turning off the default overclock settings.

pidd
Posts: 4411
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 4:15 pm

ejolson wrote:
Thu Jun 03, 2021 3:30 pm
From a reliability point of view, using an SD card for the boot and a USB SSD for the root may be better than putting both on the same device. The reason for this is the wear and usage patterns for the boot partition are much different than the root.

That might be true for some HDD's but a SSD doesn't physically section storage into partitions, the SSD will map any content to any cell it wants.

ejolson
Posts: 10502
Joined: Tue Mar 18, 2014 11:47 am

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 9:36 pm

pidd wrote:
Thu Jun 03, 2021 4:15 pm
ejolson wrote:
Thu Jun 03, 2021 3:30 pm
From a reliability point of view, using an SD card for the boot and a USB SSD for the root may be better than putting both on the same device. The reason for this is the wear and usage patterns for the boot partition are much different than the root.
That might be true for some HDD's but a SSD doesn't physically section storage into partitions, the SSD will map any content to any cell it wants.
That's right. The reason I said greater reliability can result when boot and root partitions are on a separate devices is because flash cells can move between partitions as a result of wear leveling.

RonR
Posts: 3024
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Pi Zero Boot from SSD

Thu Jun 03, 2021 10:06 pm

nikoee wrote:
Thu Jun 03, 2021 10:21 am
I have done quite a lot of searching and can only find information to run the boot loader off a SD card and then run the OS off of the SSD.

Running Raspbian from USB Devices : Made Easy

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Fri Jun 04, 2021 12:47 pm

jbudd wrote:
Thu Jun 03, 2021 3:39 pm
I am interested in stability, not speed.
With the Zero you must have an SD card, but it only needs the file bootcode.bin, everything else is on the SSD.
I don't think anything gets written to the SD card so it should be stable and long lasting.
Can anyone suggest a good guide for migrating from an SDcard install on a zeroW to sd boot and ssd root?

swampdog
Posts: 972
Joined: Fri Dec 04, 2015 11:22 am

Re: Pi Zero Boot from SSD

Fri Jun 04, 2021 1:55 pm

alexnh wrote:
Fri Jun 04, 2021 12:47 pm
jbudd wrote:
Thu Jun 03, 2021 3:39 pm
I am interested in stability, not speed.
With the Zero you must have an SD card, but it only needs the file bootcode.bin, everything else is on the SSD.
I don't think anything gets written to the SD card so it should be stable and long lasting.
Can anyone suggest a good guide for migrating from an SDcard install on a zeroW to sd boot and ssd root?
Depends if you know a bit about partitions and filesystems or not. One of my rpi4 with ssd still boots off sdcard. It's fairly trivial. Clone the sdcard to ssd using method of choice then alter /sdcard/boot/cmdline.txt so it points to /ssd/rootfs/ and modify /ssd/rootfs/etc/fstab accordingly.

The trouble is you need to make decisions pertinent to your use-case. There's no need to have /ssd/boot/ (for instance) but it can be useful to have a copy of /sdcard/boot/ but that means writing/using a personalised apt-get update/upgrade script. It may be useful/required to not use PARTUUID (at least temporarily) during the process. Your ssd is likely to be larger than the sdcard so you'll need to expand /ssd/rootfs/ and the point at which you do this can be made easier/harder depending on if you have a linux PC handy. A final note: moving to an ssd is an opportunity to split out /rootfs/ into more than one partition (not as trivial). I do not know if an rpiZ will boot off a gpt disk.

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Fri Jun 04, 2021 2:08 pm

I am running a pihole DNS server with openvpn and a mqtt/node-red/grafana/influxdb combination to receive, log and view some home automation data. This is all on a pi zero w. I want to start using a Samsung SSD and SATA USB adapter. The pi seems to be passing enough power on to the SSD but maybe I won't really know until I put the system on it.

I know a bit about partitions and so on from Linux installs and repartitioning in the past (like ten years ago) but it's all a bit rusty.

RonR
Posts: 3024
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Pi Zero Boot from SSD

Fri Jun 04, 2021 5:54 pm

alexnh wrote:
Fri Jun 04, 2021 12:47 pm
jbudd wrote:
Thu Jun 03, 2021 3:39 pm
I am interested in stability, not speed.
With the Zero you must have an SD card, but it only needs the file bootcode.bin, everything else is on the SSD.
I don't think anything gets written to the SD card so it should be stable and long lasting.
Can anyone suggest a good guide for migrating from an SDcard install on a zeroW to sd boot and ssd root?

usb-boot totally automates the job for you.

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Fri Jun 04, 2021 6:41 pm

Oh great, I misunderstood some of the posts above which I thought were suggesting it didn't work on a zero.

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:08 pm

I'm sorry if I'm being dense but I've tried following the instructions in the usb-boot guide and nothing happens. What do I have to do to initiate usb-boot so I can transfer the sdcard files (i.e the current OS) to the SSD, bearing in mind this is via SSH. I have prepared another sd card with bootcode.bin.

RonR
Posts: 3024
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:15 pm

alexnh wrote:
Sat Jun 05, 2021 8:08 pm
I'm sorry if I'm being dense but I've tried following the instructions in the usb-boot guide and nothing happens. What do I have to do to initiate usb-boot so I can transfer the sdcard files (i.e the current OS) to the SSD, bearing in mind this is via SSH. I have prepared another sd card with bootcode.bin.

There's no 'another sd card with bootcode.bin' involved.

1. Back up your original SD card (just to be safe).

2. Download usb-boot.zip.

3. Unzip usb-boot.zip

4. Make usb-boot executable with 'chmod +x usb-boot'.

5. Run usb-boot with 'sudo ./usb-boot'.

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:20 pm

I don't understand. It says a zero requires an Sdcard with bootcode?

RonR
Posts: 3024
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:22 pm

alexnh wrote:
Sat Jun 05, 2021 8:20 pm
I don't understand. It says a zero requires an Sdcard with bootcode?

What says that?

User avatar
rpdom
Posts: 21168
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:33 pm

I think that there is some confusion between RonR's usb-boot and Raspberry Pi's usbboot programs. They do very different things.

In order to boot a PI Zero from a USB storage device you do still need an SD card with bootcode.bin on. The rest of the software can be on a USB storage device.
Unreadable squiggle

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:35 pm

In this thread, above. The pi zero cannot boot directly from SSD, it requires an Sdcard with bootcode.bin.

alexnh
Posts: 15
Joined: Fri Jun 04, 2021 12:44 pm

Re: Pi Zero Boot from SSD

Sat Jun 05, 2021 8:37 pm

rpdom wrote:
Sat Jun 05, 2021 8:33 pm
I think that there is some confusion between RonR's usb-boot and Raspberry Pi's usbboot programs. They do very different things.

In order to boot a PI Zero from a USB storage device you do still need an SD card with bootcode.bin on. The rest of the software can be on a USB storage device.
Thank you. So can I use dd or some other imager to clone my install?

Return to “General discussion”