On Fri, Nov 19, 2010 at 09:35:52AM +0000, Tom Brown wrote:
> the following works for me on RHEL5 and RHEL6 without issue
>
> if list-harddrives | grep -q sda; then
> elif list-harddrives | grep -q cciss; then
> elif list-harddrives | grep -q xvda; then
> elif list-harddrives | grep -q hda; then
> else
> fi

Just wondering on the reasoning behind that order?

A problem we hit was ending up with linux getting installed to
SAN visible as sda.
We have local discs everywhere and want linux to be installed 
there.  
For compatibility with both HP (cciss), non-HP (mostly sda) 
and kvm (hda) this looks good now, thanks for your inspiration:

--------------------------------------------
if list-harddrives | grep -q cciss; then
  cat << EOF >/tmp/partinfo
  part /boot --size=128 --ondisk=cciss/c0d0 --asprimary --fstype ext3 
  part pv.1  --size=1   --ondisk=cciss/c0d0 --asprimary --grow
EOF
elif list-harddrives | grep -q sda; then
  cat << EOF >/tmp/partinfo
  part /boot --size=128 --ondisk=sda --asprimary --fstype ext3 
  part pv.1  --size=1   --ondisk=sda --asprimary --grow
EOF
elif list-harddrives | grep -q hda; then
  cat << EOF >/tmp/partinfo
  part /boot --size=128 --ondisk=hda --asprimary --fstype ext3 
  part pv.1  --size=1   --ondisk=hda --asprimary --grow
EOF
else
    echo "No usable discs found."
    exit 255
fi

cat << EOF >> /tmp/partinfo
volgroup vg00 pv.1
logvol swap --fstype swap --vgname=vg00 --name=lv_swap --size=2048
logvol /    --fstype ext3 --vgname=vg00 --name=lv_root --size=2048
logvol /usr --fstype ext3 --vgname=vg00 --name=lv_usr  --size=4096
logvol /opt --fstype ext3 --vgname=vg00 --name=lv_opt  --size=2048
logvol /tmp --fstype ext3 --vgname=vg00 --name=lv_tmp  --size=2048
logvol /var --fstype ext3 --vgname=vg00 --name=lv_var  --size=16384
--------------------------------------------

Christian
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to