Installation of DMRaid should automatically add necessary modules to /etc/initramfs-tools/modules

Bug #1683105 reported by David Lee on 2017-04-16
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
dmraid (Ubuntu)
Medium
Phillip Susi
Artful
Medium
Unassigned

Bug Description

[Impact]
Users of rake raid using raid 5 can not boot their systems because the required kernel module is not loaded by the initramfs. The hook script simply needs to request this module be loaded.

[Test Case]
Install on a fakeraid raid 5

[Regression Potential]
None. Seriously, the worst that can happen is that the requested module is not loaded anyway.

David Lee (ramchyld) on 2017-04-16
affects: linux (Ubuntu) → dmraid (Ubuntu)
description: updated
David Lee (ramchyld) on 2017-04-16
description: updated
Phillip Susi (psusi) wrote :

The modules file is for the user to manually add modules. Packages add them via their hook script. The dmraid hook script currently adds dm-mod and dm-mirror, but I believe the kernel has changed and now the correct modules are dm-raid and dm-mirror. Can you try editing your dmraid hook script and changing the force_load dm-mod line to dm-raid and see if that fixes it?

David Lee (ramchyld) wrote :

Phillip Susi I will give it a look tonight. I suspect you may be right- I have never seen the dm-mod module even since when I started using RAID, nor has it ever shown up when I do a 'lsmod' on my RAID-enabled systems. I will investigate tonight, and if it is indeed the case, I will try to submit a patch.

David Lee (ramchyld) wrote :

I have confirmed the bug is indeed caused by the hooks calling a module that no longer exists.

The hook involved was /usr/share/initramfs-tools/hooks/dmsetup, not /usr/share/initramfs-tools/hooks/dmraid .

I have attached a patch made to quickly fix the problem. It's not really needed since the issue can be fixed by hand, but for formality's sake it's attached.

Thanks.

David Lee (ramchyld) wrote :

PS: I am aware that dmsetup is a separate package, however I cannot find it on launchpad. I'd be grateful if someone can please redirect this to the correct package.

The attachment "Patch to fix issue (change dm_mod to dm_raid)" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
David Lee (ramchyld) wrote :

Additional notes:
- I removed all the modules pertaining to raid from /etc/initramfs-tools/modules before patching the dmsetup hook and rebuilding the initramfs image. The system boots, so that means the additional modules are added automatically when dm_raid was added.
- There are two "modules" file, one in /etc/initramfs-tools and one in /usr/share/initramfs-tools . It seems that initramfs-tools will only honor the former and ignore the latter.
- The reiserfsprogs package still installs it's initramfs hooks to /etc/initramfs-tools. That one has been filed as a separate bug.

Phillip Susi (psusi) wrote :

That's part of the dmsetup package; you want the one from the dmraid package, but I suppose I can apply it to the right place.

Changed in dmraid (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Phillip Susi (psusi)
David Lee (ramchyld) wrote :

Well, if that's the case, then I propose patching both. After all, dm-mod.ko has been renamed to dm-raid.ko and dmsetup's hook is improper for calling it.

I'm attaching the patch for dmraid as well.

Phillip Susi (psusi) wrote :

Hrm... actually dm-mod is the core device mapper support itself and is still needed. You just don't see the module anymore because Ubuntu started building it into the kernel instead of as a module, but if you are running a kernel where it is built as a module, it still needs loaded. Are you running a raid5 or a mirror?

David Lee (ramchyld) wrote :

Well, I'm running RAID5 on my media storage build and RAID0 on my gaming build.

Noted however. But we have already observed that the behavior is caused by the dm-raid module not getting added to the init ramdisk. Either way it can be solved by adding the module to the hooks of either dmsetup or dmraid.

David Lee (ramchyld) wrote :

Well, I did more tests and I guess it's okay if we just add the dm-raid module load to the dmraid hook. I just did some more testing and it works out. I withdraw my two patches and upload a new patch that will just add dm-raid force load to the dmraid hook.

Phillip Susi (psusi) wrote :

Yes, for raid5 you need the dm-raid module, but iirc, not for a raid0.

FYI, unless you are dual booting with Windows you should use conventional linux md raid rather than fake/dmraid, as md is far better supported and properly handles failures and reshapes, which fakeraid does not.

David Lee (ramchyld) wrote :

Well, tbh, I am having similar issues on another machine running RAID-0 (striped), so I do think that dm-raid is required on that too. Maybe it's RAID-1 (mirror) that doesn't need it but instead needs the dm-mirror module?

In any case, I understand the risks. I'm trying this out as research because there are circumstances that using "fakeraid" may be beneficial, for example recent cases where several Lenovo and Asus laptops are locked into "fakeraid" in addition to Secure Boot as a form of lock in to Windows 10- I'm convinced that with the use of kpartx + dmraid and proper disk preparation, one could get those working with Linux without the use of kernel hacks (my machines currently have their disks set up as GPT, but with a MBR compatibility partition for booting legacy GRUB).

I'm also interested in the aspect where the system would assign memory for read-caching to further improve performance (one AMD system I have assigns 256MB of system memory for this).

I also wish to research NVidia's claim that the NForce's RAID is hardware accelerated (both machines I have the RAID issue on runs off these NForce 980a motherboards).

Lastly, I use drive trays on one of the two builds, it seems to have reliability issues if the drives in them are set up as AHCI, but behaves properly if the drives are set up as RAID-0.

Phillip Susi (psusi) wrote :

I have uploaded a patched dmraid to my ppa, could you please test it and verify that it works and then I will have someone upload it to the main archive:

https://launchpad.net/~psusi/+archive/ubuntu/ppa

David Lee (ramchyld) wrote :

I took a look and yes, it appears to fix the issue.

Thanks for fixing it.

Phillip Susi (psusi) wrote :

Attaching debdiff for bionic

Phillip Susi (psusi) wrote :

Oops, that was artful. This is bionic.

Phillip Susi (psusi) on 2017-12-05
description: updated
Changed in dmraid (Ubuntu Artful):
importance: Undecided → Medium
Simon Quigley (tsimonq2) wrote :

Sorry for the delay here.

Artful is EOL so that can't be fixed any longer.

Could you please be more verbose in the SRU bug description, specifically the test case?

When that's done, resubscribe ~ubuntu-sponsors and I'll be happy to review.

Thanks.

Changed in dmraid (Ubuntu Artful):
status: New → Won't Fix
Phillip Susi (psusi) wrote :

I'm not sure how I could be more verbose. It is as simple as install Ubuntu on a computer that has a hardware fakeraid configured for raid5.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers