Kickstart Partitioning: Define partition order

Bernd Nies bernd.nies at gmail.com
Tue Mar 26 07:41:10 UTC 2013


Hi,

We use the snipplet shown to create partitioning using kickstart on
hundreds of development workstations and for development VMware virtual
machines.


# Disk Partitioning
# Dynamically because it depends on disk device names
%include /tmp/partitions.ks

%pre
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
set $(list-harddrives)
let numd=$#/2
disk0=$1
cat >/tmp/partitions.ks <<==EOF==
zerombr
ignoredisk --only-use=${disk0}
bootloader --location=mbr
clearpart --all --drives=${disk0} --initlabel
partition /boot/efi --ondisk=${disk0} --asprimary --fstype=vfat --label
EFI  --size=200
partition /boot     --ondisk=${disk0} --asprimary --fstype=ext4 --label
BOOT --size=500
partition swap      --ondisk=${disk0} --asprimary --fstype=swap --label
SWAP --recommended
partition /         --ondisk=${disk0} --asprimary --fstype=ext4 --label
ROOT --size=4096 --grow
==EOF==
%end


After kickstarting the order of the created partitions differs from the
order given in the kickstart file. It is:


   1. /dev/sda1 /boot/efi
   2. /dev/sda2 /boot
   3. /dev/sda3 /
   4. /dev/sda4 swap


On workstations this is no problem having swap at the end of the disk. But
in the VMware virtual machines it causes problems when one has to resize
the root partition. An option would be LVM and just add another virtual
disk but we would like to use traditional ext4 partitioning because LVM is
not supported by gparted and resizing with gparted is easier. Another
option would be to create a VM template and use swap as a separate vmdk
disk file.

My question is: How can I give the order I want the partitions in
kickstart? The option --onpart works only if there is already a
partitioning layout.

Regards,
Bernd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20130326/450d30a1/attachment.htm>


More information about the Kickstart-list mailing list