Md array doesn't assemble at boot

I recently upgraded my NAS to kernel 4.4.1 and now my md raid 5 array doesn't assemble itself at boot. dmesg reveals this: [ 2.299666] md: personality for level 5 is not loaded! and doing lsmod | grep raid reveals that neither md_mod nor raid456 is loaded. If I do mdadm --stop /dev/md0 and then mdadm --assemble /dev/md0 the array will successfully assemble and then doing lsmod | grep raid again shows all the required modules loaded. I've tried doing mkinitramfs -o /boot/initrd.img-4.4.1 4.4.1 with the array assembled and mounted but that doesn't seem to fix my issue. How can I make the module load at boot so my array assembles?

Note: this also happened on kernel 4.4.0 but not on 4.3.3 or 4.3.5

Sounds like you're not loading the modules in the initramfs. I'll need to know the distribution to give you specific help. You may need to add the modules to the configuration file for mkinitramfs.

The distro is debian 7 wheezy.

Look in /etc/initramfs-tools/initramfs.conf and check that the modules you're trying to load are listed there. If not, add them to the modules variable and re-run mkinitramfs.

If that doesn't help, post your mount options for the device from /etc/fstab.

The modules included are "most" which is defined as "Add most filesystem and all harddrive drivers."

This is the mount for that volume:

UUID=0a15427c-c9f7-4640-a267-6a25ec167c9c /media/0a15427c-c9f7-4640-a267-6a25ec167c9c ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2

I'm not too familiar with Debian, sorry.

This is odd, usually these tools specify tools by name, not by an ambiguous group. Is there some sort of setting for all? Just to rule out the possibility that it's not installing the module.

The fstab entry looks good to me.

Check if there's an entry for the modules in /etc/modules? Apparently, that's where they're input, one per line. If you don't see them, throw them in there at the bottom and rebuild initramfs.

These are the only options for modules in initramfs.conf

most - Add most filesystem and all harddrive drivers.

dep - Try and guess which modules to load.

netboot - Add the base modules, network modules, but skip block devices.

list - Only include modules from the 'additional modules' list

and as far as /etc/modules goes no it's not in there so I'll give that a try.

Sounds good.

If that doesn't work, an option may be to try using the dep option in initramfs.conf to get it to detect which modules you need. Do this while you've got all your hardware connected and you've got the md modules loaded. Otherwise results may vary.

Adding the raid456 module to /etc/modules does load the module on boot however the array still doesn't assemble. I get the feeling it's not loading soon enough given the dmesg output below

[ 2.188132] md: md0 stopped.
[ 2.188696] md: bind sdc
[ 2.188811] md: bind sdd
[ 2.188918] md: bind sdb
[ 2.668120] md: personality for level 5 is not loaded!
[ 4.337992] md: raid6 personality registered for level 6
[ 4.337995] md: raid5 personality registered for level 5

also dep doesn't seem to fix the issue either. In fact the module doesn't load at boot with dep just like when it was on most. I did run mkinitramfs while the array was assembled and mounted.

I've found a bug thread about something similar. This is basically saying some modules needed aren't being loaded, so what it looks like is we're missing a driver for raid5. maybe try adding raid5 to /etc/modules and recompile the initramfs?

From what I understand, this is a known issue within both Debian and Ubuntu, so hopefully, we can expect to see a patch come out soon.

That's okay, because adding it to /etc/modules fixed our module loading issue.

Is raid5 a module? I don't think it is. As far as I'm aware raid 5 is covered by the raid456 module which is what I added.

Also...if this is a known issue with Debian I'm interested as to why this doesn't occur on kernels below 4.4

well I fixed it although it isn't ideal. I just compiled all the md stuff directly into the kernel so it doesn't matter what the ramfs says.