My main question was if it is possible to use a whole disk using LVM without creating a seperate LVM partition in kickstart? If you create a partition on the disk you can´t easily extend the disk by increasing the disk size in VMware. Then you have to add another disk and extend your volume group.
If you use the whole disk by initialize the disk using "pvcreate /dev/disk", it can easily be resized. I am not an expert on LVM so please correct me if I am wrong :)
Is it possible to use standard LVM commands in kickstart? As I understand you can just use part and logvol? By reading the manuls for theese commands I cannot find a solution for this.
I use the following commands in my kickstart file, and the partitioning script I presented in my first mail is included in the kickstart using the %include statement below.
zerombr
clearpart --all
bootloader --location=mbr --boot-drive=sda
%include /tmp/partitioning.cfg
By the way we are running Satellite 5.7.
Regards Jerry
From: James Harrison <jamesaharrisonuk@xxxxxxxxxxx>
To: Discussion list about Kickstart <kickstart-list@xxxxxxxxxx>,
Cc: Anette Hagelin <anme06@xxxxxxxxxxxxxxxx>
Date: 2015-03-09 16:29
Subject: Re: Kickstart - Partitioning....possible to use whole disk for LVM without creating a LVM partition
Sent by: kickstart-list-bounces@xxxxxxxxxx
Hi,
From what I remember,it depends on the use of the disk. If its a boot disk, you have to have one DOS boot partition to start the system. However, if the disk is a second disk, then the whole disk can be folded into LVM.
Thanks
James
On Monday, 9 March 2015, 14:18, Jerry Billing <jebi01@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list
_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list
_______________________________________________ Kickstart-list mailing list Kickstart-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/kickstart-list