Creation of RAID via preseed/kickstart Ubuntu server 10.04LTS

Tom H tomh0665 at gmail.com
Fri May 28 14:57:22 UTC 2010


On Fri, May 28, 2010 at 4:33 AM, Max Deputter
<Max.Deputter at tradingscreen.com> wrote:
>
> I’m trying to automatically create a complex file architecture when
> installing Ubuntu 10.04 via netboot. I have tried with both preseed and
> kickstart but it seems that neither support partitioning multiple disks in
> an unattended fashion. This is what I’m trying to achieve:
>
> /dev/sda should have two partitions raid.11 500MB and raid.12 with the
> remaining space.
>
> /dev/sdb should have two partitions raid.21 500MB and raid.22 with the
> remaining space.
>
> Then I create md0 with raid.11 and raid.21 and mount it as /boot (ext3)
>
> I create md1 with raid.12 and raid.22 as a pv.0 volume.
>
> Root_vg is a volume group created on md1. On top of Root_vg, I create
> logical volumes: / (4G) /var (4G) and swap (4G).
>
> What kickstart does support is a pre-script. I was wondering if I could
> destroy and partition the disks via some commands lines in the pre-script?
>
> I tried doing a manual install and generating the preseed with
> “debconf-get-selections --installer > file” but sadly enough it did not
> record me clearing and creating partitions.
>
> Any ideas on how I can achieve this?
>
> http://www.centos.org/docs/4/html/rhel-sag-en-4/s1-kickstart2-options.html
> describes what I am trying to achieve in section 1.4.1 but it applies to
> CentOS and Anaconda and does not work on Ubuntu.

I've been googling preseeding lvm over raid for a project this summer,
once 10.04.1 is released. I have found the two methods below but I
haven't had a chance to test them yet.

They are set up for a VBox VM and for one VG encompassing sysroot and
swap but they should be adaptable to your case - if they work...

Editorial comment: I used think that jumpstart and kickstart
directives were a PITA but preseed definitely beats them!

<begin>

d-i partman-auto/method string raid

d-i partman-auto/disk string /dev/sda /dev/sdb

d-i partman-auto-raid/recipe string			\
	1 2 0 lvm -					\
		/dev/sda1#/dev/sdb1			\
	.						\

d-i partman-auto/expert_recipe string			\
	multiraid ::					\
		1000 7000 8000 ext4			\
			method{ lvm }			\
			vg_name{ sysvg }		\
		.					\
		600 900 800 linux-swap			\
			$lvmok{ }			\
			in_vg{ sysvg }			\
			lv_name{ swaplv }		\
			method{ swap }			\
			format{ }			\
		.					\
		1000 7000 9000 ext4			\
			$lvmok{ }			\
			in_vg{ sysvg }			\
			lv_name{ rootlv }		\
			method{ format }		\
			format{ }			\
			use_filesystem{ }		\
			filesystem{ ext4 }		\
			mountpoint{ / }			\
		.

</end>


<begin>

d-i partman-auto/method string raid

d-i partman-auto/disk string /dev/sda /dev/sdb

d-i partman-auto-raid/recipe string			\
	1 2 0 lvm -					\
		/dev/sda1#/dev/sdb1			\
	.

d-i partman/late_command string				\
	in-target pvcreate /dev/md0			\
	&& in-target vgcreate -s 32 sysvg /dev/md0	\
	&& in-target lvcreate -L 800 -n swaplv sysvg	\
	&& in-target lvcreate -l %PVS -n syslv sysvg	\
	.

</end>




More information about the ubuntu-users mailing list