After several months of experiments with software RAID with mdadm using RPi 4 and SATA HAT, i has concluded, that it is not usable in this setup. RPi4 just do not have enough performance / memory / bus speed to get all speed benefits from RAID0/RAID1. I’m seeing hard memory cache (disk write/read cache) and CPU (software RAID, remember?) usage during usual rsync between two RAID0 arrays (4 disks), and speed spikes from 4mb/s to 80mbs, with average 20-30mb/s.
But our jms561 SATA-USB controllers, soldered on sata hat board, DO have hardware RAID capabilities. I have no idea why it is not used by default by Radxa engineers.
So we will try to enable it manually…
DISCLAIMER: EVERY STEP DESCRIBED BELOW THIS LINE, MAY CAUSE FULL DATA LOSS ON YOUR ATTACHED HDD’S, OR EVEN MAY BRICK YOUR SATA-HAT BOARD, DO IT ON YOUR OWN RISK, AND MAKE BACKUPS
First of all, we should update jms561 firmware, as described here:
Wget jms56x raid controller console app:
sudo wget https://wiki.odroid.com/_media/accessory/add-on_boards/xu4_cloudshell2/raidmgr_static_cloudshell2.zip
sudo unzip raidmgr_static_cloudshell2.zip
sudo chmod +x raidmgr_static
Start raid manager with SUDO:
“Enter” will give you available command set:
Do be sure, try to find jms561 on you system with command GC:
If it shows 2 controllers, than 99% that everything goes fine.
First jms561 controls SATA1 and SATA3 port, second one respectively controls SATA2 and SATA4 ports.
This can be determined also with command DC C0 and DC C1, this will shows attached HDDs to jms 0 and jms1.
So now, we just need to create RAID0 with attached HDDs with command CR C0 D0,1 R0
This will create RAID0 on first jms561, with hdd0 and hdd1.
That’s it. Now we will see only one hdd in raspbian with doubled size:
There i have software RAID0 created with mdadm (sda,sdb) and hardware RAID0 created with raid manager.
Difference between software and hardware raid is fabulous, no mem cache and cpu usage, 120mb/s stable read speed, and 80mb/s stable write speed.