Kickstart Partitioning: Define partition order

Bernd Nies <[email protected]>
Newsgroups gmane.linux.redhat.kickstart.general
Message-ID <CAEacpybyDU4TEhaaGvCR47tQ_kW-OnX3-EcCPXJkC-aVBnuR9g@mail.gmail.com>
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

_______________________________________________
Kickstart-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/kickstart-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.