> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Collins, Kevin [BEELINE]
> Sent: Wednesday, December 17, 2008 1:25 PM
> To: Red Hat Enterprise Linux 5 (Tikanga) discussion mailing-list
> Cc: [email protected]
> Subject: RE: [rhelv5-list] Ignore SAN during install?
>
> Thanks, Maarten - I really like this method, and since the solution
> works for virtuals as well, to much the better!
>
> For clarification, is it not a problem to have
> "--driveorder=cciss/c0d0"
> for a virtual install?
>
> Also, what creates /tmp/scsidisks? Its referenced, but I don't see
> anything that populates it.
>
> Thanks,
>
> Kevin
>
Kevin,
That snippet is only the part of the %pre that dealt with
discovering and ignoring SAN disks. Here's the full %pre ... The
mptscsi section is for the VMware virtual machines. The cciss is for
the HP ProLiant SmartArray-based systems. Also, for RHEL4 virtuals
we're not using local dump space and only a 17G virtual disk, so it gets
different partition table. And we're using LVM on the OS drive
regardless.
--Maarten
%pre
(
set -x
chvt 3
export PATH=$PATH:/tmp
### * Pull down ethtool and set the card to 100FULL to speed up the
build
wget -q -O /tmp/ethtool http://MEDIASERVER/pub/files/ethtool
chmod 755 /tmp/ethtool
ethtool -s eth0 autoneg off speed 100 duplex full 2>/dev/null
ethtool -s eth1 autoneg off speed 100 duplex full 2>/dev/null
rmmod qla2300
rmmod qla2400
### Ignore qlogic disks for PHYSICAL systems
IGNOREDISK=/tmp/ignoredisk
### * Size out the disk (BOT=/boot, ROT=/, VAR=/var, TMP=/tmp, OPT=/opt
### * Also note that DMP=/var/crash, SWP=swap
BOT=100
ROT=5240
VAR=5240
TMP=2048
OPT=4096
OPTMAX=10240
### * Insert the appropriate clearpart to accomodate for VmWare
if lsmod | grep ^cciss ; then
echo "clearpart --drives=cciss/c0d0 --initlabel" > /tmp/clear.ks
echo "bootloader --location=mbr --driveorder=cciss/c0d0" >
/tmp/bootloader
echo "device scsi cciss" >>/tmp/bootloader
DRIVE_SIZE=`cat /proc/driver/cciss/cciss0 | grep "cciss/" | cut -d"
" -f2,3
| cut -d'G' -f1 | head -1 | cut -d. -f1`
if [ $DRIVE_SIZE -lt 40 ]; then
DRIVE_TYPE="small"
SWP=2048
ROT=3072
VAR=3072
elif [ $DRIVE_SIZE -gt 30 -a $DRIVE_SIZE -lt 40 ]; then
DRIVE_TYPE="small"
SWP=2048
elif [ $DRIVE_SIZE -gt 60 -a $DRIVE_SIZE -lt 80 ]; then
DRIVE_TYPE="large"
DMP=20000
SWP=2048
elif [ $DRIVE_SIZE -gt 130 -a $DRIVE_SIZE -lt 250 ]; then
DRIVE_TYPE="large"
DMP=50000
SWP=14000
elif [ $DRIVE_SIZE -gt 250 ]; then
DRIVE_TYPE="large"
DMP=67000
SWP=30000
fi
PD="cciss/c0d0"
### Ignore qlogic disks for PHYSICAL systems
cat /tmp/scsidisks
echo "Pulling in contents of /tmp/scsidisks"
for i in $(cat /tmp/scsidisks | awk '{ print $1 }'); do
DISKS=$DISKS" "$i
done
echo $DISKS
echo "Pulling in all block device sd* files in /tmp"
for i in $(ls -l /tmp | grep sd | grep ^brw | awk '{ print $NF }');
do
DISKS=$DISKS" "$i
done
echo $DISKS
DISKS=$(echo $DISKS|sed 's/ s/,s/g')
if [ ! -z $DISKS ]; then
echo "ignoredisk --drives="$DISKS > $IGNOREDISK
else
echo ""> $IGNOREDISK
fi
elif lsmod | grep ^mptscsi ; then
echo "clearpart --drives=sda --initlabel" > /tmp/clear.ks
echo "bootloader --location=mbr --driveorder=sda" >/tmp/bootloader
DRIVE_TYPE="small"
DMP=8000
SWP=2048
ROT=3072
VAR=3072
PD=sda
echo "">$IGNOREDISK
fi
cat >/tmp/disk_map_part <<EOF
part /boot --fstype ext3 --size $BOT --asprimary --ondisk $PD
EOF
cat >/tmp/disk_map_lv <<EOF
part pv.01 --size 1024 --grow --ondisk $PD
volgroup ROOTVG pv.01
logvol swap --fstype swap --size $SWP --vgname=ROOTVG
--name=swaplv
logvol / --fstype ext3 --size $ROT --vgname=ROOTVG
--name=rootlv
logvol /var --fstype ext3 --size $VAR --vgname=ROOTVG --name=varlv
logvol /tmp --fstype ext3 --size $TMP --vgname=ROOTVG --name=tmplv
logvol /opt --fstype ext3 --size $OPT --vgname=ROOTVG --name=optlv
--grow --maxsize=$OPTMAX
EOF
case $DRIVE_TYPE in
"large" )
cat >> /tmp/disk_map_part <<EOF
part /var/raw --size $DMP --ondisk $PD
EOF
cat >> /tmp/disk_map_lv <<EOF
logvol /var/crash --fstype ext3 --size $DMP --vgname=ROOTVG
--name=crashlv
EOF
;;
"small" )
echo "Too small for local dump space."
;;
esac
cat /tmp/disk_map_part /tmp/disk_map_lv >>/tmp/disk_map
) 1> /tmp/pre_ks.log 2>&1
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list