Unable to kickstart with LVM partition scheme.

Bug #475864 reported by Cody Herriges
52
This bug affects 10 people
Affects Status Importance Assigned to Milestone
kickseed (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Attempting to prepare Karmic for deployment into our environment and running into a road block. With jaunty's introduction of LVM we migrated our partitioning scheme to be fully LVM based except for /boot. This has worked very well for us. Using the same partitioning scheme in Karmic fails. Informing me that I have not declared a separate partition for /boot then halts with the 'No physical volume defined in volume group' error about the automatic partitioning scheme and sends me back to the partition scheme selection menu. Of which I never saw in jaunty. At this point the only thing that works is the selection of 'Use entire disk' and this sets things up as normal partitions. Selection of either LVM options gives me the same error as I initially get when kickstart first attempts the partitioning. Leading me to believe that kickseed is in fact not even reading my custom partitioning scheme. I can't even select Manual at the selection screen. This does nothing and just drops me back at the selection screen. Syslog logs no obvious errors.

# Partition clearing information
clearpart --drives vda --initlabel
# Disk partitioning information
part /boot --fstype=ext4 --size=600 --ondisk=vda
part pv.01 --size=1 --grow --ondisk=vda
volgroup vg00 pv.01
logvol / --name=rootvol --vgname=vg00 --size=20480 --fstype=ext4
logvol swap --name=swapvol --vgname=vg00 --size=4096
logvol /var --name=varvol --vgname=vg00 --size=6144 --fstype=ext4
logvol /tmp --name=tmpvol --vgname=vg00 --size=3072 --fstype=ext4
logvol /disk/trump --name=trumpvol --vgname=vg00 --size=1 --grow --fstype=ext4

Description: Ubuntu 9.10
Release: 9.10

Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Cody Herriges (ody-cat) wrote :

Previous attachment was in error.

Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Kyle Rankin (greenfly-greenfly) wrote :

For what it's worth, this issue seems to affect regular kickseeding as well. A kickseed partition configuration that worked fine in Jaunty seems to be ignored in Karmic. I even tried the latest system-config-kickstart to see if the syntax changed but it still seemed to ignore any part lines (it seemed to see the clearpart though).

I even tried to switch to preseeding partition settings but like the original poster, it seems that anything that actually defines a custom partitioning scheme is ignored and the only thing that works is preseeding it to use the full disk and automatically partitioning it with a single / and swap.

Jorge Castro (jorge)
Changed in kickseed (Ubuntu):
status: New → Confirmed
tags: added: regression-release
Revision history for this message
Jacques-Olivier Farcy (jakatak) wrote :

Hi,

I am also preparing a kickseed file for Karmic deployment.

I have the same problem, the lines :

clearpart --all --initlabel
part swap --size 512 --ondisk sda
part / --fstype ext4 --size 8192 --ondisk sda
part /home --fstype ext4 --size 1 --grow --ondisk sda

Are not working, i have to do a manual partitioning

Good luck !

Revision history for this message
Cody Herriges (ody-cat) wrote :

This is still affecting Lucid as of the builds available on Feb 24. Is there an alternate way to feed kickseed/partman your custom partitioning information that is documented or is this not going to be available by release? I am unable to upgrade my 100 Ubuntu systems beyond Jaunty and I am starting to look at a different Linux distribution for my users.

Revision history for this message
Cody Herriges (ody-cat) wrote :

I did further testing today. If you go the route of preseeding partman you can get a little closer to the behavior that was working in Jaunty. I have dropped this into a preseed.cfg file

# Selecting proper disk
d-i partman-auto/disk string /dev/vda
# Removing LVM partitions
d-i partman-lvm/device_remove_lvm boolean true
# Picking LVM
d-i partman-auto/method string lvm
# Creating layout
d-i partman-auto/expert_recipe string boot-root :: 512 1024 768 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . 15360 18432 20480 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . 5120 5632 6144 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . 1024 512 4096 linux-swap $lvmok{ } method{ swap } format{ } . 1024 2048 3072 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /tmp } . 300 400 -1 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /disk/trump } .
# Confirm LVM selection
d-i partman-lvm/confirm boolean true
# Finish up
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true

If I reference this preseed.cfg on the kernel boot line with preseed/url=http://$myurl things work as intended. If I move this to my kickstart file and change the 'd-i' to preseed then everything is honored except the 'partman-auto/expert_recipe string' line, this is being ignored. Instead partman chooses the pre-defined scheme atomic and continues on its marry way. If I replace my expert recipe with 'partman-auto/choose_recipe select multi' this is honored and it uses this scheme properly.

While declaring the preseed.cfg at boot is a work around it breaks our deployment strategy and removes a piece of automation we have in place. Please look at this before release.

Revision history for this message
Cody Herriges (ody-cat) wrote :

I have hacked in a solution to this for my implementation using preseeding. My kickstart file now contains the following.

# Selecting proper disk
preseed partman-auto/disk string /dev/vda
# Removing LVM partitions
preseed partman-lvm/device_remove_lvm boolean true
# Picking LVM
preseed partman-auto/method string lvm
# Confirm LVM selection
preseed partman-lvm/confirm boolean true
# Finish up
preseed partman/confirm_write_new_label boolean true
preseed partman/choose_partition select finish
preseed partman/confirm boolean true

# To get my custom layout I have to circumvent kickseed so I have added.

%pre
echo 'd-i partman-auto/expert_recipe string boot-root :: 512 1024 768 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . 15360 18432 20480 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . 5120 5632 6144 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . 1024 2048 4096 linux-swap $lvmok{ } method{ swap } format{ } . 1024 2048 3072 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /tmp } . 300 400 -1 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /disk/trump } .' >> /var/spool/kickseed/parse/preseed.cfg

Revision history for this message
Cody Herriges (ody-cat) wrote :

Noticed that my previous work around can be modified to work a little more properly. The reason that the partman-auto/expert_recipe portion of my preseed block was not working was a parse error on the behalf of kickseed. Instead of echoing the preseed information into the preseed.cfg file you can use the normal kickstart preseed syntax, if you enclose the recipe in single quotes. This is normally outside the normal preseed syntax for the debian installer. So the %pre section an be replaced with:

preseed partman-auto/expert_recipe 'string boot-root :: 512 1024 768 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . 15360 18432 20480 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . 5120 5632 6144 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . 1024 2048 4096 linux-swap $lvmok{ } method{ swap } format{ } . 1024 2048 3072 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /tmp } . 300 400 -1 ext4 $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /disk/trump } .'

Revision history for this message
Mei (ddouthitt) wrote :

A year and a quarter, this bug still exists - and in Ubuntu Server 10.04 LTS. This far on and the bug still isn't assigned, and its importance is "Undecided"?

Let's move on this!

Revision history for this message
rahulpalampur2007@gmail.com (rahulpalampur2007) wrote :

Even now I can't create custom partitions using Kickstart file. It seems to overwrite those changes. Will this bug be solved or not????????? Its March 2012 now, 2+ years for bug to be in open state!!!

Revision history for this message
Mick Pollard (aussielunix) wrote :

I was able to get this working in Lucid amd64 with some preseed magic embedded into the kickstart file.
This is a snippet from my test kickstart file.

clearpart --all --initlabel
part /boot --fstype ext4 --size 200 --asprimary
part swap --size 1024
part pv.01 --size 1 --grow
volgroup rootvg pv.01
logvol / --fstype ext4 --vgname=rootvg --size=1 --grow --name=rootvol
# needed to answer the 'do you want to write changes to disk"
preseed partman-lvm/confirm_nooverwrite boolean true

# needed to answer the question about not having a separate /boot
preseed partman-auto-lvm/no_boot boolean true

Revision history for this message
Mark Hamzy (mark-hamzy) wrote :

I just encountered this issue on xenial. I did define a /boot partition outside of the LVM grouping.

FWIW, "d-i partman-auto-lvm/no_boot boolean true" does get past the issue

Obviously this bug will never be fixed. :(

Revision history for this message
Marco Schmidt (kunzol) wrote :

I tried the partitioning now for several ours and found a working config for xenial.

----
bootloader --location=mbr
clearpart --initlabel --drives sda
partition --size 1000 --asprimary --fstype ext4 /boot
partition --size 8000 --grow --asprimary pv.local
volgroup local pv.local
logvol --name root --vgname local --size 10000 --maxsize 100000000 --fstype ext4 /
logvol --name swap --vgname local --size 4096 --maxsize 100% swap
preseed partman-auto-lvm/new_vg_name string local
----

I encountered the following traps:
1. Without "clearpart" the preseed of "partman-auto/method" is not set to "lvm"
2. the name in "volgroup" is ignored and has to be added separately with the preseed of "partman-auto-lvm/new_vg_name string local"
3. the "asprimary" at "pv.local" is ignored and a extended partition is created.

Number 2: could be treated as a "bug" and I assume it can be fixed by adding one line in "volgroup.sh"

Number 3: is probably not the fault of "kickseed", but I couldn't find out why partman ignores this.

Revision history for this message
Jim Campbell (jwcampbell) wrote :

I'm still seeing this on 16.04.3. The 'expert_recipe' partitioning string is being skipped / ignored. i.e., anything that looks like this:
---
preseed partman-auto/expert_recipe string \
      boot-root :: \
              500 500 500 ext4 \
                      $primary{ } \
                      $bootable{ } \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
---

Doesn't seem to work. I was very careful, and tried a wide range of options - working on it for several hours with repeated attempts - and it always got skipped. As a result (for me), the automated partitioning stopped at the point where it would clear partitions (as seen in /var/syslog).

I used an approach similar to that provided by Mick Pollard (see above), and it worked as desired.

As an additional note, I used this line to automatically skip a warning about having no swap partition:

preseed --owner partman-basicfilesystems partman-basicfilesystems/no_swap boolean false

Revision history for this message
James (james-jamesgao) wrote :

I just managed to get kickstart working with an expert recipe in 18.04. First, kickstart doesn't support the backslash syntax, so the entire recipe needs to be on one line. Second, as mentioned in #9, you need to surround the whole recipe with single quotes. Your preseed line should look like this:

preseed partman-auto/expert_recipe 'string boot-root :: 500 500 500 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } .'

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.