I'm trying to set up my Nextcloud on a Raspberry Pi 3 on Ubuntu Core. I want to have a Raid 1 setup, so a disk failure doesn't wipe out all the data (next to weekly backups I'll do with another disk attached)
The issue right now is that Ubuntu Core does not come with mdadm to create the RAID. Also there does not seem to be a snap available for mdadm, and obviously you can't install the package using apt-get on Ubuntu Core. However, I found that with the snap "classic dimension" I can use apt-get, install mdadm and use mdadm to create a Raid 1 at /dev/md0
from my two disks.
Also in the non-classic dimension I can use that /dev/md0 and mount it using systemd.mount, as described here. So far, so good.
The problem is, after a reboot the /dev/md0
does not exist anymore and systemd fails
-- Subject: Unit dev-md0.device has failed
-- Defined-By: systemd
I guess this is because mdadm does not exist in this environment and so the raid is gone after the reboot.
My question to you is: Is there a possibility at all to create a Raid on Ubuntu Core using mdadm? And if so, how do I get it to work?
Thank you for your time.
Edit: I found out that after a reboot I can enter the classic extension with sudo classic
, and in the classic extension start the raid with sudo mdadm --assemble --scan
. Is there maybe a way to do this using a systemd-script of some sort?