Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 382555 - dmraid depends on dmsetup to assign UUID to discovered RAID volumes
Summary: dmraid depends on dmsetup to assign UUID to discovered RAID volumes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-11 00:12 UTC by Julian Pidancet
Modified: 2011-09-13 09:12 UTC (History)
0 users

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


Attachments
Include dmsetup when generating initramfs (gen_initramfs-include-dmsetup.patch,658 bytes, patch)
2011-09-11 11:30 UTC, Julian Pidancet
Details | Diff
cleaner dmsetup.static patch (dmsetup.static.patch,544 bytes, patch)
2011-09-12 17:08 UTC, Fabio Erculiani (RETIRED)
Details | Diff
cleaner dmsetup.static patch (dmsetup.static.patch,2.03 KB, patch)
2011-09-12 17:15 UTC, Fabio Erculiani (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Pidancet 2011-09-11 00:12:18 UTC
I've got a gentoo system installed on lvm logical volumes on top of a firmware (isw) RAID volume. I am generating an initramfs using genkernel with the --dmraid and --lvm options.

Since dmsetup.static (which compiled as part of the lvm2 package) never gets copied into the initramfs, dmraid correctly detects my RAID volumes and create the right entries in /dev/mapper, but never assigns UUID to it.

Here is the output of dmsetup info on the RAID volume once the system is booted:
> sudo dmsetup info isw_bhhaagejd_array 
Name:              isw_bhhaagejd_array
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        2
Event number:      0
Major, minor:      252, 0
Number of targets: 1

I am expecting a UUID: DMRAID-isw_bhhaagejd_array line here or something similar...

I wrote a quick and dirty patch for the /usr/share/genkernel/gen_initramfs.sh script:
--- /usr/share/genkernel/gen_initramfs.sh	2011-09-11 01:59:43.000000000 +0100
+++ gen_initramfs.sh	2011-09-11 01:59:29.120994789 +0100
@@ -247,6 +247,10 @@
 		print_info 1 '          LVM: Adding support (using local static binary /sbin/lvm.static)...'
 		cp /sbin/lvm.static "${TEMP}/initramfs-lvm-temp/bin/lvm" ||
 			gen_die 'Could not copy over lvm!'
+		if [ -e '/sbin/dmsetup.static' ]
+		then
+			cp /sbin/dmsetup.static "${TEMP}/initramfs-lvm-temp/bin/dmsetup"
+		fi
 	elif [ -e '/sbin/lvm' ] && LC_ALL="C" ldd /sbin/lvm|grep -q 'not a dynamic executable'
 	then
 		print_info 1 '          LVM: Adding support (using local static binary /sbin/lvm)...'

Then, regenerated my initramfs, rebooted. Now I got:

> sudo dmsetup info isw_bhhaagejd_array
Name:              isw_bhhaagejd_array
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        2
Event number:      0
Major, minor:      252, 0
Number of targets: 1
UUID: DMRAID-isw_bhhaagejd_array

I am reporting this issue because grub2 (grub-1.99) refuses to install on a raid volume if the volume has no UUID assigned. (I now grub2 is not yet supported on the stable version of gentoo)

Regards,


Reproducible: Always
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2011-09-11 07:02:25 UTC
sounds reasonable to me.
Please provide the patch as attachment.
Comment 2 Julian Pidancet 2011-09-11 11:30:28 UTC
Created attachment 286113 [details, diff]
Include dmsetup when generating initramfs

This is the patch I used. But this is probably not what we're looking for, for the following reasons:

1) I do not know if copying dmsetup into the initramfs should be done in append_lvm() or in append_dmraid(). Since dmraid needs it, but the binary is part of the lvm2 package.

2) Should geninitramfs try to compile the binary if it is not found on the root filesystem ?
Comment 3 Fabio Erculiani (RETIRED) gentoo-dev 2011-09-12 17:08:25 UTC
Created attachment 286231 [details, diff]
cleaner dmsetup.static patch

Could you try the following patch?
It adds compiled dmsetup.static to initramfs.

Let me know
Comment 4 Fabio Erculiani (RETIRED) gentoo-dev 2011-09-12 17:15:18 UTC
Created attachment 286233 [details, diff]
cleaner dmsetup.static patch

Sorry, this is the right patch (it also contains your proposed changes).
Comment 5 Julian Pidancet 2011-09-12 21:20:15 UTC
I tried your patch on my system. Here are the relevant output of genkernel:

* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Appending busybox cpio data...
*         >> Appending lvm cpio data...
*           LVM: Adding support (using local static binary /sbin/lvm.static)...
*         >> Appending dmraid cpio data...
* DMRAID: Adding support (compiling binaries)...
*         >> Appending modules cpio data...

dmsetup seems to be there:

> zcat /boot/initramfs-genkernel-x86_64-3.0.4 | cpio -t 2> /dev/null | grep dmsetup
bin/dmsetup

It's all good for me.
Comment 6 Fabio Erculiani (RETIRED) gentoo-dev 2011-09-13 09:12:26 UTC
Thanks,
fixed in git:

+  13 Sep 2011; Fabio Erculiani <lxnay@gentoo.org> gen_compile.sh,
+  gen_initramfs.sh:
+  dmraid requires dmsetup to assign UUID to discovered RAID volumes, close bug
+  #382555