mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-27 00:55:34 +03:00
use udev rules to autoassemble a md raid and added mdmon pre-pivot
This commit is contained in:
parent
2394813bf3
commit
379dd5de55
6
modules.d/90mdraid/70-mdadm.rules
Normal file
6
modules.d/90mdraid/70-mdadm.rules
Normal file
@ -0,0 +1,6 @@
|
||||
# This file causes block devices with Linux RAID (mdadm) signatures to
|
||||
# automatically cause mdadm to be run.
|
||||
# See udev(8) for syntax
|
||||
|
||||
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="linux_raid*", \
|
||||
RUN+="/sbin/mdadm -I --auto=yes $root/%k"
|
@ -1,4 +1,8 @@
|
||||
#!/bin/bash
|
||||
dracut_install mdadm
|
||||
inst_hook pre-mount 10 "$moddir/mdraid.sh"
|
||||
[ -x /sbin/mdmon ] && dracut_install mdmon
|
||||
inst_rules "$moddir/70-mdadm.rules"
|
||||
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf "$initdir" /etc/mdadm.conf
|
||||
[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf "$initdir"
|
||||
inst_hook pre-pivot 30 "$moddir/mdmon-pre-pivot.sh"
|
||||
|
||||
|
3
modules.d/90mdraid/mdmon-pre-pivot.sh
Normal file
3
modules.d/90mdraid/mdmon-pre-pivot.sh
Normal file
@ -0,0 +1,3 @@
|
||||
# switch any mdmon instances to newroot
|
||||
[ -f /etc/mdadm.conf ] && /sbin/mdmon /proc/mdstat $NEWROOT
|
||||
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
mdadm --assemble \
|
||||
--homehost=localhost \
|
||||
--auto-update-homehost \
|
||||
--scan
|
||||
|
||||
udevadm settle --timeout=30
|
||||
|
Loading…
Reference in New Issue
Block a user