If you haven’t heard of the Banana Pi see some benchmarks first. You may have heard you can connect multiple SATA hard drives to your Banana Pi or other ARMv7 device. That currently requires a kernel rebuild for the Allwinner A20 chipset if you are using Bananian so it can see the port multiplier. I do recommend taking a backup of your sd card before proceeding. The goal is of course to have a proper NAS with SATA hard drives for downloading and serving media. Once you rebuild the kernel using this method you will have to use the port multiplier to connect drives – consider yourself warned, you cannot directly connect a hard drive to the SATA port when using this rebuilt kernel. You will have to switch back to your old kernel if you don’t want to use the port multiplier anymore.
Updated for Bananian 15.08 Jessie
Edit: You can now easily build a new image or download a prepared image!
This kernel compilation process will take about 2 hours or so and is good experience for solving future problems. You can also just scroll to the bottom and grab the prepared image (img) with SATA port multiplier support.
In total it cost me about $70 to reuse older hard drives with this setup, I will also have a useful bay that I can use in future projects or servers.
Rebuild Bananian Kernel with SATA Port Multiplier Support
Install some necessary compilation tools on the Banana Pi
apt-get install git build-essential libncurses5-dev u-boot-tools uboot-mkimage screen -y
If you are on the latest Bananian Jessie 15.08 install these packages instead
apt-get install git build-essential libncurses5-dev u-boot-tools screen -y
Git clone the Banana Pi Bananian kernel
git clone https://github.com/Bananian/linux-bananapi.git --depth 1
Enter the Banana Pi folder
Edit the ahci file
Change this line to enable the SATA port multiplier, you can use Ctrl+W to search for AHCI_HFLAG instead of scrolling
.private_data = (void*)(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI | AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ), };
.private_data = (void*)(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI | AHCI_HFLAG_YES_NCQ), };
Start a screen session so in case your SSH session gets disconnected the compilation will continue
Keep everything default, and enter these commands one by one, the -j2 means to use 2 threads which should match the number of cores.
make sun7i_defconfig make menuconfig make -j2 uImage modules make modules_install mount /dev/mmcblk0p1 /boot cp arch/arm/boot/uImage /boot
Reboot the machine
Connect your port multiplier and multiple hard drives and use this command to show the hard drives
Look at all those drives
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="4D17-5A3B" TYPE="vfat" /dev/mmcblk0p2: UUID="1af97748-34b7-4a6e-a16d-29c409d9c367" TYPE="ext4" /dev/sda1: LABEL="Test" UUID="b5e95c25-06ac-4377-b58b-d83c39a3e316" TYPE="ext4" /dev/sdb1: LABEL="Disk1" UUID="ffd1ad88-3526-4815-ac2e-ff56b783e173" TYPE="ext4" /dev/sdc1: LABEL="Disk1" UUID="14a4c57e-8a80-41ea-95a6-c4ecd2fb4cd5" TYPE="ext4" /dev/sdd1: SEC_TYPE="msdos" LABEL="DellUtility" UUID="5450-4444" TYPE="ntfs"
They will also show up in Open Media Vault 🙂
Prebuilt Banana Pi Images with PMP Support
Edit: use the Jessie 4.1 PMP image here instead of the one linked to in this post!
- Bananian 15.04 SATA PMP Image (SSH is root/pi)
- Run bananian-config to expand the sd card
- Fix perl apt-get –reinstall install perl-base (thanks Benjamin) and install OpenMediaVault.
- Bananian 15.08 SATA PMP image (SSH is root/htpcguides)
Remember using either of these methods you can only use the port multiplier to read SATA drives. I am working on getting a modular PMP working with another kernel and hope to get it working with OpenMediaVault.
Treat yo' self to a new gadget!
|Amazon Fire TV|
|Amazon Fire TV Stick|
|Raspberry Pi 3|
If these guides have saved you time or frustration and you'd like to say thank you while supporting the creation of new posts become a patron of HTPC Guides.Raspberry Pi 3 Media Server October Giveaway 2016
|Get More HTPC Goodness! No Spam just Torrent, Usenet, Pi and Media Server Automation|