Multiple disks support for partman-auto-lvm
Hi all,
I finally managed to write a more general patch[1] to have multiple disks
support in partman-auto-lvm. It has been successfully tested on x86 with the
three base recipes of the installer (atomic, home and multi) to prevent
regressions, and with four homebrew recipes that show what you can do with
it.
This patch is based on the current (as of 2008/01/20) SVN version of
partman-auto and partman-auto-lvm (the former needing only a minor
modification).
A little note about how to use this patch : it is currently available only
using preseeding. To do this, you must preseed three things :
- partman-auto/expert_recipe_file : nothing new here ;
- partman-auto/disk : the first disk, known from now as the default one. This
is not mandatory, but may prevent bad surprises ;
- partman-auto-lvm/extra_devices : a new entry in which you declare all extra
devices that will be available to partman-auto-lvm. You must at least add
here all devices used in the recipe. Devices not used in the recipe and
declared here will be silently ignored.
Now here is a description of the four recipes I wrote, and that must cover all
use cases supported by this patch, with informations about new attributes
available. All of these recipes use two disks (hda and hdb), but it should
work with more (a bug in QEmu prevented me from using hdd, but I hope I'll
can test it on VMWare on another machine).
The first recipe[2] creates two volume groups, vg00 and vg01, respectively on
hda and hdb, plus a /boot partition. vg00 is used for all LV except /home,
created on vg01.
In it you can see all the new attributes and their use :
- device{ } is used when declaring a new PV on a specific device. In this
example, device is /dev/hda, but it can also be a partition as you'll see in
the third recipe. If device is empty, the default device is used ;
- vgname{ } is used to declare of which VG the PV will be a member of. If
vgname is empty, the default one will be used ;
- invg{ } is used to create a LV on a specific VG. If invg is empty, it is
created on the default one.
The second recipe[3] is roughly the same as the first, with a minor change :
no VG is declared for the LVs except /home. In this case, a default VG (whose
name is the hostname of the machine) is created and all LVs that don't have a
invg{ } declaration will be created on this one. Of course, this VG must have
a free device available to be created on. But more on the errors after the
recipes.
The third recipe[4] creates a single VG, with a given name, out of two
partitions on the devices. The rest is simple to understand if you read the
first two recipes : all LVs are created on a single VG, vg00, declared on the
PVs hda2 and hdb1. I put a big, red, flashing warning here : it's not because
you said "use hda2 and hdb1 to create this VG" that these partitions will be
created. No, you must guess what the partitions numbers will be based on the
behavior of partman-auto-lvm. With the recent patch of Frans Pop, default PV
will always be created on a primary partition. With your recipe it's on your
own to guess.
The fourth recipe[5] is the same as the third, except the PVs will be added to
the default VG (whose name is the hostname of the machine) as there's no
vgname and invg attributes.
OK, now about the errors that you can have. I added two debconf templates in
partman-auto-lvm :
- partman-auto-lvm/no_such_pv : this means that the recipe contains a
reference to a PV that doesn't exist. This is the case if it's not declared
in partman-auto-lvm/extra_devices, or if it hasn't been detected, or if you
didn't guessed correctly the partitioning ;
- partman-auto-lvm/no_pv_in_vg : happens if a VG was declared but that no PV
could be associated with. For example it could happen if you forgot a invg{ }
declaration on a LV (which then triggers the need for the default VG), and if
there's no device without a vgname{ } attribute. But it's not limited to this
case, and this error is a Bad News.
OK, I think it's all for now. If you have any question or if you found a bug
I'll happily try to help. I hope you'll find this patch useful.
Cheers,
Grégory
[1] : http://ogre.nerim.net/d-i/partman-auto-lvm_20080120.diff
[2] : http://ogre.nerim.net/d-i/testrecipe-01
[3] : http://ogre.nerim.net/d-i/testrecipe-02
[4] : http://ogre.nerim.net/d-i/testrecipe-03
[5] : http://ogre.nerim.net/d-i/testrecipe-04
Reply to: