Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 302280 - [patch] sys-kernel/genkernel doesn't correctly parse raid devices with partitions
Summary: [patch] sys-kernel/genkernel doesn't correctly parse raid devices with partit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2010-01-26 03:56 UTC by Marshall McMullen
Modified: 2019-07-16 20:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for genkernel initrd.scripts (mdpart.patch,840 bytes, patch)
2010-01-26 03:58 UTC, Marshall McMullen
Details | Diff
patch for 'linuxrc' for detecting root if it set through UUID (genkernel-mdpart-uuid.patch,704 bytes, patch)
2010-11-26 10:58 UTC, Dmitry Pisarev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marshall McMullen 2010-01-26 03:56:41 UTC
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...
Comment 1 Marshall McMullen 2010-01-26 03:58:28 UTC
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.
Comment 2 Dmitry Pisarev 2010-11-26 10:58:29 UTC
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.
Comment 3 Sebastian Pipping gentoo-dev 2011-01-05 23:02:56 UTC
PS: Adding keyword "Inclusion" and "[patch] " prefix to better show this bug's nature in searches...
Comment 4 Sebastian Pipping gentoo-dev 2011-05-31 18:08:12 UTC
(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!
Comment 5 Xake 2011-05-31 22:09:26 UTC
(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.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2019-07-16 20:35:28 UTC
This was resolved long time ago.