Banana pi M2 Berry boot from sata ssd


I’ve got a m2 berry with sata drive connected. The os is Raspbian jessie 8.0 V1.1. I want to move the whole os to the sata ssd and want to boot from the sata disk. I’ve tried different tutorials but every time I get stuck because I can’t find the /tmp/boot/uEnv.txt file. I followed this tutorial banana-pi-boot-your-rootfs-from-sata. Are this tutorials for a different os?

Not if you use Armbian. It works the same way on all boards.

I have gone through every tutorial I could find about booting from SATA. Firstly, you must use either the SD card or eMMC boot partition to boot from. Basically, setup a ROOT partition on your ssd/sata disk. copy the root from SD or eMMC to that partition. I then did:

sudo mount /dev/sda1 /tosata

sudo rsync -ax / /tosata

Now that Root is on the SATA, you need to modify uEnv.txt which is in the boot partition of SD or eMMC. In my case it was in /media/pi/BPI-BOOT/bananapi/bpi-m2u/linux . Use your favorite editor and change the root=mmcblk0p2 to root=/dev/sda1 and save. If you change it there and reboot, nothing happens and you will see a message about mounting fs on mmcblk0p2 or the like. You need to copy the new uEnv.txt , uImage, and uInitrd to /media/pi/BPI-BOOT directory. Now when you reboot, do a df -h in terminal. Voila / is on /dev/sda1 ! So now you can run any OS image off an external, much larger drive, not just Armbian!

Ofc this is not an Armbian feature, but there this is done in a much user friendly manner :slight_smile:

What about UUID support? What happens when you have USB stick attached? Will /dev/sda1 be your SSD or USB key?

I assumed that the Armbian distro was just clever enough to offer this feature, but the structure is obviously there to be used for others. I am not sure about UUID path or when fstab gets involved. I am new to this and was tired of all the tutorials not being successful. I figured I would share the solution for others after I got it to work. With regards to USB, I do have a drive plugged in and it always mounts as /dev/sdb, so the kernel must discover SATA first, I guess.