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

Partman-Auto - Multi-Disk OR Use Existing Layout via Preseed

1,417 views
Skip to first unread message

Matthew Drobnak

unread,
Apr 25, 2012, 11:00:02 PM4/25/12
to
First, I have to say I love Debian. But I've been struggling with the
preseeding lately. First it was the keyboard layout, as the name has
changed a few times.
But that's been rectified. So, now I am trying to get partitioning right.

This was the recipe I tried:

d-i partman-auto/disk string /dev/sdb /dev/sda
d-i partman-auto/method string lvm
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/new_vg_name string sysvg

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/device_remove_md boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true

d-i partman/confirm_write_new_label boolean true
d-i partman/confirm boolean true
d-i partman/default_filesystem string ext3
d-i partman/mount_style select uuid
#d-i partman/choose_partition \
# select Finish partitioning and write changes to disk

d-i partman-auto/expert_recipe string \
boot-root :: \
512 30720 512 ext3 \
$primary{ } $bootable{ } $lvmignore { } \
method{ format } format{ } \
filesystem{ ext3 } \
mountpoint{ /boot } \
. \
10000 10100 10734 ext3 \
$primary{ } $defaultignore{ } \
method{ lvm } device{ /dev/sdb } \
vg_name{ sysvg } \
. \
10000 21000 1000000000 ext3 \
$defaultignore{ } \
method{ lvm } device{ /dev/sdb } \
vg_name{ xen_vg } \
. \
2048 9000 2048 linux-swap \
$lvmok{ } method{ swap } format{ } \
in_vg{ sysvg } lv_name{ swap1 } \
. \
4096 10500 4096 ext3 \
$lvmok{ } method{ format } format{ } \
in_vg{ sysvg } lv_name{ root } \
filesystem{ ext3 } mountpoint{ / } \
. \
4063 8000 4065 ext3 \
$lvmok{ } method{ format } format{ } \
in_vg{ sysvg } lv_name{ var } \
filesystem{ ext3 } mountpoint{ /var } \
. \


This didn't quite do the right thing.

Desired layout:

/dev/sda - 512MB disk:

/dev/sda1 - /boot - 512MB

/dev/sdb - Rest of disk -
/dev/sdb1 - physical_volume for sysvg volume group ~ 10.7GB
/dev/sdb2 - pysical_volume for xen_vg volume group - Remaining amount of
disk

and the three LVs - root, var, swap, inside of sysvg

So, I can't seem to get this to work right. I tried to even just use
/dev/sdb alone, but I coulnd't get it to ignore /dev/sda, even when
partman/disk only says /dev/sdb.

The other (cheating to me, but doable) option is to use the
pre-partman-script to do the correct partitioning, and write a recipe to
simply use the correct partitions..but I don't see any documents on this.

Please, someone tell me this can be done correctly.

What's really upsetting is that this is the equivalent recipe in kickstart:

clearpart --all --drives=/dev/sda,/dev/sdb --initlabel
part /boot --fstype ext3 --size=510 --asprimary --ondisk=/dev/sda
part pv.01 --size=10240 --asprimary --ondisk=/dev/sdb
part pv.02 --size=1 --grow --asprimary --ondisk=/dev/sdb
volgroup sysvg pv.01 --pesize=32768
volgroup xen_vg pv.02 --pesize=32768
logvol / --vgname=sysvg --size=4096 --fstype ext3 --name=root
logvol swap --vgname=sysvg --size=2048 --fstype ext3 --name=swap1
logvol /var --vgname=sysvg --size=4064 --fstype ext3 --name=var


I understand this may come off as a bit combative, but that's not what
I'm after. :)

I'd just like to get this done. Without this, my exercises remain an
exercise only. :-(

-Matt

PS. I speak for me only, not for my company.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/4F98AFC...@appnexus.com

Matthew Drobnak

unread,
Apr 26, 2012, 8:40:02 AM4/26/12
to
Also, if there's a better list to ask this on, please point me to it.

Thanks!

-Matt
Archive: http://lists.debian.org/4F9941C5...@appnexus.com

Tom H

unread,
Apr 26, 2012, 9:00:02 AM4/26/12
to
The only, somewhat unhelpful, thing that I can contribute is that I've
only been able to use two disks with pressed when creating an mdraid
array. It hasn't worked for me either to add a second PV (even though
the "device{ }" value is specifically mentioned in the LVM section of
the documentation) or to have "/usr" and/or "/var" on a second disk.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdoSwUppW5-EtBhx3CohcuE...@mail.gmail.com

Matthew Drobnak

unread,
Apr 26, 2012, 1:50:03 PM4/26/12
to
Well, that's at least comforting to know that I'm not crazy. :)

I wish there was an easy way to get the partitioner code from FAI into
d-i. They use parted on the backend as well, but their syntax is a lot
simpler, and supports multiple disks. I just can't bring myself to go
the whole FAI route just because partitioning doesn't work the way I'd
like. I am going to try something hacky but not that bad, and see if I
can get this to work:

Explicitly say the volume group for sysvg is 10GBs. Define the LVs
inside there. Define an additional unused partition to fill the disk.

In post, remove the extra partition from sdb, copy everything in /boot
to /dev/sda1, and reinstall grub. That should work.

-Matt
On 04/26/2012 08:50 AM, Tom H wrote:
>
> The only, somewhat unhelpful, thing that I can contribute is that I've
> only been able to use two disks with pressed when creating an mdraid
> array. It hasn't worked for me either to add a second PV (even though
> the "device{ }" value is specifically mentioned in the LVM section of
> the documentation) or to have "/usr" and/or "/var" on a second disk.
>
>


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/4F9988E4...@appnexus.com

Tom H

unread,
Apr 28, 2012, 2:00:02 PM4/28/12
to
On Thu, Apr 26, 2012 at 1:41 PM, Matthew Drobnak <mdro...@appnexus.com> wrote:
> On 04/26/2012 08:50 AM, Tom H wrote:
>>
>> The only, somewhat unhelpful, thing that I can contribute is that I've
>> only been able to use two disks with pressed when creating an mdraid
>> array. It hasn't worked for me either to add a second PV (even though
>> the "device{ }" value is specifically mentioned in the LVM section of
>> the documentation) or to have "/usr" and/or "/var" on a second disk.
>
> Well, that's at least comforting to know that I'm not crazy. :)
>
> I wish there was an easy way to get the partitioner code from FAI into d-i.
> They use parted on the backend as well, but their syntax is a lot simpler,
> and supports multiple disks. I just can't bring myself to go the whole FAI
> route just because partitioning doesn't work the way I'd like. I am going to
> try something hacky but not that bad, and see if I can get this to work:
>
> Explicitly say the volume group for sysvg is 10GBs. Define the LVs inside
> there. Define an additional unused partition to fill the disk.
>
> In post, remove the extra partition from sdb, copy everything in /boot to
> /dev/sda1, and reinstall grub. That should work.

It's too bad that kickstart isn't fully functional on Debian and Ubuntu...


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdo=Szxxj9HbZDe3UJmByvqCog...@mail.gmail.com

Andrew M.A. Cater

unread,
May 1, 2012, 5:00:03 PM5/1/12
to
On Sat, Apr 28, 2012 at 01:54:40PM -0400, Tom H wrote:
> On Thu, Apr 26, 2012 at 1:41 PM, Matthew Drobnak <mdro...@appnexus.com> wrote:
> > On 04/26/2012 08:50 AM, Tom H wrote:
> >>
> >> The only, somewhat unhelpful, thing that I can contribute is that I've
> >> only been able to use two disks with pressed when creating an mdraid
> >> array. It hasn't worked for me either to add a second PV (even though
> >> the "device{ }" value is specifically mentioned in the LVM section of
> >> the documentation) or to have "/usr" and/or "/var" on a second disk.
> >
> > Well, that's at least comforting to know that I'm not crazy. :)
> >
> > I wish there was an easy way to get the partitioner code from FAI into d-i.
> > They use parted on the backend as well, but their syntax is a lot simpler,
> > and supports multiple disks. I just can't bring myself to go the whole FAI
> > route just because partitioning doesn't work the way I'd like. I am going to
> > try something hacky but not that bad, and see if I can get this to work:
> >
> > Explicitly say the volume group for sysvg is 10GBs. Define the LVs inside
> > there. Define an additional unused partition to fill the disk.
> >
> > In post, remove the extra partition from sdb, copy everything in /boot to
> > /dev/sda1, and reinstall grub. That should work.
>
> It's too bad that kickstart isn't fully functional on Debian and Ubuntu...
>
It's barely functional on Red Hat :) I find that I have to do an isntall using
kickstart to get an initial config then cut it to shreds to remove the stuff
I don't need :(

AndyC


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20120501190...@galactic.demon.co.uk

Matthew Drobnak

unread,
May 1, 2012, 5:30:02 PM5/1/12
to
%packages
@base
-Package1youdontwant
-Package2

:)

As for the parted item:

This did what I mentioned earlier:

# Partitioning
## Dump everything from the installer
# We ARE going to overwrite everything. Really.
d-i partman-md/confirm_nooverwrite boolean true
partman-lvm partman-lvm/confirm_nochanges boolean true
partman-base partman/confirm_nochanges boolean true
partman-md partman-md/confirm boolean true
partman-crypto partman-crypto/confirm_nochanges boolean true
partman-partitioning partman-partitioning/confirm_resize boolean
true
d-i partman-crypto/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
partman-lvm partman-lvm/confirm boolean true
partman-partitioning partman-partitioning/confirm_write_new_label
boolean true
partman-crypto partman-crypto/confirm boolean true
partman-partitioning partman-partitioning/confirm_new_label boolean true
partman-base partman/confirm_nooverwrite boolean true
partman-md partman-md/confirm_nochanges boolean true


# use first hard drive SCSI/SATA:
d-i partman-auto/disk string /dev/sdb
d-i partman-auto/method string lvm
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto-lvm/new_vg_name string sysvg

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/device_remove_md boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true

d-i partman/confirm_write_new_label boolean true
d-i partman/confirm boolean true
d-i partman/default_filesystem string ext3
d-i partman/mount_style select uuid
d-i partman/choose_partition \
select Finish partitioning and write changes to disk

# needed to shut up complaint about unused keep_2 lv
d-i partman-basicmethods/method_only boolean false

d-i partman-auto/expert_recipe string \
boot-root :: \
510 511 512 ext3 \
$primary{ } $defaultignore{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext3 } \
mountpoint{ /boot } label{ /boot } \
. \
2046 2047 2048 linux-swap \
$lvmok{ } method{ swap } format{ } \
in_vg{ sysvg } lv_name{ swap1 } \
. \
4094 4095 4096 ext3 \
$lvmok{ } method{ format } format{ } \
use_filesystem{ } lv_name{ root } in_vg{ sysvg } \
filesystem{ ext3 } mountpoint{ / } \
. \
4063 4064 4065 ext3 \
$lvmok{ } method{ format } format{ } \
use_filesystem{ } lv_name{ var } in_vg{ sysvg } \
filesystem{ ext3 } mountpoint{ /var } \
. \
10238 10239 10240 ext3 \
$primary{ } $defaultignore{ } \
method{ lvm } device{ /dev/sdb } \
vg_name{ sysvg } \
. \
50000 80000 -1 ext3 \
$primary{ } method{ keep } \
.

Then in the late command, you'll have to do something like this (I
haven't cause I'm lazy):
pvcreate <largest partition> xen_vg
parted /dev/sda < create partition - have to look up syntax> ext3
mkfs.ext3 /dev/sda1 -L /boot
mkdir /target/newboot
mount /dev/sda1 /target/newboot
cp -par /target/boot/* /target/newboot
grep -v /boot /target/etc/fstab > /target/etc/fstab.new
echo "/dev/sda1 /boot ext3 defaults 0 0" >> /target/etc/fstab.new
mv /target/etc/fstab /target/etc/fstab.bak
mv /target/etc/fstab.new /target/etc/fstab
umount /target/boot
umount /target/newboot
mount /dev/sda1 /target/boot
in-target grub-install /dev/sda
in-target update-grub

Then you've done what the RH installer can do for me fairly easily.
(Trust me, there's tons to hate about Anaconda, but this part is ok.)

-Matt
Archive: http://lists.debian.org/4FA053FB...@appnexus.com

Tom H

unread,
May 2, 2012, 6:40:01 AM5/2/12
to
On Tue, May 1, 2012 at 5:22 PM, Matthew Drobnak <mdro...@appnexus.com> wrote:
> On 05/01/2012 03:06 PM, Andrew M.A. Cater wrote:
>> On Sat, Apr 28, 2012 at 01:54:40PM -0400, Tom H wrote:
>>> On Thu, Apr 26, 2012 at 1:41 PM, Matthew Drobnak<mdro...@appnexus.com>
>>>  wrote:
>>>>
>>>> I wish there was an easy way to get the partitioner code from FAI into
>>>> d-i.
>>>> They use parted on the backend as well, but their syntax is a lot
>>>> simpler,
>>>> and supports multiple disks. I just can't bring myself to go the whole
>>>> FAI
>>>> route just because partitioning doesn't work the way I'd like. I am
>>>> going to
>>>> try something hacky but not that bad, and see if I can get this to work:
>>>>
>>>> Explicitly say the volume group for sysvg is 10GBs. Define the LVs
>>>> inside
>>>> there. Define an additional unused partition to fill the disk.
>>>>
>>>> In post, remove the extra partition from sdb, copy everything in /boot
>>>> to
>>>> /dev/sda1, and reinstall grub. That should work.
>>>
>>> It's too bad that kickstart isn't fully functional on Debian and
>>> Ubuntu...
>>>
>> It's barely functional on Red Hat :) I find that I have to do an isntall
>> using
>> kickstart to get an initial config then cut it to shreds to remove the
>> stuff I don't need :(

> %packages
> @base
> -Package1youdontwant
> -Package2

+1. Or "yum erase ..." in "%post".


> As for the parted item:
>
> This did what I mentioned earlier:
>
> ...

Thanks.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOdoSzuAMN1WKHRAGsL3NnGo...@mail.gmail.com
0 new messages