Reproduce:
1. 組一個/dev/md0 is a RAID1 made of /dev/sda /dev/sdb,
mdid:5068eccc:e5b86ea8:be8fe496:61ee1fd8
blkid:21df6a4c-bce3-4fe4-8739-8e804f4893dd
2. 把/dev/dm0放在kernel boot parameter,
/boot/grub2/grub.conf :linux16 kernel .. rd.md.uuid=5068eccc:e5b86ea8:be8fe496:61ee1fd8
3. shutdown, unplug /dev/sdb
4. power on, cat /proc/mdstat --> /dev/md0 is inactive. If you configure /dev/md0 as /boot, or / partition in /etc/fstab, you will enter "user intervention" mode, because /dev/md0 can't be mounted.
5. you need to run "mdadm --run /dev/md0" manually to assemble /dev/md0 and reboot successfully.
Conclusion:
Entering "user intervention" mode is correct behavior when we have a degraded raid.
Root cause:
dracut don't assemble the degraded raid unless you configure "hostonly_cmdline" in /usr/lib/dracut/dracut.conf.d/01-dist.conf and re-generate initramfs by executing "dracut -f".
1. when you configure "hostonly_cmdline=yes", we can find 90mdraid.conf under the re-generated $initramfs/etc/cmdline.d
2. $dracut/modules.d/99base/dracut-lib.sh
135 for _i in /etc/cmdline.d/*.conf; do
136 [ -e "$_i" ] || continue
137 while read -r _line || [ -n "$_line" ]; do
138 CMDLINE_ETC_D="$CMDLINE_ETC_D $_line";
139 done <"$_i";
140 done
沒有留言:
張貼留言