DEV Community

Alex Mo
Alex Mo

Posted on

How to Edit Boot Config for Raspberry Pi 5 USB Boot

If you're using a Raspberry Pi 5 for anything beyond quick testing, booting from a USB drive is one of the best upgrades you can make.

A USB SSD is usually faster, more reliable, and better suited for long-running projects than a microSD card. That matters if you're using your Pi as a home server, a Docker box, a media center, or even just a daily Linux machine.

In this post, I'll walk through how Raspberry Pi 5 USB boot works, what config you actually need to edit, how to change the boot order, and how to troubleshoot common issues.

Why boot Raspberry Pi 5 from USB?

The default Raspberry Pi workflow is still heavily centered around microSD cards. They work, but they also come with a few obvious downsides:

slower read/write performance
lower durability under heavy use
easier to corrupt during bad shutdowns
usually less storage space than an SSD

USB boot solves most of that.

With a USB SSD or even a decent USB flash drive, you can get:

faster boot times
better app and package install performance
improved responsiveness
larger storage capacity
a more reliable setup for 24/7 workloads

On Raspberry Pi 5, USB boot is supported, and once it's configured properly, it works very well.

What you need

Before you start, make sure you have:

Raspberry Pi 5
USB SSD or USB flash drive
Raspberry Pi OS installed somewhere for setup
a stable power supply, ideally the official one
optional microSD card for first-time configuration

And most importantly: make sure the firmware and OS are up to date.

sudo apt update
sudo apt full-upgrade
sudo reboot

If your system is outdated, you can end up debugging problems that are really just firmware issues.

Important: config.txt is not the main USB boot setting

This is the part that confuses a lot of people.

There are two different things involved in Raspberry Pi boot configuration:

  1. config.txt

This file controls hardware-related boot options such as:

display settings
overlays
interface options
device tree parameters
GPU-related settings

You can edit it with:

sudo nano /boot/config.txt

On some newer Raspberry Pi OS versions, the path may be:

sudo nano /boot/firmware/config.txt

  1. EEPROM bootloader config

This is what controls boot order.

So if your real goal is "make Raspberry Pi 5 boot from USB first", the key setting is usually not in config.txt, but in the EEPROM bootloader config.

That setting is called:

BOOT_ORDER

So yes, you can edit config.txt, but if USB boot priority is the issue, the real change usually happens elsewhere.

Step 1: Edit config.txt if needed

You may still want to inspect or edit config.txt, especially if your setup depends on custom boot-time hardware settings.

Open it with:

sudo nano /boot/config.txt

Or:

sudo nano /boot/firmware/config.txt

If you're editing the boot partition from another computer, just mount the SD card and open config.txt in any text editor.

Again, this is useful for general boot config, but not the main place for changing USB boot order.

Step 2: Change boot order with raspi-config

The easiest way to enable USB boot is through raspi-config.

Run:

sudo raspi-config

Then go to:

Advanced Options > Boot Order > USB Boot

Select the USB boot option, save, and reboot:

sudo reboot

This is the simplest approach and probably the best one if you just want it to work.

Step 3: Manually edit EEPROM bootloader config

If you want to change the bootloader settings directly, use:

sudo -E rpi-eeprom-config --edit

Look for this line:

BOOT_ORDER=0xf41

If it doesn't exist, add it.

What does 0xf41 mean?

The value is read as a boot sequence.

f = try all supported boot modes
4 = USB mass storage
1 = SD card

So:

BOOT_ORDER=0xf41

means the Pi will prioritize USB boot while still keeping SD card as a fallback.

That makes it a good default for most users.

After saving the config, reboot:

sudo reboot
Step 4: Verify the bootloader config

After rebooting, verify the current setting:

vcgencmd bootloader_config

Check the output for:

BOOT_ORDER=0xf41

If you don't see the value you expect, then the boot order was not updated correctly.

This step is worth doing before you start blaming the USB drive.

Step 5: Prepare a bootable USB drive

Changing boot order alone is not enough. The USB drive also needs a valid Raspberry Pi OS image.

You have two common options.

Option A: Use Raspberry Pi Imager

This is the easiest and cleanest method.

Open Raspberry Pi Imager
Select Raspberry Pi OS
Choose the USB drive as the target
Write the image

Done.

Option B: Clone an existing SD card

If you already have a working Raspberry Pi install and want to move it to USB, you can clone it.

sudo dd if=/dev/mmcblk0 of=/dev/sda bs=4M status=progress

Make sure the device names are correct.

/dev/mmcblk0 = SD card
/dev/sda = USB drive

Before doing this, check devices with:

lsblk

Because if you get the paths wrong, dd will happily overwrite the wrong disk.

Step 6: Test USB boot

Now test the actual setup.

Shut down the Raspberry Pi
Remove the microSD card
Connect the USB drive
Power on the Pi

If everything is configured correctly, the Raspberry Pi 5 should boot directly from USB.

If it only works with the SD card still inserted, then you're not really booting from USB yet.

Common issues and fixes

Here are the most common reasons Raspberry Pi 5 USB boot fails.

USB drive is not detected

This is often a power or adapter issue.

Try:

official Raspberry Pi power supply
powered USB hub
different USB port
different SSD enclosure or adapter
BOOT_ORDER is wrong

Check it again:

vcgencmd bootloader_config

If it doesn't show the expected boot order, fix that first.

USB drive is not actually bootable

Reflash it using Raspberry Pi Imager.

If you cloned with dd, double-check that the target drive was correct and the clone completed successfully.

Pi hangs during boot

This can happen if:

the drive isn't compatible
the OS image is broken
the power supply is weak
the bootloader config is incorrect
Need more USB debug info?

Use:

dmesg | grep -i usb

This can help confirm whether the drive is being detected during boot or after startup.

Best practices

A few things make USB boot setups much more reliable:

Use an SSD if possible

A proper SSD is usually much better than a cheap USB flash drive.

Keep firmware updated

Bootloader and compatibility improvements show up in firmware updates, so don't skip system maintenance.

Use a good power supply

A weak power source causes weird, inconsistent problems that are hard to diagnose.

Keep an SD card as a fallback

Even if you move to USB boot full-time, an SD card is still useful for recovery.

Final thoughts

USB boot on Raspberry Pi 5 is one of those upgrades that is absolutely worth doing if you care about speed or reliability.

The main thing to remember is:

config.txt handles general boot-time hardware config
BOOT_ORDER in the EEPROM bootloader controls boot priority

So if you're trying to make the Pi boot from USB, the EEPROM setting is the part that matters most.

The basic flow looks like this:

update the system
check or edit config.txt if needed
set BOOT_ORDER for USB boot
verify the bootloader config
flash or clone a USB drive
test without the SD card

Once that's done, your Raspberry Pi 5 should be able to boot cleanly from USB storage, and in most cases, it'll be a better experience than booting from microSD.

Example commands recap
sudo apt update
sudo apt full-upgrade
sudo reboot
sudo nano /boot/config.txt
sudo nano /boot/firmware/config.txt
sudo raspi-config
sudo -E rpi-eeprom-config --edit
vcgencmd bootloader_config
sudo dd if=/dev/mmcblk0 of=/dev/sda bs=4M status=progress
lsblk
dmesg | grep -i usb

Top comments (0)