FS#49071 - [mdadm] mdadm mkinitcpio hook -- md devices need to build before LVM2 hook triggers

Attached to Project: Arch Linux
Opened by Volker Schmidt (connaisseur) - Sunday, 24 April 2016, 17:09 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Thursday, 21 March 2019, 02:06 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

When a md devices holds LVM2 volume groups, the LVM2 hook tries to enable all VGs with a run_earlyhook() function.

This currently fails, because mdhook has only the run_hook() function. Therefore the order in the hooks line of /etc/minitcpio.conf isn't correctly hit!

My HOOKS line looks like this:

HOOKS="base udev autodetect modconf block mdadm lvm2 filesystems keyboard fsck shutdown"

FIX: change run_hook() to run_earlyhook() --> rebuild initrd, boot, works!

See suggested patch file (attached).

Additional info:
* mdadm 3.4-1

Steps to reproduce:

Build a md-device (e.g. raid1), have a lvm2 VG on it. Then make logical volumes with Filesystems in it. Have a correct UUID-based line in /etc/fstab.

This system will hang booting, throwing you into emergency shell.

You'll find inactive VGs and inactive logical devices. Check with vgscan && lvscan.
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Thursday, 21 March 2019, 02:06 GMT
Reason for closing:  Works for me
Comment by Dave Reisner (falconindy) - Sunday, 24 April 2016, 19:28 GMT
The mdadm hook is terrible. I wouldn't recommend using it. Do you have such problems with the mdadm-udev hook?
Comment by Volker Schmidt (connaisseur) - Monday, 25 April 2016, 10:22 GMT
Unluckily, yes. Same behavior.

But with mdadm_udev hook it was not that easy to track down.
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 20 March 2019, 18:22 GMT
Volker, does this still happen?
Comment by Volker Schmidt (connaisseur) - Wednesday, 20 March 2019, 21:13 GMT
Sorry. Can't tell you. Moved away from MD at least a year and a half ago, since that low-cost NAS died on a dead NAND-flash.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 21 March 2019, 02:06 GMT
Ok. Thanks for the update. I tried to reproduce this issue on a VM with MD and lvm2. Also on a bare, that has lvm on luks on md, didn't happen. If this issue manifests again I'll re-open.

Loading...