Wednesday, September 26, 2007

Setting up LVM in RHEL kickstart file

Another piece of fun today...

Task:
Set up and configure a linux box with the following partition information.

Non-LVM
/boot - 100MB

LVM
/ - 9GB
/opt - 12GB
/var - 8GB
swap - 8GB

Kickstart Entries:
clearpart --all
part /boot --fstype ext3 --size=100 --ondisk=sda
part pv.4 --size=0 --grow --ondisk=sda
volgroup VolGroup00 pv.4
logvol / --fstype ext3 --name=root --vgname=VolGroup00 --size=9216
logvol /opt --fstype ext3 --name=usr --vgname=VolGroup00 --size=12228
logvol /var --fstype ext3 --name=var --vgname=VolGroup00 --size=8192
logvol swap --fstype swap --name=swap --vgname=VolGroup00 --size=8192

My big mistake was trying to set the "pesize" in the volgroup line. Apparently, it will assume to use all if not set, which is what I wanted. RedHat documentation about kickstart options can be found here.

2 comments:

Josh said...

I was having the same problem with --pesize. Thanks for the information!

From my initial anacoda ks script it exists, but it does not seem to work outside that.

Unknown said...

Instead of:
part pv.4 --size=0 --grow --ondisk=sda
Put:
part pv.4 --size=1 --grow --ondisk=sda