Ubuntu – How to access AMD RAID on X399M board through Ubuntu 18.04

driversraidUbuntuubuntu 18.04x399

I spent a while trying to make this work and I'm sure others have too so I'm posting this to have both question and answer available.

Setup

• ASRock X399M motherboard
• 3x 4TB SATA3 HDD configured RAID 0
• 2x assorted non-RAID disks

The AMD RAID (on-board SATA and NVMe RAID chip) drivers are not installed in Ubuntu 18.04, so the disks show up by themselves but only when AHCI is enabled (the default AHCI driver is used). Enabling RAID mode shows nothing of course.

The driver is not available through AMD support for X399M but rather an AM4 chipset like X370. As of now, the driver can be obtained here but if link is broken, visit amd.com support section for driver download.

After download, attempting to install this AMD RAID driver manually from source failed immediately. Ubuntu 18.04 comes with kernel 4.15 with which this driver is incompatible.

Normally I would say "Someone please point me in the right direction" here but I happened to find the answer just now and will post below.

tl;dr

Follow the instructions in this repo to install the rcraid-dkms package and enable AMD RAID in Ubuntu 18.04

Through this forum post, I was led to the repo rcraid-patches.

Now, I have attempted to patch the files manually before (few months ago) and the process became so tedious I eventually gave up. Thankfully, there was an addition made to the README pointing to another repo to make the process much easier - rcraid-dkms.

if you happen to have two types of the same kernel version (like generic and low-latency) make sure you remove the one you aren't using or the installer may modify the wrong kernel(s)

After installing rcraid-dkms and following the instructions in the repo, my RAID array is finally accessible (along with the other two individual drives).

In case site goes offline - per instructions:

Installation
============
* Driver package for Ubuntu: https://launchpad.net/~thopiekar/+archive/ubuntu/rcraid
bash
sudo apt-get update
sudo apt-get install rcraid-dkms

* Switching to RAID mode:
* Boot Linux in AHCI mode.
* Append modprobe.blacklist=ahci to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
* Run sudo update-grub
* Restart
* Switch to RAID mode
* Boot your Linux installation from a RAID disk