preseed LVM partition recipe broken

Bug #433092 reported by Bruce Edge
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
partman-auto-lvm (Ubuntu)
Triaged
High
Mathieu Trudel-Lapierre

Bug Description

Binary package hint: partman-base

I've spent weeks working with preseed LVM partitioning. I've come to the conclusion that there is little relationship between the sizes in a recipe and the actual allocations. The first couple of partitions in a recipe are OK, but then they wildly diverge.
I've made some test cases, that include the preseed files, the partman logs and the resultant lvs output.

In the first case, partman.ok1, the last partition is dropped completely. I removed it from the 2nd and 4rd test cases to simplify the test case.

I expected partman would vary the partition size.

The following attachment is a tgz containing:
partman.ok1
partman.ok2
partman.ok3
These are all variants of the LVM partition in the partman recipe preseed files, the parman logs, and lvs output.
The requested sizes vary by a factor of 10 but the resultant partitions barely change at all.

This is from jaunty, but I verified the same behavior with karmic alpha 5 as well.

The partman packages are the default ones provided on the alternate install CD.

Revision history for this message
Bruce Edge (bruce-edge) wrote :

Looks line attachment was dropped, reattempting to submit.

Revision history for this message
Bruce Edge (bruce-edge) wrote :

Any update on this?

Is this fixed in 9.10, or 10.4?

Revision history for this message
Bruce Edge (bruce-edge) wrote :
Download full text (9.6 KiB)

Here's another tail from /var/log/syslog during the install.

Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/biosgrub
Jul 25 06:31:01 debconf: <-- 10 partman/progress/init/biosgrub does not exist
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/fallback
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS STEP 1
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/efi
Jul 25 06:31:01 debconf: <-- 10 partman/progress/init/efi does not exist
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/fallback
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS STEP 1
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/lvm
Jul 25 06:31:01 debconf: <-- 10 partman/progress/init/lvm does not exist
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/fallback
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> SUBST partman-lvm/text/in_use VG system
Jul 25 06:31:01 debconf: Adding [VG] -> [system]
Jul 25 06:31:01 debconf: <-- 0
Jul 25 06:31:01 debconf: --> METAGET partman-lvm/text/in_use description
Jul 25 06:31:01 debconf: <-- 0 In use by LVM volume group system
Jul 25 06:31:01 debconf: --> PROGRESS STEP 1
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/crypto
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> REGISTER partman-crypto/confirm partman-crypto/confirm_nooverwrite
Jul 25 06:31:01 debconf: <-- 0
Jul 25 06:31:01 debconf: --> PROGRESS STEP 1
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> PROGRESS INFO partman/progress/init/update_partitions
Jul 25 06:31:01 debconf: <-- 0 OK
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/ext3 description
Jul 25 06:31:01 debconf: <-- 0 ext3
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: <-- 0 #%s
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/linux-swap description
Jul 25 06:31:01 debconf: <-- 0 swap
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: <-- 0 #%s
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/ext3 description
Jul 25 06:31:01 debconf: <-- 0 ext3
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: <-- 0 #%s
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/ext3 description
Jul 25 06:31:01 debconf: <-- 0 ext3
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: <-- 0 #%s
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/ext4 description
Jul 25 06:31:01 debconf: <-- 0 ext4
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: <-- 0 #%s
Jul 25 06:31:01 debconf: --> METAGET partman/text/primary description
Jul 25 06:31:01 debconf: <-- 0 primary
Jul 25 06:31:01 debconf: --> METAGET partman/filesystem_short/linux-swap description
Jul 25 06:31:01 debconf: <-- 0 swap
Jul 25 06:31:01 debconf: --> METAGET partman/text/number description
Jul 25 06:31:01 debconf: ...

Read more...

Revision history for this message
Bruce Edge (bruce-edge) wrote :

Attaching the partman log.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in partman-base (Ubuntu):
status: New → Confirmed
Revision history for this message
Bruce Edge (bruce-edge) wrote :

Wow, 5 years just to get a confirmation, that's amazing. Glad I don't still need it.

If anyone cares, I ditched LVM because of this - one cannot pre-seed it's config.

Revision history for this message
john (john-l-montes) wrote :
Download full text (3.8 KiB)

I just happened to run into the same or similar issues recently when attempting to fully automate differing un-attended system builds with ubuntu 14.04 on amd64

I was able to make the provided -atomic and -home recipes work, but they don't offer any control over the sizing of the logical volumes.
The -multi recipe doesn't work.

The expert-recipes don't work either, no matter what I specified, the end was result was the same, I'd get a /root a /swap_1 logical volume and /boot partition, and never close to the sizes specified, nor the filesystem type specified, nor the logical volume name specified :-)

Below are the options and recipe used.
I was about to try using kickstart versus preseed to try and setup LVM on ubuntu how I want. On my rhel/centos systems customizing LVM is a breeze with kickstart automation

### Partitioning
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions
#d-i partman-auto/choose_recipe select atomic
#d-i partman-auto/choose_recipe select expert-recipe
# Give the default VG a name
d-i partman-auto-lvm/new_vg_name string vg
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/guided_size string 90%
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
####
# Experimental disk recipe
#####
d-i partman-auto/expert_recipe string
  custom-lvm :: \
              40 300 300 ext4 \
                      $primary{ } \
                      $bootable{ } \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              2000 4000 10000 ext4 \
                      $lvmok{ } lv_name{lv_root} \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ / } \
              . \
              2000 1000 2000 ext4 \
                      $lvmok{ } lv_name{lv_var} \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                     ...

Read more...

Revision history for this message
Bruce Edge (bruce-edge) wrote :

You're doing EXACTLY what I was working on ... almost 7 years ago.

Apologies for the completely useless comment, but I burned a lot of time on this back then.
I feel your pain.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Reassigning to partman-auto-lvm. Would be nice to get this fixed for the LTS. No promises, but I'll take a look; this should be fairly easily reproducible with the preseeds provided. (Triaged/High)

Changed in partman-base (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
affects: partman-base (Ubuntu) → partman-auto-lvm (Ubuntu)
Changed in partman-auto-lvm (Ubuntu):
assignee: Mathieu Trudel-Lapierre (mathieu-tl) → nobody
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
john (john-l-montes) wrote :

I have an update, and a working solution.

Hat tip to the example Tom Weaver has @ http://www.toms-blog.com/alienvault-lvm-partitioning/

Using Tom's example and some minor sizing modifications and adding a non-LVM /boot, here's an example that works with ubuntu 14.04 amd64

Attached is the Partitioning section and LVM custom recipe that will create /, /swap, /home, /usr, /var and /boot.
This was tested as part of a no-touch un-attended install on a small 8GB VM (qemu/kvm)

The partman LVM recipe parsing can be fragile and un-forgiving :-)

Revision history for this message
ritesh (riteshsharma87) wrote :
Download full text (4.4 KiB)

I have tried multiple examples but LVM size are not getting created as mentioned in expert_recipe and moreover partitions /opt and /var/tmp is getting missed while creating Image. Below is sample code for expert_recipe which I am using. Any suggestion/feedback will be helpful.

      boot-root :: \
              1024 10 1024 ext4 \
                      $primary{ } $bootable{ } \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              42000 11 42000 ext4 $primary{ } \
                      $defaultignore{ } \
                      method{ lvm } \
                      device{ /dev/sda } \
                      vg_name{ vgroot } \
              . \
              4000 20 5000 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvopt } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /opt } \
              . \
              1900 60 2000 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvhome } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /home } \
              . \
              7000 30 8000 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvvar } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /var } \
              . \
              4000 40 5000 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvtmp } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /tmp } \
              . \
              4000 50 5000 ext4 ...

Read more...

Revision history for this message
ritesh (riteshsharma87) wrote :
Download full text (5.0 KiB)

Finally, able to fix number of partition issues, however size of partition needs to be checked. Below is updated code, hope this helps. I will update if partition size is fixed as well.

d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto-lvm/new_vg_name string main
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select multi
d-i partman-auto-lvm/new_vg_name string vgroot
d-i partman-auto/expert_recipe string \
      boot-root :: \
              1024 10 1024 ext4 \
                      $primary{ } $bootable{ } \
                      method{ format } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              100 11 -1 ext4 $primary{ } \
                      $defaultignore{ } \
                      method{ lvm } \
                      device{ /dev/sda } \
                      vg_name{ vgroot } \
              . \
              4096 20 5120 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvopt } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /opt } \
              . \
              1900 60 2000 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvhome } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /home } \
              . \
              7168 30 8192 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvvar } \
                      method{ lvm } format{ } \
                      use_filesystem{ } filesystem{ ext4 } \
                      mountpoint{ /var } \
              . \
              4096 40 5120 ext4 \
                      $lvmok{ } \
                      in_vg{ vgroot } \
                      lv_name{ lvtmp } ...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.