Configuring a Raspberry Pi to boot from a USB flash drive

By default, some Raspberry Pis will boot from an SD card but not from a USB flash drive. Booting from a USB flash drive is more reliable than from an SD card. If your Raspberry Pi will not boot from a USB flash drive, you'll need to boot your Raspberry Pi from an SD card in such a way that programs it to boot from a USB flash drive when an SD card isn't present.

Preparing the SD card

Download, install and run the Raspberry Pi Imager.

Select CHOOSE OS:

Select Raspberry Pi OS (other):

Select Raspberry Pi OS Lite (32-bit):

Select CHOOSE STORAGE:

Select your SD card:

Select WRITE:

Select YES:

Grab yourself coffee:

The image will be written to the USB flash drive and then verified.

If the verification fails, you'll see an Error dialog. Select CONTINUE and try again or try a different SD card:

If the verification succeeds, you'll see a Write Successful dialog. Select CONTINUE:

The SD card will show as two drives in Windows Explorer. Open the first of the two and edit config.txt:

Add program_usb_boot_mode=1 to the bottom of the file and save:

Eject the SD card:

Insert the SD card into the Raspberry Pi that needs to be programmed to boot from a USB flash drive and power it on.

When the login prompt appears, enter pi as the username and raspberry as the password.

Once logged in, enter sudo shutdown -h now to shut the Raspberry Pi down before removing the SD card.

The Raspberry Pi will now be programmed to boot from a bootable USB flash drive if present and an SD card isn't.