Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

This is a guide for configuring Raspberry Pi4 to boot Ubuntu from external USB SSD drive instead of SD card. SSD drives are much faster than SD cards, more reliable and now lower cost than SD cards for larger memory sizes.Instructions for Ubuntu server 22.04 LTS are provided. Note that earlier versions of Ubuntu are much more difficult to configure for using external SSDs so I recommend using this latest Ubuntu release.

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

Requirements

Hardware used in this guide

  • Raspberry Pi 4 with 8GB RAM
  • 32GB micro SD card
  • Kingston A400 120GB SSD
  • StarTech SATA to USB adapter
  • Eluteng SATA to USB adapter
  • Adequate Power Supply due to additional SSD power consumption. (3.5A recommended)

Software used:

  • Windows 10 or Windows 11 PC however guide will be similar for MAC and Linux Users.
  • Raspberry Pi Imager (Balena Etcher is also a good tool for writing to SD cards)

NOTE: It turns out that there are a lot of SATA to USB adapters that do not work correctly when used to boot the Raspberry Pi. After many lost hours trying to get an incompatible cable to work I found this great resource on this topic with a database of know working cables.

James Chambers’ blog was also a great resource for writing other parts of this guide.

1. Upgrade bootloader firmware on Raspberry Pi 4

You need to make sure that the your Raspberry Pi 4 is running the latest bootloader firmware available. USB boot feature was enabled on the Pi 4 bootloader in the fall of 2020.

  1. Use Raspberry Pi Imager V1.6 to install Raspberry Pi OS (lite version without desktop is best) on SD card
  2. Copy empty text file called ssh.txt onto the system-boot partition of the SD card. Remove SD card from PC and insert into Raspberry Pi
  3. SSH into Pi
    Default user: pi
    default password: raspberry
  4. Make sure you have the latest kernal updates. This will take several minutes
    sudo apt update && sudo apt full-upgrade -y
  5. Restart Pi to apply updates
    sudo reboot
  6. SSH into Pi
  7. Your Pi may currently be configured to use critical or stable bootloader releases. Normally I configure it to use the stable releases. Open file and change the FIRMWARE_RELEASE_STATUS entry to stable.
    sudo nano /etc/default/rpi-eeprom-update
  8. Check bootloader firmware version
    sudo rpi-eeprom-update

If bootloader is out of date you will see something like this:

BCM2711 detected
Dedicated VL805 EEPROM detected
*** UPDATE AVAILABLE ***
BOOTLOADER: update available
CURRENT: Thu 16 Apr 17:11:26 UTC 2020 (1587057086)
 LATEST: Thu  3 Sep 12:11:43 UTC 2020 (1599135103)
 FW DIR: /lib/firmware/raspberrypi/bootloader/stable
VL805: update available
CURRENT: 000137ad
 LATEST: 000138a1

If bootloader is up to date you will see something like this:

pi@raspberrypi:~ $ sudo rpi-eeprom-update
BCM2711 detected
Dedicated VL805 EEPROM detected
BOOTLOADER: up-to-date
CURRENT: Thu  3 Sep 12:11:43 UTC 2020 (1599135103)
 LATEST: Thu  3 Sep 12:11:43 UTC 2020 (1599135103)
 FW DIR: /lib/firmware/raspberrypi/bootloader/critical
VL805: up-to-date
CURRENT: 000138a1
 LATEST: 000138a1
  1. Update bootloader if it is out of date
    sudo rpi-eeprom-update -a
  2. Restart Pi to apply updates
    sudo reboot 
  3. Check to see if update was applied
    sudo rpi-eeprom-update

2. Select Boot Device Preference

The default boot setting on our Pi is likely to boot off of SDcard only. We are going to change this so it cycles between trying to boot from SDcard first and then from external USB drive if SD card boot fails.

SSH into the Pi OS installation that you used to upgrade the bootloader in step 1.

  1. run raspi-config utility
    sudo raspi-config
  2. Select option 6 Advanced Options
  3. Select option A6 Boot Order
  4. Select option B1 USB Boot
    You should get pop up window that says “USB device is default boot device
  5. select ok
  6. select finish and select Yes when asked if you would like to reboot now.
    the Pi should reboot like normal. Start SSH session to confirm
  7. shutdown Pi
    sudo shutdown now

3. Install Ubuntu Server 22.04 LTS on USB 3.0 SSD

USB booting Ubuntu Server 22.04 LTS is very simple now with the latest Pi bootloader.

  1. Connect SSD to PC via SATA->USB cable
  2. Download Ubuntu Server 22.04 LTS 64bit
    https://ubuntu.com/download/raspberry-pi
  3. Use Raspberry Pi Imager V1.6 or Balena Etcher to write Ubuntu Server 22.04 LTS on the external SSD.
    Be very careful when selecting the drive number that you choose the correct external drive and not your internal computer hardrive!
  4. Connect the SSD to the USB3 port(blue) on the Pi4.
  5. Make sure SDcard used previously to update the bootloader has been remove
  6. Power up the Pi. If everything is good the USB boot should work.
  7. SSH into Pi to confirm boot
    Default user: ubuntu
    default password: ubuntu

Check Also

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

If you’ve encountered an issue where Hashcat initially only recognizes your CPU and not the …

Identifying harmful activity on your captured traffic

This Python script utilises Wireshark or TCPdump to analyse network traffic stored in a specified …

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading