Jump to content

[Guide] How to boot Orange pi 5 from SATA m.2 SSD (for Orange pi OS and Armbian)


jng98908

Recommended Posts

I originally posted this on reddit after seeing a lot of posts trying to use a SATA M.2 SSD and saying it wouldn't boot with replies telling them to go buy a NVME M.2 SSD which isn't necessary when the board does support SATA M.2 with flashing the correct bootloader. This guide has 3 different sections, 1 being booting with Orange pi OS and 2 being with Armbian OS

 

Orange Pi OS Instructions

Download Orange Pi OS Ubuntu or Debian from their website http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-5.html unzip the 7z file to get the .img file and flash it to your sd card with your preferred flasher i.e balenaetcher. Once flashed put it into orange pi 5 and boot from sd card first

once booted, the rest will be done in a terminal. go ahead and do your usual update

sudo apt update

sudo apt upgrade -y

3. then make sure to wipe your SPI of any previous bootloader (give it time to complete, you'll know it's done when you get your cursor back in terminal)

sudo dd if=/dev/zero of=/dev/mtdblock0 bs=1M count=1

4. Write sata bootloader to SPI

sudo dd if=/usr/share/orangepi5/rkspi_loader_sata.img of=/dev/mtdblock0 && sudo sync

5. Edit boot file on sd card to recognize sata by adding overlays line to the bottom, save then reboot

sudo nano /boot/orangepiEnv.txt

overlays=ssd-sata

sudo reboot

6. On reboot you will still boot into SD card but now you should see "sda" (your sata SSD) show up on your list of devices when typing:

lsblk

7. Put the same Orange Pi OS image you used in step 1 in any directory on your orange pi making sure it is unzipped and is in .img format. I just used the web browser in orange pi os to redownload from the website which for me put it in directory /home/orangepi/Downloads

8. Flash your downloaded .img to your sata ssd with this command (substitute with your directory to .img)

sudo dd bs=1M if=/path/your/orangepi.img of=/dev/sda status=progress && sudo sync

9. Mount your ssd so you can edit the ssd’s boot file to support sata and reboot

sudo mount /dev/sda1 /mnt/

sudo nano /mnt/boot/orangepiEnv.txt

overlays=ssd-sata

sudo umount /mnt/ && sudo sync

sudo poweroff

10. Remove SDcard, turn on orange pi and it should boot orange pi OS from your M.2 sata ssd now

 

Armbian OS Instructions

Relatively same instructions with different file names

write armbian .img file to your sd card with balenaetcher, I chose to use the more up to date imags from their github here https://github.com/armbian/build/releases/ make sure to unzip

boot armbian from sd card, wipe spi

sudo dd if=/dev/zero of=/dev/mtdblock0 bs=1M count=1

3 Download sata spi bootloader from orange github, place it on your sd card (mine is in downloads directory) and write to spi

https://github.com/orangepi-xunlong/orangepi-build/blob/next/external/packages/bsp/rk3588/usr/share/orangepi5/rkspi_loader_sata.img

sudo dd if=/home/pi/Downloads/rkspi_loader_sata.img of=/dev/mtdblock0 status=progress && sudo sync

4. Edit boot file to recognize sata then reboot

sudo nano /boot/armbianEnv.txt

overlays=opi5-sata

sudo reboot

5. Once rebooted you can check sda shows up with command:

lsblk

6. download the same armbian.img you used for step 1 to your orange pi making sure it's unzipped in .img format, then flash it to your ssd

sudo dd bs=1M if=/path/your/armbian.img of=/dev/sda status=progress && sudo sync

7. Mount /boot/ of ssd so you can edit the ssd’s boot file to support sata and reboot

sudo mount /dev/sda1 /mnt/

sudo nano /mnt/boot/armbianEnv.txt

overlays=opi5-sata

sudo umount /mnt/ && sudo sync

sudo poweroff

8. Remove SDcard and start SBC, resize filesystem to use all available space

sudo systemctl enable armbian-resize-filesystem

Link to comment
Share on other sites

Thanks!

 

If someone has time to integrate this to Armbian standard install tool:

 

https://github.com/armbian/build/blob/master/packages/bsp/common/usr/sbin/armbian-install

https://docs.armbian.com/User-Guide_Getting-Started/#how-to-install-to-emmc-nand-sata-nvme-usb

 

+ packing sata spi bootloader within u-boot package (this part is a bit tricky as blob has to be provided and packed via custom UBOOT_TARGET_MAP)

https://github.com/armbian/build/blob/master/config/sources/families/rockchip-rk3588.conf

Link to comment
Share on other sites

@bsorsdahlNVME works without these extra steps.
Boot into your OPI from SD card, use amrbian-config  -> System -> Install and first option(nr4 - boot from nvme/usb) and then use dd to write the image to the nvme drive "dd if=/image.img of=/dev/nvme0n1 bs=1M" power off, take out the SD card and enjoy.

Link to comment
Share on other sites

Hello,

 

I tried to install Armbian onto my Orange Pi 5 (with M.2 SATA SSD) exactly like shown here but it won‘t really work. I now tried it several times but I always get the same result. When I‘m at the step of removing the SD card to boot directly of of my SATA SSD only the red LED on the Pi is on and nothing boots. I already tried it in many different ways but nothing changes. 


Thanks in advance, Fabbl

Link to comment
Share on other sites

Try to format the disk so you've got 1 ext4 partition and install with armbian-install. Choose no when it asks if you want to install/update the bootloader to MTD. Check if you've got the overlay sata in /boot/dtb/rockchip/overlay

 

In case the filename is orangepi-5-sata.dtbo then in armbianEnv.txt you should have the following lines: 

overlay_prefix=orangepi-5

overlays=sata

 

 

Edited by royk
Link to comment
Share on other sites

I've made a few tests based on armbian and the ubuntu images provided by orange pi.

 

First thing the SPI image:

 

The link points to a 4MB image when the file used to be a 16MB one (file changed on June 1)

The new version doesn't seem to work (nothing displayed on serial console when booting without an SD card).

The older 16MB seems to work : https://github.com/orangepi-xunlong/orangepi-build/raw/cdfc212a812ead294d7b98b4cedb15b1ee60bec2/external/packages/bsp/rk3588/usr/share/orangepi5/rkspi_loader_sata.img

this img file can also be found inside the orange pi image as explained in the orange pi section

 

Secondly the armbian image:

 

It seems several changes have been made between 23.02 and 23.05 (at least the overlay names).

With 23.02 images the procedure explained here does seem to work with a sata ssd.

With 23.05 images the sata ssd does not seem to appear (when booting on SD card) so the procedure can't be completed. Also the sbc hangs at reboot/poweroff (kernel panic)

 

For now I'm gonna use 23.02 until we get more feedback with 23.05

Edited by Yoshi_312
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines