Partitions on dmriad managed array are not mounted, system cannot boot

Bug #2047303 reported by Evgeny Grin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dmraid (Debian)
New
Undecided
Unassigned
dmraid (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Starting from jammy (22.04LTS) system failed to add any partitions from dmraid-managed array (Intel Software RAID). The array itself is mounted correctly (both as /dev/dm-0 and /dev/mapper/isw_xxxx), but no partitions are visible (no device like /dev/mapper/isw_xxxx1, /dev/mapper/isw_xxxx2).

It was reported many times on various sites, for example:
https://askubuntu.com/questions/1443274/boot-fails-after-upgrading-from-20-04-to-22-04-on-dmraid-device-no-partitons
https://askubuntu.com/questions/1405817/system-boots-to-initramfs-after-upgrade-from-21-10-to-22-04
https://askubuntu.com/questions/1448141/installation-problems-ubuntu-22-10-on-acer-aspire-3410-1tb-4gb-ram
https://askubuntu.com/questions/1420457/not-booting-from-raid-after-upgrade-from-21-10-to-22-04

If kpartx or partprobe are used on mounted raid device then partitions are added, however the next reboot requires manual actions again.

I was able to trace the problem down to the root cause.

The dmraid package provides udev 97-dmraid.rules file.
This file has lines

ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="DMRAID-*", \
 RUN+="/sbin/kpartx -a /dev/$kernel"

The used environment variable DM_STATE was set by /usr/lib/udev/dmsetup_env (from multipath-tools package) and DM_UUID is set by both dmsetup_env and 55-dm.rules (from dmsetup package).

However, Debian removed dmsetup_env starting from version 0.8.8-1 (dated Jan 2022) of multipath-tools with wrong comment that additional variables are not used anywhere.
See https://metadata.ftp-master.debian.org/changelogs/main/m/multipath-tools/multipath-tools_0.9.4-7_changelog and https://salsa.debian.org/linux-blocks-team/multipath-tools/-/commit/4ab9ce259ffa75ed3e2d145b3f2effc22af7b4c6

As the result DM_STATE is not set anywhere and kpartx from 97-dmraid.rules is not executed anymore.

The possible fixes are:
* restore dmsetup_env (the file could be reduced to set only DM_STATE variable)
* replace second rule in 97-dmraid.rules with
ENV{DM_ACTIVATION}=="1", ENV{DM_UUID}=="DMRAID-*", \
 RUN+="/sbin/kpartx -a /dev/$kernel"

The fix should be used for jammy (22.04LTS), lunar (23.04), mantic (23.10) and noble.

Sidenote: mdadm cannot correctly detect the Intel Software RAID used on my computer.

Tags: patch
Revision history for this message
Evgeny Grin (k2k-p) wrote :
Revision history for this message
Evgeny Grin (k2k-p) wrote :

The problem can be easily reproduced in VM.
Just add two disk devices and create ISW raid on them with dmraid.

I used the next command to create test array:

dmraid -f isw -C HDD_SWRAID --type 0 --disk /dev/sda,/dev/sdb

Then create any partition on the array and reboot. The block devices will be "visible" for the system, but partitions are not.

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

The attachment "Suggested patch" 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
pasaporte (josedky73) wrote :

Thank you for the fix, I couldn't understand why the raid would be detected on first install, and then if I assigned a partition to be mounted on load the system would just time out, I really appreciate it. Kudos to you.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dmraid (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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