Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267383 - upgrade sys-fs/device-mapper & sys-fs/lvm2 for virtio support
Summary: upgrade sys-fs/device-mapper & sys-fs/lvm2 for virtio support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 351772
  Show dependency tree
 
Reported: 2009-04-24 21:19 UTC by Lance Albertson
Modified: 2011-01-16 17:24 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lance Albertson 2009-04-24 21:19:50 UTC
I recently discovered that the current version of device-mapper and lvm2 included with generkenl for the initramfs doesn't work correctly for virtio blocks. The current stable versions of either package (sys-fs/device-mapper-1.02.24-r1 & sys-fs/lvm2-2.02.36) appear to work great and have the additional support for the virtio block devices. The current version will fail to scan the block device and thus, you can't run an LVM root using virtio currently with genkernel.

I simply pulled the latest tarballs and bumped the version in genkernel.conf without any issues. You need to upgrade both in order for this fix to happen. I can provide a patch for the ebuild, but its pretty trivial ;)

Thanks!

Reproducible: Always
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2010-03-24 06:03:33 UTC
genkernel: bump
Comment 2 Kayvan Sylvan 2010-05-03 23:52:27 UTC
I ran into this too. I'm trying to simulate setting up a Gentoo system with 4 disks, each set of 2 disks set up in a software RAID1, with the /boot on an md device and the remainder of the RAID1 devices in a volume group, from which I parse out the root filesystem, etc.

Like this:

(chroot) livecd home # cat /proc/mdstat 
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 vda1[0] vdb1[1]
      97664 blocks [2/2] [UU]
      
md2 : active raid1 vda3[0] vdb3[1]
      25139456 blocks [2/2] [UU]
      
md3 : active raid1 vdc1[0] vdd1[1]
      26213952 blocks [2/2] [UU]
      
unused devices: <none>

(chroot) livecd home # pvscan 
  PV /dev/md2   VG vg   lvm2 [23.97 GiB / 8.97 GiB free]
  PV /dev/md3   VG vg   lvm2 [25.00 GiB / 3.00 GiB free]
  Total: 2 [48.97 GiB] / in use: 2 [48.97 GiB] / in no VG: 0 [0   ]


And so, the set of filesystems, including /, are:

/dev/mapper/vg-root    2064208    311096   1648256  16% /
/dev/md1                 94567      9666     80018  11% /boot
/dev/mapper/vg-home    2064208    115920   1843432   6% /home
/dev/mapper/vg-opt     1032088     34088    945572   4% /opt
/dev/mapper/vg-root    2064208    311096   1648256  16% /root
/dev/mapper/vg-usr    10321208   2098648   7698272  22% /usr
/dev/mapper/vg-var    20642428    211060  19382792   2% /var
/dev/mapper/vg-tmp     2064208     68676   1890676   4% /tmp

Examining the initramfs, I can see that the genkernel generated initramfs does not include any of the virtio modules.

As a result, no virtio block devices are seen and the mdraid devices are never assembled.

Comment 3 Ryan Bourgeois 2010-10-11 05:36:47 UTC
(In reply to comment #2)
> I ran into this too. I'm trying to simulate setting up a Gentoo system with 4
> disks, each set of 2 disks set up in a software RAID1, with the /boot on an md
> device and the remainder of the RAID1 devices in a volume group, from which I
> parse out the root filesystem, etc.
> 
> Like this:
> 
> (chroot) livecd home # cat /proc/mdstat 
> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
> md1 : active raid1 vda1[0] vdb1[1]
>       97664 blocks [2/2] [UU]
> 
> md2 : active raid1 vda3[0] vdb3[1]
>       25139456 blocks [2/2] [UU]
> 
> md3 : active raid1 vdc1[0] vdd1[1]
>       26213952 blocks [2/2] [UU]
> 
> unused devices: <none>
> 
> (chroot) livecd home # pvscan 
>   PV /dev/md2   VG vg   lvm2 [23.97 GiB / 8.97 GiB free]
>   PV /dev/md3   VG vg   lvm2 [25.00 GiB / 3.00 GiB free]
>   Total: 2 [48.97 GiB] / in use: 2 [48.97 GiB] / in no VG: 0 [0   ]
> 
> 
> And so, the set of filesystems, including /, are:
> 
> /dev/mapper/vg-root    2064208    311096   1648256  16% /
> /dev/md1                 94567      9666     80018  11% /boot
> /dev/mapper/vg-home    2064208    115920   1843432   6% /home
> /dev/mapper/vg-opt     1032088     34088    945572   4% /opt
> /dev/mapper/vg-root    2064208    311096   1648256  16% /root
> /dev/mapper/vg-usr    10321208   2098648   7698272  22% /usr
> /dev/mapper/vg-var    20642428    211060  19382792   2% /var
> /dev/mapper/vg-tmp     2064208     68676   1890676   4% /tmp
> 
> Examining the initramfs, I can see that the genkernel generated initramfs does
> not include any of the virtio modules.
> 
> As a result, no virtio block devices are seen and the mdraid devices are never
> assembled.
> 

genkernel can be configured to include the virtio modules in the initramfs by appending the following line to your /etc/genkernel.conf:

MODULES_KVM="virtio virtio_balloon virtio_ring virtio_pci virtio_blk virtio_net"

You can then load the block driver on boot by appending the following to your kernel boot options:

doload=virtio_pci,virtio_blk

I have a guest using the virtio drivers and running entirely on top of LVM whose kernel I build with genkernel using the above method.  I'm using Grub 2 as the bootloader.  I DID NOT use grub-mkconfig as it seems to be broken (I emerged grub-9999 since grub-1.98's root-on-LVM support also seems to be broken).
Comment 4 Sebastian Pipping gentoo-dev 2011-01-13 15:56:17 UTC
device-mapper 1.02.28 seems to build fine but I currently cannot get LVM2 compiling from genkernel.  I get errors for all of 2.02.28, 2.02.36 and 2.02.74.  I have tried applying patches from Gentoo ebuilds, too.

Please help me getting a newer version compiling.
These commands can get you started.

# git clone git://git.overlays.gentoo.org/proj/genkernel.git
# git co -t origin/experimental
# sudo mv /sbin/lvm.static{,_BACKUP}
# sudo GK_SHARE="$PWD" ./genkernel initramfs

Patches found in ${GK_SHARE}/patches/lvm/${LVM_VER}/ are auto-applied for you.
Comment 5 Sebastian Pipping gentoo-dev 2011-01-13 15:58:59 UTC
PS: "git co" is my alias for "git checkout".  Should have said that.
Comment 6 Sebastian Pipping gentoo-dev 2011-01-16 00:32:13 UTC
genkernel-99999 (five nines) is now using LVM 2.02.74 which does not depend on sys-fs/device-mapper any more.