Booting Raspberry Pi 3 (RPi3) from USB mass storage without sd card

Addition: you only have to do this if you already have successfully prepared your ssd for USB boot and want to upgrade your operating system.
It’s not a step which has to be performed while first preparing and enabling the USB Boot mode.

Have fun.

Ok, thanks sihui. Got it up and running!

One last question: I think the boot sequence (until I can log in to ssh) now takes longer (perhaps 10 sec.?!). Even though I am using a SSD drive. Do you know if this is normal?

I never had openHAB2 running from sd, only from ssd, so I cannot tell …

I also have the impression that booting from an alternative device (e.g. USB stick) takes a bit longer, so I’m guessing it’s normal. I presume that it checks for other boot devices first (e.g. SD) and only boots from the USB stick after the appropriate timeout.

Steve

What does this command precisely? Everytime we need to upgrade the system we should use this command? Or this is one time only command?

According to this post it is not needed anymore:

https://www.raspberrypi.org/forums/viewtopic.php?p=1172476#p1172476

Haven’t tried it yet, though …

mhh
no USB Mode etc needs to be set anymore?
just burn the image to an USB ssd/hdd ?

You still need to set the usb bit, though:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

Is it or will it be possible to move everything from SD card to USB SSD via the openhabian-config method or will that only move the data to the SSD and keep /boot on the SD card? I wouldn’t necessarily want to install from scratch.

Noone? Do I have to do a fresh install of everything to boot / run completely from SSD? Or is there a way to port a running installation from microSD to SSD (e.g. via openhabian-config feature to boot from USB)?

I’m no sure but when I did this a couple of weeks ago, I wasn’t sure whether my SD image was corrupt so I backed up my user-data and conf files and made a new image on the SSD card. It didn’t take long.

I copied the instructions from threads on here because I can never find anything easily a second time (so apologies for the plagarism).

Prepare SSD card

• Get new openHABian  …..img.zx  zip file to PC.
• Extract on PC using [7-ZIP.exe](	http://www.7-zip.org/)
http://www.7-zip.org/
• Copy file to SSD using Win32DiskImager (Etcher doesn't seem to see SSD card)

Prepare RPI
(one way process for PI to enable it to boot from SSD)

  • Stop openHAB service (if running)
sudo apt-get update && sudo apt-get upgrade

echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

This adds program_usb_boot_mode=1 to the end of /boot/config.txt.
Reboot the Raspberry Pi with sudo reboot, then check that the OTP has been programmed:

vcgencmd otp_dump | grep 17:
17:3020000a
  • Ensure the output 0x3020000a is shown. If it is not, then the OTP bit has not been successfully programmed.

Remove the program_usb_boot_mode line from config.txt, so that if you put the SD card in another Raspberry Pi, it won’t program USB boot mode. Make sure there is no blank line at the end of config.txt. You can edit config.txt using the nano editor using the command sudo nano /boot/config.txt, for example.

  • Power down and remove SD card.
sudo shutdown -h now
  • Boot from SSD card

  • Copy back conf and user data files

  • Install any other stuff like Mosquitto (using openhabian)

If i set the bit to usb mode, then i can not boot this raspi 3 with a sdcard anymore? I only can use the sd-card as external drive for data storage, but never ever again for booting? Is this right?

So in other words the raspi gets “damaged” in any way (wrong word, but you know what i mean)?

No, although what you have set is OTP (One time programmable) so you can’t unset it, the Pi still goes through a boot sequence - first it looks for a SD card to boot from and then an external USB drive.

So, with no SSD or USB plugged in but with an SD card fitted, it should still boot from SD.

I’d try it with mine to confirm but I’m on a soak test and don’t want to switch it off!

@Saracen this is correct. Setting the OTP bit just alters boot flow. It does not disable SD card slot.

1 Like

I have set up a new system with a rpi3 B+ and a SSD.
I flashed the SSD with openhabian 2.3 image , conected it to the pi and started the system.
The installation was performed witout problems and the system is running.
OK to update the system in openhabian-config.
Have no errors in openhab log viewer but have noticed the following behavior on the pi:
The green status led repeatedly blinks fast 3 times make a pause of about 1 second and start over.
Is this a normal behavior or not?

Yep, just walked in and took a look, seems normal and it’s been running about a month w/ no issues.

Edit: And I have the same set up as you.

Thanks for your quick answer

I had to get up to take a leak any way. :sweat_smile:

Is this only possible with the 3B + model or even with the predecessor without +

USB boot is available on the Raspberry Pi 3B, 3B+, 3A+ and Raspberry Pi 2B v1.2 models only