Thursday, August 20, 2009

Reiserfs setup on centos + squid cache partition

#! /bin/bash
# squid cache folder assumed mounted with some other FS .
echo " "
if [ -d "/usr/local/squid" ] ;then

rpm -Uvh /root/reiserfs-utils-3.6.19-2.4.1.i386.rpm
rpm -Uvh /root/
locca=`df -lh |grep -r 'cache' |cut -d " " -f 1`
if [ "$locca" == "" ] ;then
echo "cache Partition not mounted"
umount $locca
mkreiserfs -q $locca
echo "ReiserFS partion done"
mv /usr/local/squid/var/cache /usr/local/squid/var/cache.bak
mkdir -p /usr/local/squid/var/cache

mount -t reiserfs $locca /usr/local/squid/var/cache
echo "Mounted successfully"
mv /usr/local/squid/var/cache.bak/* /usr/local/squid/var/cache/
chown -R squid:squid /usr/local/squid/var/cache
chmod -R 0750 /usr/local/squid/var/cache
echo "cache setup done"
grep -Ev 'cache' /etc/fstab >/etc/newfstab
mv /etc/fstab /etc/fstab.bakup && cp /etc/fstab.bakup /etc/fstab.bakup.original
echo " $locca /usr/local/squid/var/cache reiserfs notail,noatime 1 2" >>/etc/newfstab
mv /etc/newfstab /etc/fstab
echo "fstab updated with new mount info "
echo "Exiting squid not found "

echo "Cool you must reboot the system to take effect "

Custom Linux os cd using kickstart + anaconda

yep follow the steps

* yum install anaconda-runtime createrepo yum-utils anaconda anaconda-help busybox-anaconda mkisofs .

* Mount Centos original cd+dvd copy contents to folder. select the rpms along with dependencies .
Please Refer :

Next to make iso ready :
Here is that shell script .

#! /bin/bash
cd /myos/
discinfo=`head -1 .discinfo`
createrepo -u “media://$discinfo” -g repodata/comps.xml /myos
mkisofs -r -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V “SimpleWall″ -p “myos-0.1” \
-A “myos″ \
-b isolinux/isolinux.bin -c isolinux/ \
-x “lost+found” -o $isofilename /myos
/usr/lib/anaconda-runtime/implantisomd5 $isofilename

Burn it , its rocks .

Note : kickstart configuration file plays important role in automated installer