Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463008 - sys-kernel/genkernel-3.4.45: doesn't recognize dmraid with GPT partition
Summary: sys-kernel/genkernel-3.4.45: doesn't recognize dmraid with GPT partition
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-24 19:49 UTC by Markus Lidel
Modified: 2017-01-02 23:21 UTC (History)
0 users

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


Attachments
Patch to fix booting from a GPT partition on a dmraid (genkernel.patch,961 bytes, patch)
2013-03-24 19:51 UTC, Markus Lidel
Details | Diff
Patch to fix booting from a GPT partition on a dmraid (genkernel.patch,945 bytes, patch)
2014-04-03 22:04 UTC, Markus Lidel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Lidel 2013-03-24 19:49:22 UTC
If you want to boot from a dmraid which has a GPT partition, the partitions will not be recognized. dmraid with a MBR partition works as expected.

Reproducible: Always

Steps to Reproduce:
1. create a GPT partition on a dmraid
2. call genkernel to create the initramfs

Actual Results:  
After booting only the RAID is recognized, but not the partitions on it.

Expected Results:  
Partitions will be recognized and be able to boot from them.
Comment 1 Markus Lidel 2013-03-24 19:51:41 UTC
Created attachment 343146 [details, diff]
Patch to fix booting from a GPT partition on a dmraid

Quick hack to include dmsetup and kpartx (if multipathtools are installed) which generates the proper partition block devices
Comment 2 Steve Yin 2013-05-09 05:55:48 UTC
I can absolutely confirm this bug exists. I have multiple computer runing on soft-raid-0 and use GPT/EFI, gentoo won't update the partiton on my raid devices, only listing the whole disk like /dev/mapper/isw_xxxx, no partition at all.

and another problem is the patch on my system don't work either. because 'dmsetup ls --target mirror ' won't return anything. so with kpartx in initramfs, there is still no partition created by kpartx.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2013-06-04 00:48:55 UTC
Thanks for the report.

Which kernels are you guys using?
Comment 4 Steve Yin 2013-06-04 01:18:02 UTC
both hardened-sources-3.8.x and gentoo-sources-3.7.x

and I don't think this problem is kernel related, it's genkernel's bug.
Comment 5 Richard Yao (RETIRED) gentoo-dev 2013-06-04 02:19:23 UTC
(In reply to Steve Yin from comment #4)
> both hardened-sources-3.8.x and gentoo-sources-3.7.x
> 
> and I don't think this problem is kernel related, it's genkernel's bug.

Thanks. I am unfamiliar with dm raid, so I want to try reproducing this on my end.
Comment 6 Steve Yin 2013-07-05 08:55:17 UTC
Ok, the patch provided by Markus Lidel didn't work on my computer, because all my raid are set to use raid0,

but I've found a correct way to activate the gpt partition on dmraid

which should be 

kpartx -a -s /dev/mapper/`dmsetup ls|cut -f 1`

dmsetup ls command will list any existing recognized raid devices like this format:
isw_dfeafdege_Volume0p5	(252:4)
isw_dfeafdege_Volume0p3	(252:3)
isw_dfeafdege_Volume0p2	(252:2)
isw_dfeafdege_Volume0p1	(252:1)
isw_dfeafdege_Volume0p10	(252:9)
isw_dfeafdege_Volume0p9	(252:8)
isw_dfeafdege_Volume0p8	(252:7)
isw_dfeafdege_Volume0p7	(252:6)
isw_dfeafdege_Volume0	(252:0)
isw_dfeafdege_Volume0p6	(252:5)

as you can see, only isw_dfeafdege_Volume0 is needed by kpartx, if dmsetup can output all these partition, kpartx will fall to execute, but if no partition created yet, then dmsetup ls will only ouput one line
isw_dfeafdege_Volume0	(252:0)
then, kpartx should be able to create all these partitions.

I think my solution is not best, because I assume every computer with dmraid only created with one raid volume.

so I think this might be help.
Comment 7 Markus Lidel 2014-04-03 22:04:34 UTC
Created attachment 374206 [details, diff]
Patch to fix booting from a GPT partition on a dmraid

Removed target from dmsetup to rescan all DM devices
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2017-01-02 23:21:42 UTC
[master fcc197b] dmraid: fix booting from a GPT partition on a dmraid.
 Author: Markus Lidel <Markus.Lidel@shadowconnect.com>
 2 files changed, 4 insertions(+)