[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#462396: Multiple disks support for partman-auto-lvm



On Thu, Aug 21, 2008 at 08:44:17PM +0200, Grégory Oestreicher wrote:
> If there are no more comments on this patch, what's the next step ? I'll be 
> off in vacation from tomorrow for next week and won't be able to read my 
> mails, so if something must be done to integrate it in Lenny someone else 
> will have to take care of this.

Glad that you ask.  I have been working on this for the past three days
straight! :)

Attached is a pretty dense patchset integrating (a modified version of)
your patch and other changes in order to support it properly.

Main differences from your last patch:

 * Split refactoring, bug fixes and features integration

   The patchset should be fairly easy to follow. The biggest patch being
   the one introducing support for multiple disks in partman-auto-lvm,
   though.
 
 * Removal of partman-auto-lvm/extra_devices

   All disks are specified in partman-auto/disk.  The first one being
   the default.  This is more consistent to what we already support with
   partman-auto-raid.

 * Mapping of Volume Groups and Physical Volumes done in
   auto_lvm_prepare()

   This one required changes in the way $pv_devices was filled.
 
 * Support proper removal of Volume Groups on multiple disks

   That was the tricky part.  As documented in the commit logs, the way
   partman was previously restarted when removing all PV or RAID
   partitions on a disk was not coping nice with multiple devices at
   all.  This bug currently affects partman-auto-raid, but would affect
   partman-auto-lvm supporting multiple disks.

   Manual installations are currently affected as well as we currently
   allow the creation of new labels on disks with activated RAID
   partitions.  Solving this would require introducing locks as we do
   for LVM, but that requires merging mdcfg and partman-md for good,
   something for Lenny+1, really.

The work on this got little bit out of hand as I fixed all issues along
the way, and I am a little bit uncomfortable in introducing so much
changes at this stage of the release process.

On the other hand, preseeded features are easy and quick to test
(especially with KVM, virtio and a local mirror) and I am attaching all
the preseeds that I have used thouroughly through the development
of this patchset.  They all work through successful installations and
can be called repeatedly in any order with success.

I also confirm that manual installations continue to work as they
should.

I welcome other opinions here.  Grégory also has submitted the first
version of this patch in January, and have reworked the patch several
times with the feedback we gave him.  If these changes don't go in for
Lenny, we at least owe an apology for not finishing this up earlier.

Here's the index of the patchset, nevertheless:
 * Move dev_to_partman() to lib/auto-shared.sh
 * Remove useless dev_to_partman() definition from initial_auto_raid
 * Factor out conversion to megabytes in partman
 * Remove devfs resolving for PV devices
 * Fill $pv_devices earlier when using crypto method
 * Reset partman-lvm/device_remove_lvm after asking
 * Fix preseeding of partman-md/device_remove_md
 * Use 255 as return code when user backs up in device_remove_{md,lvm}()
 * Move the cleanup of LVM and MD devices out of create_new_label()
 * Restart partman once for all devices in prepare_new_labels
 * Move get_last_free_partition_infos() out of auto_init_disk()
 * Rename auto_init_disk() to auto_init_disks()
 * Rename $dev to $main_device in auto_lvm_prepare()
 * Factor out envelope creating in partman-auto-lvm
 * Factor out the creation of Physical Volume partitions
 * Reuse $defvgname in auto_lvm_perform()
 * Support multiple disks in partman-auto-lvm
 * Add support for preseeding logical volume names
 * Allow removal of VG spaning on autopartitioned disks
 * Remove extra $() construct in remove_lvm_find_vgs()
 * Initialize all disks at once when doing RAID autopartitioning

> If what's missing is the documentation, I'm working on it but other projects 
> are requiring my attention and I can't spend as much time as I'd like on it. 
> Maybe you'll can review a first draft after my holidays, if everything goes 
> well.

This would be very welcome.

Cheers,
-- 
Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   

Attachment: partman_lvm_multiple_disks.diff.gz
Description: Binary data

# Standard LVM atomic

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda
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-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Standard crypto atomic

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string crypto
d-i partman-auto/disk string /dev/vda
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-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Gregory's 1st test recipe

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/disk string /dev/vda /dev/vdb
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-auto/expert_recipe string \
	test-recipe :: \
 \
	128 512 256 ext3 \
		$defaultignore{ } \
		$primary{ } \
		$bootable{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /boot } . \
 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vda } \
		vgname{ vg00 } \
		method{ lvm } . \
 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vdb } \
		vgname{ vg01 } \
		method{ lvm } . \
 \
	70 800 280 ext3 \
		$lvmok{ } \
		$primary{ } \
		$bootable{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ / } . \
 \
	500 3000 5000 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /usr } . \
 \
	70 1500 3000 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /var } . \
 \
	96 512 300% linux-swap \
		$lvmok{ } \
		invg{ vg00 } \
		method{ swap } \
		format{ } . \
 \
	20 300 400 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		lvname{ mytmp } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /tmp } . \
 \
	300 3000 1000000000 ext3 \
		$lvmok{ } \
		invg{ vg01 } \
		lvname{ myhome } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /home } .
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Gregory's 2nd test recipe

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda /dev/vdb
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-auto/expert_recipe string \
	test-recipe :: \
 \
	128 512 256 ext3 \
		$defaultignore{ } \
		$primary{ } \
		$bootable{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /boot } . \
 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vdb } \
		vgname{ vg01 } \
		method{ lvm } . \
 \
	70 800 280 ext3 \
		$lvmok{ } \
		$primary{ } \
		$bootable{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ / } . \
 \
	500 3000 5000 ext3 \
		$lvmok{ } \
		lvname{ myusr } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /usr } . \
 \
	70 1500 3000 ext3 \
		$lvmok{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /var } . \
 \
	96 512 300% linux-swap \
		$lvmok{ } \
		method{ swap } \
		format{ } . \
 \
	20 300 400 ext3 \
		$lvmok{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /tmp } . \
 \
	300 3000 1000000000 ext3 \
		$lvmok{ } \
		invg{ vg01 } \
		lvname{ myhome } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /home } .
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Gregory's 3rd test recipe

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda /dev/vdb
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-auto/expert_recipe string \
	test-recipe :: \
	 \
	128 512 256 ext3 \
		$defaultignore{ } \
		$primary{ } \
		$bootable{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /boot } . \
	 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vda2 } \
		vgname{ vg00 } \
		method{ lvm } . \
	 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vdb1 } \
		vgname{ vg00 } \
		method{ lvm } . \
	 \
	70 800 280 ext3 \
		$lvmok{ } \
		$primary{ } \
		$bootable{ } \
		invg{ vg00 } \
		lvname{ myroot } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ / } . \
	 \
	500 3000 5000 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /usr } . \
	 \
	70 1500 3000 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /var } . \
	 \
	96 512 300% linux-swap \
		$lvmok{ } \
		invg{ vg00 } \
		lvname{ myswap } \
		method{ swap } \
		format{ } . \
	 \
	20 300 400 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /tmp } . \
	 \
	300 3000 1000000000 ext3 \
		$lvmok{ } \
		invg{ vg00 } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /home } .
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Gregory's 4th test recipe

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda /dev/vdb
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-auto/expert_recipe string \
	test-recipe :: \
 \
	128 512 256 ext3 \
		$defaultignore{ } \
		$primary{ } \
		$bootable{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /boot } . \
 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		method{ lvm } . \
 \
	100 1000 1000000000 ext3 \
		$defaultignore{ } \
		$primary{ } \
		device{ /dev/vdb } \
		method{ lvm } . \
 \
	70 800 280 ext3 \
		$lvmok{ } \
		$primary{ } \
		$bootable{ } \
		lvname{ myroot } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ / } . \
 \
	500 3000 5000 ext3 \
		$lvmok{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /usr } . \
 \
	70 1500 3000 ext3 \
		$lvmok{ } \
		lvname{ myvar } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /var } . \
 \
	96 512 300% linux-swap \
		$lvmok{ } \
		method{ swap } \
		format{ } . \
 \
	20 300 400 ext3 \
		$lvmok{ } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /tmp } . \
 \
	300 3000 1000000000 ext3 \
		$lvmok{ } \
		lvname{ myhome } \
		method{ format } \
		format{ } \
		use_filesystem{ } \
		filesystem{ ext3 } \
		mountpoint{ /home } .
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Standard "multi" recipe on LVM on two disks

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda /dev/vdb
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-auto/choose_recipe select multi
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# Choose recipe on two disks

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string lvm
d-i partman-auto/disk string /dev/vda /dev/vdb
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/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true
# RAID recipe

d-i debconf/priority select high
d-i debian-installer/locale string fr_FR
d-i console-keymaps-at/keymap select dvorak
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string 
d-i mirror/country string enter information manually
d-i mirror/http/hostname string 192.168.11.1
d-i mirror/http/directory string /debian-partial
d-i mirror/http/proxy string
d-i mirror/suite string sid
d-i debian-installer/allow_unauthenticated string true
d-i partman-auto/method string raid
d-i partman-auto/disk string /dev/vda /dev/vdb
d-i partman-auto/expert_recipe string \
      multiraid ::                                         \
              1000 5000 4000 raid                          \
                      $primary{ } method{ raid }           \
              .                                            \
              64 512 300% raid                             \
                      method{ raid }                       \
              .                                            \
              500 10000 1000000000 raid                    \
                      method{ raid }                       \
              .
d-i partman-auto-raid/recipe string \
    1 2 0 ext3 /                                           \
          /dev/vda1#/dev/vdb1    \
    .                                                      \
    1 2 0 swap -                                           \
          /dev/vda5#/dev/vdb5    \
    .                                                      \
    0 2 0 ext3 /home                                       \
          /dev/vda6#/dev/vdb6    \
    .
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password root
d-i passwd/root-password-again password root
tasksel tasksel/first multiselect  
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i debian-installer/exit/poweroff boolean true

Attachment: signature.asc
Description: Digital signature


Reply to: