Raspberry pi using USB drive instead of SD

You can easily run your nymea raspberry off a USB drive rather than SD card. Why? Well, for one, once in a touch screen case you cant get to the SD, and 2, sd cards are just a PITA! USB drives are much easier to deal with.

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

But, if you use a raspberry PI 3B+ like i do, its VERY easy, thanks to this URL: https://pimylifeup.com/raspberry-pi-boot-from-usb/

Do the following:

  1. echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
  2. sudo reboot
    When it comes back up run this command: vcgencmd otp_dump | grep 17:
    You should see this:
    17:3020000a

So just do step 3 now, it will remove the line you added in step 1, and your raspberry is configured to boot both via sd OR USB.

  1. sudo sed -i ‘s/program_usb_boot_mode=1//g’ /boot/config.txt

So do a shutdown, make a image of the SD on your computer then image that to a USB. Put the USB in the raspberry and it will boot
thats it.

–John

3 Likes

2 things:

  1. I forgot to put a sudo before this command in the post. Be sure to put it in there!
    So instead of: echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
    do this: sudo echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

  2. Smart quotes suck. And they apeared in the last line of my post, so make sure to change them to “dumb” single quotes on this line like so:
    sudo sed -i ‘s/program_usb_boot_mode=1//g’ /boot/config.txt

1 Like

Hehe, fun fact, the raspberry Pi nymea packages are built on a RPi 4 with a SSD disk on USB 3. Also running the nymea image. Same how-to applies, doesn’t matter if it’s a USB stick or even an actual harddrive/solid state disk.

Thanks for sharing @dunarri

Very cool! I figured I would post to help other users who would like to do this!

Also guys, if you need to shrink down your iso backup of your system, pishrink does it well. Run on any linux machine, including your nymea system!

–John