FS#33166 - [dmraid] dm devices created early not mounted by systemd

Attached to Project: Arch Linux
Opened by ilya (leniviy) - Saturday, 22 December 2012, 15:57 GMT
Last edited by Dave Reisner (falconindy) - Friday, 28 December 2012, 19:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
see https://bbs.archlinux.org/viewtopic.php?pid=1208876

at boot:
- initcpio dmraid hook executed
- "add" udev event generated
- 10-dm.rules marks the device as inactive
- "change" udev event generated
- 10-dm.rules marks the device as active
- root FS mounted
- initcpio udev cleanup hook cleans the udev database, including the dm devices
- systemd started
- "add" udev event generated
- 10-dm.rules marks the device as inactive
- 99-systemd.rules marks the device as unplugged
- "Timed out waiting for device" occur
- Dependencies for mount points fail

Solution:

--- /root/10-dm.rules 2012-12-22 15:56:22.541750428 +0000
+++ /usr/lib/udev/rules.d/10-dm.rules 2012-12-22 15:33:05.966246947 +0000
@@ -32,6 +32,8 @@
# is not recommended.
ACTION!="add|change", GOTO="dm_end"

+OPTIONS+="db_persist"
+
# Decode udev control flags and set environment variables appropriately.
# These flags are encoded in DM_COOKIE variable that was introduced in
# kernel version 2.6.31. Therefore, we can use this feature with


Additional info:
* package version(s)
systemd 196-2
device-mapper 2.02.98-1

* config and/or log files etc.

Steps to reproduce:
either download the virtualbox image https://docs.google.com/open?id=0B40Hp1Tx6I6eQVJWYWZUQ21xZk0
or install Arch on a fake raid.
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 28 December 2012, 19:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  dmraid-1.0.0.rc16.3-8
Comment by Dave Reisner (falconindy) - Saturday, 22 December 2012, 16:22 GMT
I had suggested someone do this months ago and they claimed it didn't work.

This isn't the right place to be adding the db_persist option. We don't care about db_persist in later userspace -- it's strictly a hack to placate broken drivers which need to store state in udev's DB.

Please add the following to /lib/initcpio/install/dmraid:

add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"

Regenerate your initramfs, and reboot.
Comment by Dave Reisner (falconindy) - Saturday, 22 December 2012, 16:24 GMT
Also, I'll point out that amongst your half dozen threads, I've inferred that you're using an Intel fakeraid array. You can, and should, use mdadm instead. Purge every last trace of dmraid from your system, add mdadm_udev and shutdown hooks to your initramfs, and also add 'mdmon' to BINARIES= in /etc/mkinitcpio.conf. Regenerate your initramfs. dmraid upstream is very dead, and I can't possibly support it.
Comment by ilya (leniviy) - Saturday, 22 December 2012, 17:06 GMT
I'd love to migrate to mdadm.
> Purge every last trace of dmraid from your system, add mdadm_udev and shutdown hooks to your initramfs, and also add 'mdmon' to BINARIES= in /etc/mkinitcpio.conf. Regenerate your initramfs.
Apparently, that's not enough. I'm kicked to recovery console at boot.
/dev/disk/by-*/ contains symlinks to /dev/sdb1 - one of the disks in the array.
Comment by ilya (leniviy) - Saturday, 22 December 2012, 17:11 GMT
mdadm --detail --scan -v
...
no RAID superblock on /dev/sdc
...
no RAID superblock on /dev/sdb
Comment by ilya (leniviy) - Saturday, 22 December 2012, 17:16 GMT
* --assemble, not --detail
Comment by Dave Reisner (falconindy) - Saturday, 22 December 2012, 17:16 GMT
Strange. Should "just work" and I've made an identical suggestion to others using Intel FakeRAID. I don't have any of the hardware to test this, so you're pretty much on your own. That said, my original request still stands. This bug report can't be fixed as you originally propose.

edit: manual assembly isn't needed. It all gets thrown together by udev. Please post the full output from mdadm if you need further help.
Comment by ilya (leniviy) - Saturday, 22 December 2012, 17:39 GMT
I posted a link to the virtual machine. It has the same RAID format as the real one. Can you try it?
Comment by ilya (leniviy) - Saturday, 22 December 2012, 17:43 GMT
It was created with:
dmraid --format isw --create foobar --type 0 --disk /dev/sdb,/dev/sdc
The RAID on the real machine was created with the BIOS utility.
Comment by ilya (leniviy) - Saturday, 22 December 2012, 20:03 GMT
> Please add the following to /lib/initcpio/install/dmraid:
> add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
This worked. I guess, adding "lvm2" will help too, because its hook contains this command
Comment by Dave Reisner (falconindy) - Saturday, 22 December 2012, 20:06 GMT
Suspected as much. Thanks for pinning this down and confirming. I'll push out a new dmraid package.

Loading...