Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#621118: partman-auto-lvm: "error creating group" using a preseed recipe with 2 PV on the same disk

87 views
Skip to first unread message

Martín Perazzo

unread,
Apr 6, 2011, 12:30:02 PM4/6/11
to
Package: partman-auto-lvm
Version: 39
Severity: important


while attempting to install debian squeeze using the following recipe:

d-i partman-auto/expert_recipe string layout :: \
252 256 257 ext3 \
$primary{ } \
$bootable{ } \
device{ /dev/sda } \
method{ format } \
mountpoint{ /boot } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
20071 20480 20481 ext3 \
$primary{ } \
device{ /dev/sda } \
method{ lvm } \
vg_name{ rootvg } \
format{ } . \
8817 8997 10000000000 ext3 \
$primary{ } \
device{ /dev/sda } \
method{ lvm } \
vg_name{ infravg } \
format{ } . \
60 3071 3072 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 1 } \
method{ format } \
mountpoint{ / } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
80 4095 4096 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 2 } \
method{ format } \
mountpoint{ /usr } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
10 511 512 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 3 } \
method{ format } \
mountpoint{ /opt } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
20 1023 1024 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 4 } \
method{ format } \
mountpoint{ /tmp } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
20 1023 1024 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 5 } \
method{ format } \
mountpoint{ /var } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
20 1023 1024 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 6 } \
method{ format } \
mountpoint{ /home } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
20 1023 1024 linux-swap \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 7 } \
method{ swap } \
format{ } . \
2 127 128 ext3 \
$lvmok{ } \
in_vg{ rootvg } \
lv_name{ 8 } \
method{ format } \
mountpoint{ /system } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \
40 2047 2048 ext3 \
$lvmok{ } \
in_vg{ infravg } \
lv_name{ 9 } \
method{ format } \
mountpoint{ /images } \
filesystem{ ext3 } \
use_filesystem{ } \
format{ } . \

installation was halted with the following error "Autopartioning using LVM failed because an error occurred while creating a volume group"
here is the last lines from syslog:
Apr 6 15:30:55 partman: No volume groups found
Apr 6 15:30:55 partman:
Apr 6 15:30:55 partman: Reading all physical volumes. This may take a while...
Apr 6 15:30:55 partman-lvm:
Apr 6 15:30:55 partman-lvm: No volume groups found
Apr 6 15:30:55 partman-lvm:
Apr 6 15:30:56 partman-lvm: Physical volume "/dev/sda3" successfully created
Apr 6 15:30:56 partman-lvm: Volume group "debian" successfully created
Apr 6 15:30:57 partman-lvm: Physical volume "/dev/sda2" successfully created
Apr 6 15:30:57 partman-lvm: Volume group "infravg" successfully created
Apr 6 15:30:57 partman-lvm: Logical volume "9" created
Apr 6 15:30:58 partman-lvm:
Apr 6 15:30:58 partman-lvm: Physical volume '/dev/sda2' is already in volume group 'infravg'
Apr 6 15:30:58 partman-lvm:
Apr 6 15:30:58 partman-lvm:
Apr 6 15:30:58 partman-lvm: Unable to add physical volume '/dev/sda2' to volume group 'rootvg'.

it seems a "debian" group is created in place of the "rootvg" for some reason.

im attaching preseed.cfg partman and syslog.

-- System Information:
Debian Release: 6.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.37-4.dmz.1-liquorix-686 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

syslog
preseed.cfg
partman

Garinot Pierre

unread,
Apr 28, 2018, 1:10:02 PM4/28/18
to
I also encountered this bug.

The attached patches fixes it for me.
They also should allow using multiple PV for the same VG (not tested).

WARNING:
_ partman-auto.diff applies on top of the one i provided in #896826
_ I have no idea how to get the device in reuse_partitions(), so my
patch set it to 'reuse', that's wrong, but i don't use $reuse{ and
don't even know what it is used for, so i can't test.

What they do:
_ when calling setup_partition() we also give it the device
(/dev/...) associated to it, setup_partition() writes it in
$id/device
_ auto_lvm_create_vg_map() use the previous information to find
the PVs associated to a VG (by checking $id/vg_name)
partman-auto.diff
partman-auto-lvm.diff

Buck Huppmann

unread,
Feb 15, 2022, 9:30:03 AM2/15/22
to
Package: partman-auto-lvm
Version: 59ubuntu3
Followup-For: Bug #621118

I've had this problem as well (with the installer for ubuntu bionic).

The problem in my case, where I was trying to create a VG for each PV
/dev/sda3 and /dev/sda4, was most easily fixed by modifying partman-auto-lvm's
lib/auto-lvm.sh per the attached.

First thing to note is that your preseed file *has* to specify that one
of the VG's that you configure up with `vg_name` is set to be the one
that partman-auto-lvm will use as "@DEFAULT@" (`defvgname`, in the
script), like so:

d-i partman-auto-lvm/new_vg_name string ${one of the vg_names}

; otherwise, partman-auto-lvm will default to creating a new VG with a
name either taken from the hostname or "debian" (or "ubuntu", in my
case) and, when your recipe leaves no free PVs, it will croak, which is
what the original poster encountered. But, even accounting for that,
partman-auto-lvm will make duplicate PV assignments.

But, assuming you then have a recipe containing

... method{ lvm } vg_name { one of the vg_names }

... method{ lvm } vg_name{ another of the vg_names }

then the attached patch will keep from making duplicate assignments
on the same disk.

(To explain briefly, instead of just grabbing any PV and then ending
up with duplicate assignments, it checks the contents of
/var/lib/partman/auto_lvm_map/* and makes sure it's not choosing a PV
that's already been assigned. It's not foolproof, by any means, but it
worked for me, at least, and was easier to finagle into my boot process
[using a `partman/early_command` which overwrote /lib/partman/lib/auto-lvm.sh
in the installer image with my variant by echo-ing each line individually,
a la `{ echo 'line 1'; echo 'line 2'; ...; } > /lib/partman/lib/auto-lvm.sh`,
with `'\''` in place of every embedded single quote. Ugh. Not recommended
for regular use, but terraform handled the details])
auto-lvm.sh.diff
0 new messages