genkernel's generated initramfs cannot boot from a raid device with a partition on it. As an example, if you have your rootfs on /dev/md1p1 (and thus in grub have real_root=/dev/md1p1), then the system can't boot. The bug is a trivial error in the regular expression not accounting for the possibility of a partition on the raid device. I've attached a patch that fixes the parsing problem. Reproducible: Always Steps to Reproduce: 1. Install your rootfs on a raid device with a parition 2. Generate initramfs via genkernel 3. Boot.. watch it fail to find root device. Actual Results: Fails to boot/find rootfs. Expected Results: Should find rootfs...
Created attachment 217438 [details, diff] Patch for genkernel initrd.scripts Fixes regular expression parsing of real_root so it can handle raid devices with partitions.
Created attachment 255475 [details, diff] patch for 'linuxrc' for detecting root if it set through UUID (In reply to comment #1) > Created an attachment (id=217438) [details] > Patch for genkernel initrd.scripts > > Fixes regular expression parsing of real_root so it can handle raid devices > with partitions. > Seems this patch don't fix bug if real_root set up like real_root=UUID=... after `mdadm --assemble` in 'linuxrc' script appears device /dev/md0 (example). but /dev/md0pX appears after `finfs` or `blkid` command. I added some loop in code where determining root device if set as UUID. this patch is not a nice, but works.
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bug's nature in searches...
(In reply to comment #2) > Seems this patch don't fix bug if real_root set up like real_root=UUID=... > after `mdadm --assemble` in 'linuxrc' script appears device /dev/md0 (example). > but /dev/md0pX appears after `finfs` or `blkid` command. > I added some loop in code where determining root device if set as UUID. > this patch is not a nice, but works. The loop mechanism itself is clear, but I am njot aware which of these commands will save us on the second run. In order of appearance: 1) ROOT_DEV=`findfs "${REAL_ROOT}" 2>/dev/null` 2) ROOT_DEV=`busybox findfs "${REAL_ROOT}" 2>/dev/null` 3) ROOT_DEV=`blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/null` Please explain your thinking to me. Thanks!
(In reply to comment #4) > (In reply to comment #2) > > Seems this patch don't fix bug if real_root set up like real_root=UUID=... > > after `mdadm --assemble` in 'linuxrc' script appears device /dev/md0 (example). > > but /dev/md0pX appears after `finfs` or `blkid` command. > > I added some loop in code where determining root device if set as UUID. > > this patch is not a nice, but works. > > The loop mechanism itself is clear, but I am njot aware which of these commands > will save us on the second run. In order of appearance: > > 1) ROOT_DEV=`findfs "${REAL_ROOT}" 2>/dev/null` > > 2) ROOT_DEV=`busybox findfs "${REAL_ROOT}" 2>/dev/null` > > 3) ROOT_DEV=`blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/null` > > Please explain your thinking to me. Thanks! I think what Dmitry is pointing at is tthat the version of mdadm/mdassemble in <=3.4.10 could not assemble raids with partitions well, it was not until we integrated a proper mdadm it could do that wihout problems. I can see I I can set up a test evirontment in a couple of days and try it out.
This was resolved long time ago.