Kickstart - Partitioning....possible to use whole disk for LVM without creating a LVM partition

Andrew Simpson simpsonar77 at gmail.com
Mon Mar 9 16:55:31 UTC 2015


I use kernel options that are set in the grub (i.e. isolinux/syslinux cfg
files )  I pass in @vm on the append line, then in the kickstart, I parse
/proc/cmdline for all the options.

Following that, I check if [[ $"opt_vm" == "1" ]]; then.....

i then have each partition size set as a variable ( SIZE_ROOT = 20000,
SIZE_VAR = 1024, etc...).

otherwise, I have another set of partition sizes.

But basically, yes you can setup different partitioning schemes based off
of variables in your kickstart.  I do this by dumping the partitioning
information into a file (pre.ks), which is included via %include /ks/pre.ks
at the beginning of the kickstart.  Makes it fairly dynamic.


Andrew Simpson

On Mon, Mar 9, 2015 at 10:02 AM, Jerry Billing <jebi01 at handelsbanken.se>
wrote:

> Hi
>
> For virtual servers it is nice to use the whole disk for LVM instead of
> creating a LVM partition on the disk. Then you can just increase the size
> of the disk in VMware and later extend the file system instead of having to
> add another disk and extend.
> Is it possible to use this setup in the kickstart? What syntax do one use
> if it is possible?
>
> If I have done it manually it whould have been like this:
> pvcreate /dev/sdb (instead of using a LVM partition called /dev/sdb1)
> vgcreate DataVG /dev/sdb
> lvcreate -n DataLV -l 100%FREE DataVG DataLV
>
> At the moment I have the following partitioning script in my kickstart
> file for RHEL6/7 as a pre script:
>
> DISK_TYPE=$(parted -s /dev/sda print |grep Model | awk '{print $2}')
> echo "Disk type = $DISK_TYPE"
>
> if [ "$DISK_TYPE" = "VMware" ]
>
> then
> echo "This is a VMware server, disk type=$DISK_TYPE"
> cat > /tmp/partitioning.cfg <<EOF
> part /boot --fstype="xfs" --size=1024 --ondisk=sda
> part pv.01 --size=10240 --grow --ondisk=sda
> volgroup VGos pv.01
> logvol / --vgname=VGos --name=LVroot --size=10240 --grow
> logvol swap --vgname=VGos --name=LVswap --recommended
> part pv.02 --size=1000 --grow --ondisk=sdb
> volgroup VGdata pv.02
> logvol /usr/users --vgname=VGdata --name=LVhome --size=20480
> logvol /app --vgname=VGdata --name=LVapp --size=1000 --grow
> EOF
>
> else
> echo "This is a Physical server, disk type=$DISK_TYPE"
> cat > /tmp/partitioning.cfg <<EOF
> part /boot --fstype="xfs" --size=1024 --ondisk=sda
> part pv.01 --size=10240 --grow --ondisk=sda
> volgroup VGos pv.01
> logvol / --vgname=VGos --name=LVroot --size=10240 --grow
> logvol swap --vgname=VGos --name=LVswap --recommended
> logvol /var --vgname=VGos --name=LVvar --size=20480
> EOF
>
> fi
>
>
> Regards Jerry
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20150309/de5b39ef/attachment.htm>


More information about the Kickstart-list mailing list