Page MenuHomeSolus

Initramfs missing mdadm
Open, WishlistPublic

Description

I am migrating my Solus installation from the default MBR installation to GPT/EFI/MD/LUKS/LVM.

I believe I have completed all of the steps properly, but I am missing md support in the initramfs. I am able to boot into initram via UEFI, but dracut times out saying it can't find my disks. All the UUID's are correct, but the MD mirror isn't assembled. No mdadm.

My /boot partition was generated from the live usb via chroot using CBM v1.5.5 (I ran eopkg up before running CBM).

Should there be an md/raid option in /boot/loaders/entries/Solus-current-4.14.13-46.conf?

Not sure where to go from here.

Event Timeline

Also, just to clarify, the /boot partition is not in the md mirror, just root and swap. The ESP seems to be working fine since I'm able to get into initramfs.

Adding to Software project since it is probably a CBM issue.

Also, just to clarify, the /boot partition is not in the md mirror, just root and swap. The ESP seems to be working fine since I'm able to get into initramfs.

/boot isn't the problem. dracut needs the md hooks to mount root before switching to rootfs

Adding to Software project since it is probably a CBM issue.

This is actually a kernel/dracut issue because that is where all this takes place.

@DataDrake

Thank you for your response.

/boot isn't the problem. dracut needs the md hooks to mount root before switching to rootfs

Yes, I was just trying to provide a more complete description of the system.

This is actually a kernel/dracut issue because that is where all this takes place.

Understood. I'm not sure of the scope of CBM. I thought it might affect what hooks are available to dracut, but I guess not. I am out of my depth at this point.

Figured I'd add onto this ticket as I have a bootable system now with some minor maintenance for kernel package updates. I set this up with edk2/ovmf-x64 in libvirt using two ide drives. Boot from raid works when one drive removed as well.

Setup Steps:

First boot into the Solus Project 3 iso.

Install mdadm.

sudo eopkg it mdadm;

Configure drives in gparted with GPT partition table, a 512mb fat32 partition with boot, esp labels, and an unformatted partition with raid label.
Then setup root raid partition. Edit* We don't setup /dev/md0 boot raid yet as it causes the install to hang while probing drives.

sudo mdadm --create /dev/md1 --raid-devices=2 --level=1 /dev/sd[ab]2;

Perform Solus installation choosing /dev/md1 for root with automated partitioning and /dev/sda1 for boot partition. I chose luks and lvm options.
Setup boot raid and format fat32. We use metadata 1.0 so the EFI partitions can still be read separately at boot time.

sudo mdadm --create /dev/md0 --metadata 1.0 --raid-devices=2 --level=1 /dev/sd[ab]1;
sudo mkfs.fat -F32 /dev/md0;

Mount and chroot into new install.

sudo mount /dev/mapper/SolusSystem-Root /mnt;
sudo mount /dev/md0 /mnt/boot;
for i in /dev /proc /sys /run; do sudo mount -B $i /mnt$i; done;
sudo chroot /mnt;

Install mdadm into new installation and generate mdadm.conf.

sudo eopkg it mdadm;
sudo mdadm --detail --scan >> /etc/mdadm.conf;

Add boot line to fstab (so clr-boot-manager uses this rather than trying to mount /dev/sda1). Use blkid to lookup your UUID for /dev/md0

UUID=8499-F70D  /boot  vfat  noatime  1  2

Setup conf file for dracut so initrd will understand raid by creating /etc/dracut.conf.d/mdadm.conf

add_modules+="mdraid"

Look up raid md device UUID's for inclusion in kernel cmdline.

mdadm --misc -D /dev/md0 | grep UUID;
mdadm --misc -D /dev/md1 | grep UUID;

Add our raid md devices to cmdline conf /etc/kernel/cmdline.d/10_mdadm.conf.

rd.md.uuid=827e79cf:6ab2e451:29174d88:311afd47 rd.md.uuid=39d30f26:10d2a54e:538e6aff:d6637330

Regenerate initrd and rerun clr-boot-manager

sudo dracut -f /usr/lib64/kernel/initrd-com.solus-project.current.$(uname -r | cut -d. -f1-3) --kver $(uname -r);
sudo clr-boot-manager update;

Reboot!

Notes:

When your linux kernel package updates you'll need to rerun the dracut portion with the correct kernel version and initrd filename.
Example - For my setup the first update added kernel 4.15.7-60.current;

sudo dracut -f /usr/lib64/kernel/initrd-com.solus-project.current.4.15.7-60 --kver '4.15.7-60.current';
sudo clr-boot-manager update;

Usability requests:

Add mdraid module to packaged initrd. Since we set the cmdline with rd.md.uuid= we don't need /etc/mdadm.conf to be included in initrd so this should remain universal.
Allow selection of raid fat32 partition for boot during install.
Generate mdadm.conf cmdline variables when raid drive chosen for root / boot during install.
Help clr-boot-manager understand raid so we don't have to keep /boot mounted.

DataDrake triaged this task as Wishlist priority.Oct 16 2018, 7:49 PM