If you've set up your Raspberry Pi 4 to boot from USB or SSD, you might have encountered a frustrating issue: everything works perfectly until you insert an SD card with data on it. Suddenly, your Pi refuses to boot at all, even though your BOOT_ORDER is correctly configured to prioritize USB.
This isn't a configuration issue on your end - it's a well-documented bug in the Raspberry Pi 4 bootloader that's been around since 2020. The good news? There's a simple fix that takes less than a minute.
Problem: Your Raspberry Pi 4 won't boot from USB/SSD when an SD card with Linux partitions is inserted, even with the correct BOOT_ORDER setting.
Symptoms:
- Pi boots fine from USB when SD card is removed
- Complete boot failure (no lights, no display) when SD card is present during power-on
- Boot hangs during filesystem mounting (if SD card is configured in
/etc/fstab)
The Root Cause
This is a known bug in the Raspberry Pi 4 bootloader (GitHub Issue #423, Issue #243) where any SD card containing a partition with type 83 (Linux) causes the bootloader to fail completely, regardless of boot order configuration.
The bootloader gets confused when it encounters Linux partition types and fails to enumerate USB devices properly, even when BOOT_ORDER=0xf421 (USB first, then SD).
The Solution
Step 1: Fix the Bootloader Bug
Change the SD card partition type from Linux (83) to something else:
sudo fdisk /dev/mmcblk0
In fdisk:
- Type
t(change type) - Type
1(partition 1 - optional if there's only one partition) - Type
c(FAT32 LBA) - Type
p(verify it shows "W95 FAT32 (LBA)") - Type
w(write changes)
Important: This only changes the partition table metadata - your ext4 filesystem and data remain completely intact.
Step 2: Fix Boot Hangs (Optional)
If your SD card is configured to mount automatically in /etc/fstab, edit it to prevent boot-time mounting failures:
sudo nano /etc/fstab
Change your SD card mount from:
/dev/mmcblk0p1 /mount/point ext4 defaults 0 2
To:
/dev/mmcblk0p1 /mount/point ext4 defaults,noauto 0 0
Step 3: Auto-Mount Setup (Optional)
Create a udev rule for automatic mounting:
sudo nano /etc/udev/rules.d/99-sd-automount.rules
Add:
ACTION=="add", KERNEL=="mmcblk0p1", RUN+="/bin/systemctl --no-block start sd-mount.service"
Create the mount service:
sudo nano /etc/systemd/system/sd-mount.service
[Unit]
Description=Mount SD Card
After=local-fs.target
[Service]
Type=oneshot
ExecStart=/bin/mount /mount/point
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Enable it:
sudo systemctl enable sd-mount.service
sudo udevadm control --reload
Why This Works
- Step 1 tricks the bootloader into thinking the SD card isn't a Linux system disk, avoiding the enumeration bug
- Step 2 prevents boot hangs if you have the SD card configured for automatic mounting in fstab
- Step 3 provides seamless auto-mounting when the SD card is detected
The Linux kernel ignores partition type hints and correctly identifies the ext4 filesystem, so your data remains fully accessible.
Test the Fix
Reboot with the SD card inserted:
sudo reboot
Your Pi should now:
- ✅ Boot normally from USB/SSD
- ✅ Auto-mount the SD card (if Steps 2 & 3 completed)
- ✅ Access all your files at your configured mount point
This bug has existed since at least 2020 and affects many Pi 4 setups using USB boot with data SD cards. The fix is simple, safe, and completely reversible.