My NAS RAID 1 array always is lost on reboot

I am basically mostly following

So I assemble the array with mdadm as described there, did all the cryptsetup stuff, and also created the “Everyday use” scripts as described there.

I do like to shutdown my NAS at night. I mean, it’s a home NAS, we are sleeping and nobody will use it. Just plain stupid to have it running all the time.

But when I boot again - the array is gone, and I have to recreate it with the same mdadm --create command.

Why is that? What am I missing?

Can you post your fstab?

Also looking at the link you followed for creation, I think I’ve seen issues similar to this before where the problem arose from mapping the array to devices (as per your linked examples) rather than partitions on the devices, ie sda1 vs sda, and so on. Perhaps try recreating the array with that in mind?

As always don’t try anything like that without backing up, backing up, backing up!

This is my fstab

UUID=0B6C-4B1F                            /efi           vfat    fmask=0137,dmask=0027 0 2
UUID=b7f83d24-6b3d-4d02-ae42-ae83ee9ecd19 /              ext4    noatime    0 1
UUID=1bdf2d7b-0717-4ea5-85cb-1897c10489f9 swap           swap    defaults   0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
~

No traces of any raid array.

Makes sense that it doesn’t, as those instructions do not contain any such thing.
Also seems to make sense then that it doesn’t get recreated.

But then - how do I get it there?

Speaking of instructions that seem to be missing, do you have an mdadm.conf in /etc/?

This is the config file that should be telling the system how to put your array together on boot.

If that’s missing or blank, it needs to be created/updated with the specifics for your array which can be done with the command given here once you have the array created again :slightly_smiling_face:

Once that’s done and the system is bringing the array back up on reboots you can take the UUID from the mdadm.conf file and add it to fstab with the rest of its mounting options like you would any other drive.

First - thank you for helping out @z580c .

Here comes the weird thing.
I actually did that too before.

My /etc/mdadm.conf in fact already contains:

DEVICE partitions
ARRAY /dev/md0 ....

But here’s the staggering part:
I ran mdadm --detail --scan again - but this time it’s printing a different UUID!

I wonder why that is? I could think that to be the issue. somehow my system generates new UUIDs? Even worse, if it’s doing this on every reboot, that could explain.

However, still unsure about how and why that happens at all.

the recreate issues a new UUID

did you updated this UUID in your mdam.conf

Hi and thanks for chiming in @thefrog

I see, thanks for the info.

Yes I updated the UUID in the conf, but when I reboot, it’s still lost.

I am starting to think that the issue could be that in that old tutorial, they were using whole disks (/dev/sdd, /dev/sde). Which I did myself, but using /dev/sda/ and /dev/sdb.

But maybe I should actually create partitions…

I also tried btw by putting `DEVICE /dev/sda /dev/sdb" but this also did not work.