1

I have an issue where i assemble RAID0 over RAID6 via mdadm as normally, after that i can create file system and mount newly made RAID60 arrays no problem. I update my mdadm.conf, update initramfs an check /proc/mdstat just to be sure.

After reboot, i can see everything assembled as planned, dmesg log provides info about it and all looks good.

If i reboot once again, RAID0 arrays are never assembeled again, system does not know it exist, dmesg log shows only RAID6 arrays assembly and thats it. Commands like:

mdadm -D --scan
cat /proc/mdstat
mdadm --detail /dev/md11 (un-assembeled RAID0 array)

Shows only RAID6 arrays, or/and has no clue about previously seen RAID0 arrays. (md11 does not exist)

I can use

root@server:~# mdadm --assemble --scan
mdadm: /dev/md/11 has been started with 2 drives.
mdadm: /dev/md/14 has been started with 2 drives.
mdadm: /dev/md/15 has been started with 2 drives.
mdadm: /dev/md/13 has been started with 2 drives.
mdadm: /dev/md/12 has been started with 2 drives

Now the RAID0 arrays WILL assemble and start, i can see them, mount them, work with them, previous commands also proves its existence. ALSO i can reboot now, see them again after the first reboot, but if i reboot again, the same story continues - loosing of RAID0 Arrays unless manually assembled.

Any clue why this can be happening?

J B
  • 93
  • 8

2 Answers2

1

You could edit etc/rc.local and add the mount there before the end of the file.

Alternately, you can configure the conf and initrd/initramfs hook.

Adding the conf is the 1st step: mdadm -D --scan > /etc/mdadm.conf

Then (debian example, it can differ by distro):

 pkg -L mdadm | grep initr.*hook
/usr/share/initramfs-tools/hooks
/usr/share/initramfs-tools/hooks/mdadm
update-initramfs -u
update-grub

Another recommended thing is to use in your fstab the UUID instead of dev/md.

Other things to check:

  • Make sure you do not have two definitions for the same RAID device /dev/md in your mdadm conf.

  • If the above is fine, you can use dpkg-reconfigure mdadm and update-initramfs -u (choose "all" disks to start at boot and update info)

Overmind
  • 2,970
  • 2
  • 15
  • 24
  • Thank you, sorry for not mentioning - this server has Debian 4.9.82-1+deb9u3 (2018-03-02). Iam not sure about pkg -L command, since my dsitro has only pkg-config. Things you said to check are allright - iam using mdadm --examine --scan --config to automatically fill up the mdadm.conf. Iam not mounting the RAIDs via fstab yet, sicne i dont want to end up in bussy box (ass many time before) when arrays fail to assembly. If you can please elaborate little bit more on the hooks part - first time seeing it. Meanwhile trying the rest. – J B Feb 28 '19 at 09:18
0

So i managed to solve with not-really nice solution

I simply created rc.local with:

#!/bin/sh
mdadm --assemble --scan
mount /dev/md11 /mnt/vol0
mount /dev/md12 /mnt/vol1
mount /dev/md13 /mnt/vol2
mount /dev/md14 /mnt/vol3
mount /dev/md15 /mnt/vol4
exit 0

This way the arrays always assemble and all seems fine, i tried to create some files on each volume, reboot several times, it works as expected

Anyway i dont like this solution very much, but since i was unable to find any other solution for this interesting bug, it is what it is :/

J B
  • 93
  • 8