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
sounds reasonable to me. Please provide the patch as attachment.
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 ?
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
Created attachment 286233 [details, diff] cleaner dmsetup.static patch Sorry, this is the right patch (it also contains your proposed changes).
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.
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