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

Bug #1683105 reported by David Lee
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
dmraid (Ubuntu)
Triaged
Medium
Phillip Susi
Artful
Won't Fix
Medium
Unassigned

Bug Description

[Impact]
Users of fakeraid 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.

Tags: patch
David Lee (ramchyld)
affects: linux (Ubuntu) → dmraid (Ubuntu)
description: updated
David Lee (ramchyld)
description: updated
Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

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
Revision history for this message
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.

Revision history for this message
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)
Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
David Lee (ramchyld) wrote :

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

Thanks for fixing it.

Revision history for this message
Phillip Susi (psusi) wrote :

Attaching debdiff for bionic

Revision history for this message
Phillip Susi (psusi) wrote :

Oops, that was artful. This is bionic.

Phillip Susi (psusi)
description: updated
Mathew Hodson (mhodson)
Changed in dmraid (Ubuntu Artful):
importance: Undecided → Medium
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Simon Quigley (tsimonq2) wrote :

The way you could be more verbose is by detailing more precise steps on how to reproduce it. I, for example, don't know how to configure hardware fakeraid with RAID 5. Steps on doing that, with an expected result, should be in the bug report.

Thanks.

description: updated
Revision history for this message
David Lee (ramchyld) wrote :

Well, the issue is that creating an array differs from machine to machine, from controller card to controller card.

steps to reproduce:
1. install 3 or more identical drives into the machine
2. Go into controller setup menu. This usually involves pressing a key combination when prompted by the controller during a brief time window option ROM during disk detection phase.
3. Define a new RAID array. Tag all the disks you wish to set up as part of the array. Set up array as RAID 5.
4. Boot from Ubuntu install DVD or thumb drive as usual.
5. Format drive and create partitions as usual on the RAID array. Proceed with installation as usual. Ubuntu should detect the array because the necessary dmraid packages are on the installation media.
6. Complete the installation and reboot.

Upon reboot, the kernel would drop to an emergency shell because it could not find the kernel modules for dmraid on the ramdisk.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.