So, it’s done—the Orange Pi Zero 2W boots from a USB SSD connected to USB Port 1.
This wasn’t my own idea; ChatGPT helped me out.
I had it generate a summary of how the whole process went; I hope it helps other users in a similar situation.
Orange Pi Zero 2W – DietPi boot from USB SSD
I migrated a DietPi installation from microSD to a USB SSD on an Orange Pi Zero 2W.
The important part was updating U-Boot in the SPI NOR. The original bootloader did not boot the USB SSD as required.
1. Backup SPI NOR
The SPI flash is exposed as /dev/mtd0 and is 16 MiB:
cat /proc/mtd
I made and verified a complete backup before touching SPI:
dd if=/dev/mtd0 of=/root/spi0.0-backup.bin bs=1M status=progress
sync
sha256sum /root/spi0.0-backup.bin
2. Update U-Boot
The board-specific U-Boot image was:
/usr/lib/linux-u-boot-current-orangepizero2w/u-boot-sunxi-with-spl.bin
I flashed it to the SPI NOR with:
flashcp -v \
/usr/lib/linux-u-boot-current-orangepizero2w/u-boot-sunxi-with-spl.bin \
/dev/mtd0
sync
After reboot, U-Boot showed:
bootcmd=run distro_bootcmd
boot_targets=fel mmc0 usb0 pxe dhcp
The important change is:
usb0
The U-Boot configuration also includes USB mass-storage and ext4 support:
CONFIG_CMD_USB=y
CONFIG_USB_HOST=y
CONFIG_USB_STORAGE=y
CONFIG_CMD_EXT4=y
CONFIG_FS_EXT4=y
This was the key to getting USB boot working.
3. Prepare the SSD
I created one ext4 partition:
mkfs.ext4 -L DIETPI /dev/sda1
mount /dev/sda1 /mnt/ssd
Then copied the DietPi root filesystem:
rsync -aHAXx --numeric-ids --info=progress2 \
--exclude='/proc/*' \
--exclude='/sys/*' \
--exclude='/dev/*' \
--exclude='/run/*' \
--exclude='/tmp/*' \
--exclude='/var/log/*' \
--exclude='/mnt/*' \
--exclude='/media/*' \
--exclude='/lost+found' \
/ /mnt/ssd/
Since /boot was part of the root filesystem, it was copied automatically.
Finally, I changed the root UUID in the SSD copies of:
/mnt/ssd/etc/fstab
/mnt/ssd/boot/dietpiEnv.txt
to the UUID of /dev/sda1.
No changes to boot.cmd or boot.scr were required.
4. First boot
Because the system is headless, I left the original microSD untouched.
After shutting down:
- Remove the microSD.
- Leave the USB SSD connected.
- Power on.
- Wait for SSH/network access.
The Orange Pi then booted DietPi from the USB SSD.
Verification:
findmnt /
cat /proc/cmdline
lsblk -o NAME,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINTS
The root filesystem should show /dev/sda1 and the SSD UUID.
Result
The essential fix was not a DietPi-specific bootloader modification. It was replacing/updating the U-Boot in SPI NOR with the correct Orange Pi Zero 2W U-Boot, which provides:
boot_targets=fel mmc0 usb0 pxe dhcp
After that, DietPi can boot normally from the USB SSD using its UUID.
Always make a verified SPI backup first, and only use a U-Boot image specifically built for the Orange Pi Zero 2W.