NVMe SSD boot with the Raspberry Pi 5: Difference between revisions

Line 99: Line 99:
If you are flashing a fresh Pi OS to NVME ssd, you must [[#Enable PCIe]]; but if you are COPY or CLONE an old Pi OS from SD card to NVME ssd, and you have already enabled pcie in the old Pi OS in advance, then you don't need to do enable pcie again!
If you are flashing a fresh Pi OS to NVME ssd, you must [[#Enable PCIe]]; but if you are COPY or CLONE an old Pi OS from SD card to NVME ssd, and you have already enabled pcie in the old Pi OS in advance, then you don't need to do enable pcie again!


==Set NVMe early in the boot order==
==Boot from PCIe (NVMe SSD)==
The PCIe connection should work after a reboot, but your Pi won't try booting off an NVMe SSD yet. For that, you need to change the '''BOOT_ORDER''' in the Raspberry Pi's bootloader configuration:
By default, Raspberry Pi devices do not boot from PCIe storage. To enable boot from PCIe, change the '''BOOT_ORDER''' in the bootloader configuration. Edit the EEPROM configuration with the following command:
sudo rpi-eeprom-config --edit
Then change the BOOT_ORDER line to the following:
BOOT_ORDER=0xf416
To boot from a non-HAT+ device, also add the following line:
PCIE_PROBE=1
- Press '''Ctrl-O''', then enter, to write the change to the file.


* Use tool '''raspi-config''' to set boot order
- Press '''Ctrl-X''' to exit nano (the editor).
 
* Or use tool '''raspi-config''' to set boot order
  sudo raspi-config
  sudo raspi-config
Then select '''6 Advanced Opitions''' => '''A4 Boot Order''' => '''B2 NVMe/USB Boot''' answer '''Yes''', then <code>sudo reboot</code>
Then select '''6 Advanced Opitions''' => '''A4 Boot Order''' => '''B2 NVMe/USB Boot''' answer '''Yes''', then <code>sudo reboot</code>
* Run the following command to set boot order.
* Run the following command to set boot order.
sudo rpi-eeprom-config --edit
Then change the BOOT_ORDER line to the following:
BOOT_ORDER=0xf416


- Press '''Ctrl-O''', then enter, to write the change to the file.


- Press '''Ctrl-X''' to exit nano (the editor).


Read [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#BOOT_ORDER Raspberry Pi's documentation on BOOT_ORDER] for all the details. For now, the pertinent bit is the '''6''' at the end: that is what tells the Pi to attempt NVMe boot first!
Read [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#BOOT_ORDER Raspberry Pi's documentation on BOOT_ORDER] for all the details. For now, the pertinent bit is the '''6''' at the end: that is what tells the Pi to attempt NVMe boot first!