Skip to content

Instantly share code, notes, and snippets.

@Juul
Last active August 12, 2023 22:07
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Juul/ddcb7f96a1c8b9c32449503ab6ec4d03 to your computer and use it in GitHub Desktop.

The banana pi m1 works with the cheap ~$15 chinese 5 port sata multipliers.

Warning: The multipliers will get really hot and unreliable under load or if more than three drives are attached. Definitely put at least a heatsink on it.

With the official bananian distro it appears to work out of the box but it unfortunately only works with one drive at a time.

To get it working with multiple drives you need to enable the sunxi pmp support. The reason this is not enabled per default is that when it is enabled you will be unable to use the sata port without a port multiplier.

The kernel in the official bananian distro does not have sunxi pmp support compiled into it and the kernel is too old anyway.

Download the mainline Debian release from https://www.armbian.com/banana-pi/ (4.9.7 as of this writing) and write the image to your sd card.

Boot up your banana pi form the sd card. It will take ~3 minutes the first time. It will be set up to request an IP over DHCP over ethernet so set up a DHCP server and listen for it to request an IP.

ssh in as root with password 1234. It will ask you to change the password and create a user account on first login.

Now check that you have sunxi pmp support in your kernel:

zgrep PMP /proc/config.gz

You should see:

CONFIG_SATA_PMP=y

Now to enable sunxi pmp support edit /boot/boot.cmd. Find the line that begins with setenv bootargs and add:

ahci_sunxi.enable_pmp=1

to the end of that line (within the quotes).

Within the /boot directory run:

mkimage -C none -A arm -T script -d boot.cmd boot.scr

This will generate the binaray file boot.scr from boot.cmd and uboot reads kernel cmdline arguments from boot.scr on boot.

Reboot.

Verify that all your sata drives show up:

blkid

Rejoice (or bang your head against the table, depending on outcome).

@hradec
Copy link

hradec commented Nov 7, 2017

I can confirm these instructions also work for arch linux on the bananapi!

thanks lots!!

@banekkk
Copy link

banekkk commented Apr 10, 2019

Does one of those cheap controllers limit the datarate ?

@LDVC33740
Copy link

Hello.
Great!
It works for a Multiply Port interface with the Banana Pi M2 Berry SATA but can we cascade two Multiply Port interfaces ?
So I randomly tried to replace 1 by 2 :
ahci_sunxi.enable_pmp=2
But it's not working...
The second interface is not configured and only one disk would peer on the second interface.
Does anyone have the solution, please?
Thank you.

@Marcmk1
Copy link

Marcmk1 commented Jan 8, 2022

Greate works Perfect thanks!
Finaly upgrade my BananaPI 5 drives NAS to the latest Deb version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment