Partition Percentage wise in ks.cfg
Step 1:
Put the following lines in ks.cfg file in the %pre section
%pre
#!/bin/bash
# Check the disk size value and store in diskval
diskval=`fdisk -l | grep Disk | awk -F ” ” ‘{print $3}’| awk -F “.” ‘{print $1}’`
# for root as 20%
let “Partroot=($diskval*20/100)”
# for home as 20 %
let “Parthome=($diskval*20/100)”
# for usr as 50 %
let “Partusr=($diskval*50/100)”
# Swap space
let “Partswap=(`cat /proc/meminfo | grep ‘MemTotal:’ | awk -F ‘ ‘ ‘{print $2}’`*2/1024)”
echo “clearpart –all” >> /tmp/part-include
echo “part / –fstype ext3 –size $Partroot –ondisk sda” >> /tmp/part-include
echo “part swap –size=$Partswap –ondisk sda” >> /tmp/part-include
echo “part /home –fstype ext3 –size $Parthome –ondisk sda” >> /tmp/part-include
echo “part /usr –fstype ext3 –size $Partusr –grow –ondisk sda” >> /tmp/part-include
Step 2:
Just above the %packages section add the following line
clearpart –all
# Now in your ks file put the following line for partition
%include /tmp/part-include
%packages
-
Recent
- File Password Protection
- Building modules for rhel5 kernel
- Open SSL help
- Extracting certificates from java keystore to use in apache.conf
- What is bonding?
- Xen rescue paravirtualization
- flash player on firfox 64 bit
- Samba4 HOWTO + Fedora
- MRTG HowTo
- Fedora/Redhat Kernel RPM with Xen & reiserfs
- MYSQL REPLICATION
- Installation and management of XEN on Redhat-linux
-
Links
-
Archives
- March 2010 (1)
- January 2010 (5)
- December 2009 (1)
- April 2009 (1)
- January 2009 (1)
- November 2008 (12)
-
Categories
-
RSS
Entries RSS
Comments RSS