Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Raspberry Pi 4 with external boot SSD

Raspberry Pi 4 setup

For barebones initial setup of a Pi to boot from an external, USB-connected SSD.

Follow instructions in this tutorial, reproduced below:

  1. Flash SD card using Raspberry Pi Imager

  2. touch /Volumes/<volume>/ssh to enable SSH on boot

  3. Boot Pi with SD card and network connection

  4. Find its IP address (e.g. via router) and ssh pi@<ip>

    username: pi; password: raspberry

    Assign a static IP for the Pi in the router.

  5. Run sudo apt update && sudo apt full-upgrade

  6. sudo vi /etc/default/rpi-eeprom-update

    Change FIRMWARE_RELEASE_STATUS from critical to stable

  7. Run command to update EEPROM: sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-06-15.bin

    This will update the bootloader (located in EEPROM on the Pi) to a version that enables RPi4 USB booting.

  8. Reboot Pi with sudo reboot

  9. Reconnect via SSH. Running vcgencmd bootloader_version should give output like:

    pi@raspberrypi:~ $ vcgencmd bootloader_version
    Jun  3 2020 13:53:47
    version b5de8c32f4f45a12a1fdfe107254df82965f9d56 (release)
    timestamp 1591188827
    
  10. Shut down the Pi (sudo shutdown -h now), remove the SD card. You no longer need it.

  11. Flash the external USB volume the same way you flashed the SD card (Raspberry Pi Imager). Complete the same touch /Volumes/<volume>/ssh to enable SSH on boot.

  12. Use this one-liner to grab the .elf and .dat files needed to boot from USB (from here):

    wget $( wget -qO - https://github.com/raspberrypi/firmware/tree/master/boot | perl -nE 'chomp; next unless /[.](elf|dat)/; s/.*href="([^"]+)".*/$1/; s/blob/raw/; say qq{https://github.com$_}' )

  13. Copy resulting files to the external USB volume (~20mb), replacing existing files

  14. Eject the volume, attach volume to Pi, boot Pi, connect via SSH

    If you get an SSH warning, your local machine has a stale fingerprint for the prior SD card OS in SSH known_hosts. Remove the previous entry for the Pi's address (locally, not on the Pi): ssh-keygen -R <static ip>

  15. On the Pi, run sudo apt update && sudo apt full-upgrade. Change the default password.

  16. Set up VNC (download client here) for a remote desktop interface. SSH into the Pi, then:

    sudo raspi-config > Interfacing Options > VNC > Yes

    If you get a "Cannot currently show the desktop" error in the client when you attempt to connect, do

    Advanced Options > Resolution and select a different resolution.

  17. Set up an SSH key for passwordless entry by copying your id_rsa to the Pi (do a ssh-keygen -t rsa -b 4096 if you don't already have one): ssh-copy-id pi@<static ip>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment