drakkar-lig / debootstick

Generate a bootable live image from any Debian/Ubuntu filesystem tree.
62 stars 18 forks source link

takes forever with lvm #16

Closed dmuhamedagic closed 5 years ago

dmuhamedagic commented 5 years ago

Due to a recent change in the LVM, creating an image takes forever on a host which has LVM setup. What happens is that all LVM programs try to get some information from udev, but there's no connection to it in the chroot, so the programs wait until some timeout. Unfortunately, this makes debootstick unusable for all practical purposes. This affects all tools trying to use LVM in a chroot. There are several reports for this issue, but apparently it may take a while to fix it. A quick workaround would be to bind mount /run/udev during the image build stage.

Maybe even, as a proper feature, to provide pre/post-build hooks?

https://sourceware.org/git/?p=lvm2.git;a=commit;h=a063d2d123c56c4ccead986625a260df16556b9f https://bbs.archlinux.org/viewtopic.php?id=242594 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918590

eduble commented 5 years ago

I tried the following:

But... it still hangs! Newest versions of LVM are tightly coupled with udev...

So unfortunately I do not see any workaround, when using current debootstick code.

eduble commented 5 years ago

Adding a bind mount in debootstick code works. I will push the change.

dmuhamedagic commented 5 years ago

Thanks! I don't know why they introduced that change. The Debian lvm2 package doesn't even depend on udev.

CameronNemo commented 5 years ago

@eduble you may want to use a recursive bind mount for /run, since it has quite a few sub mounts like shm and lock.

eduble commented 5 years ago

@CameronNemo thanks for the tip. The urgent matter was to have a fix ready for debian, because we will enter full freeze for Buster (next stable) in the next few days. So I packaged a new version, with just a regular bind mount for now, because this is what I had tested. And I think this fixed version should be included in Buster (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924252#10). I can test and include the recursive bind in a later version.