Raid 0 doesn't persist after reboot

I’m following this guide for a Raid 0 array but arrays don’t persist even with the mdadm --detail --scan into /etc/mdadm.conf file

If anyone can help me set this up, please. I don’t find a step to step guides for Manjaro

sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb
[sudo] password for ccheco: 
mdadm: chunk size defaults to 512K
mdadm: partition table exists on /dev/sda
mdadm: partition table exists on /dev/sda but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdb
mdadm: partition table exists on /dev/sdb but will be lost or
       meaningless after creating array
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

$ cat /proc/mdstat
Personalities : [raid0] 
md0 : active raid0 sdb[1] sda[0]
      976508928 blocks super 1.2 512k chunks
      
unused devices: <none>

$df -h -x devtmpfs -x tmpfs
df: /run/user/1000/doc: Operation not permitted
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  216G   11G  206G   5% /
/dev/nvme0n1p3 1023M  312K 1023M   1% /boot/efi
/dev/md0        932G  5.9G  926G   1% /media/files

$sudo mkfs.f2fs -f /dev/md0    

        F2FS-tools: mkfs.f2fs Ver: 1.14.0 (2020-08-24)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is enabled
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 1953017856 (953622 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
  "Linux version 5.8.16-2-MANJARO (builduser@development) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Mon Oct 19 11:33:03 UTC 2020"
Info: [/dev/md0] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: Discarded 953622 MB
Info: Overprovision ratio = 0.210%
Info: Overprovision segments = 1957 (GC reserved = 960)
Info: format successful

$sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf       
ARRAY /dev/md0 metadata=1.2 name=carlos-ab350gaming3:0 UUID=a1a1abab:983192b0:15c43b3a:bfd43841

$sudo mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: 'default'
  -> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64.img
==> Starting build: 5.8.16-2-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [mdadm_udev]
Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays.
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.8-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: 'fallback'
  -> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64-fallback.img -S autodetect
==> Starting build: 5.8.16-2-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [mdadm_udev]
Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays.
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.8-x86_64-fallback.img
==> Image generation successful

Tjek the Arch wiki - you will find extensive information on the subject.

https://wiki.archlinux.org/index.php/RAID

Man, they focus on installing the system on Raid and I just want to mount a raid. That’s Arch not Manjaro. I think Manjaro does the /etc/mdadm.conf changes automatically. And both my guide and the Arch wiki guide make you do this so I need special steps for current Manajro.

There is no special for Manjaro - exact same rules and commands applies to Manjaro.

md/raid is the same for all Linux distributions.

Ok but why is the guide which has worked before not working now. I don’t have the Raid after I reboot

I don’t know - you should ask the author of the Ubuntu guide why it don’t work on Manjaro anymore. - it is your system - you know what you have changed, in what order and when.

I have pointed you to the authoritative source of using md/raid on an Arch based system and Manjaro is Arch based - so the reference is valid.

Now I have the raid mounted, going to try rebooting again

Again Raid dissapears

Did you edit you mkinitcpio.conf adding the necessary hooks? And if you did - did you rebuild your initrd?

I was thinking of promoting my previous workstation to server - and I did think it was an option for testing md/radid as I have absolutely no experience with md/raid

You might have to load f2fs support in your initrd.

As an aside, I wouldn’t consider f2fs for a RAID array of any kind.

have you checked this ?
https://wiki.archlinux.org/index.php/RAID

can you reports

sudo cat /etc/fstab
sudo systemctl status lvm2-monitor.service

What do you mean by this? So you mounted it here:

But did you edit /etc/fstab for permanent mount? Like that?

UUID=<UUID> /media/files f2fs defaults 0 0

TY man, I saw a video on Youtube and it said to format partitions for each and that worked

Could you explain that? You skipped raid0 and format both ssd’s?

I have been checking the - and it seems to me you are using the core devices sda and sdb.

I would create partitons with the Linux RAID partition type GUID before creating the raid then using the partitions as target for the RAID.

I have created a raid on 4 disk using RAID10,far2

[manjaro manjaro]# mdadm --create --verbose --level=10 --metadata=1.2 --chunk=512 --raid-devices=4 --layout=f2 /dev/md/md0 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
...

Formatting using ext4.

[manjaro manjaro]# mkfs.ext4 -v -L md127 -b 4096 -E stride=128,stripe-width=512 /dev/md127
...

This is the first time I have tried this so from your topic I expected some problems but the raid mounts automagically even when booting a live ISO.

[manjaro manjaro]# cat /proc/mdstat
Personalities : [raid10] 
md127 : active raid10 sdd2[3] sdc2[2] sdb2[1] sda2[0]
...