Another mechanism that allows you to dynamically ignore disks (so you
don't have to explicitly list them in each kickstart file) would be:

   %pre
   echo "bootloader --location=mbr --driveorder=cciss/c0d0" >
/tmp/bootloader

   IGNOREDISK=/tmp/ignoredisk

   ### 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 


Then in the main section of the ks.cfg just:
   %include /tmp/bootloader
   %include /tmp/ignoredisk

For HP systems (with SmartArray controllers at least), the cciss/c#d#
devices do not show up in /tmp/scsidisks.  

Also, this does work with both RHEL4 and RHEL5 very successfully.  Since
we generate individual kickstart files off of the same template for both
SAN and non-SAN system, the above script works nicely.

Maarten Broekman
Email: [email protected]


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Collins, Kevin
[BEELINE]
Sent: Tuesday, December 16, 2008 8:40 PM
To: Red Hat Enterprise Linux 5 (Tikanga) discussion mailing-list
Cc: [email protected]
Subject: RE: [rhelv5-list] Ignore SAN during install?

Thanks - that might work, too.

Kevin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nikolas Lam
Sent: Tuesday, December 16, 2008 5:09 PM
To: Red Hat Enterprise Linux 5 (Tikanga) discussion mailing-list
Cc: [email protected]
Subject: Re: [rhelv5-list] Ignore SAN during install?


On Tue, 2008-12-16 at 16:03 -0800, Collins, Kevin [BEELINE] wrote:
> Hi,
> 
>  
> 
>                 I am working on kickstarting RHEL4 servers with
> SAN-attached disks. The disks hang off of Qlogic HBAs, for which there
> is a generic qla2xxx driver being loaded. I would like to prevent the
> SAN disks from being "seen" during the install  - anyone know of a way
> to do that? 
> 
>  
> 
> Thanks,
> 
>  
> 
> Kevin
> 
>  
> 
> ps - including the RHEL5 list as well as the RHEL4 list.


I got this from a Red Hat Global Professional Services consultant
(cheers Dean, if you're reading this). I've just extracted it from a
satellite kickstart profile for a RHEL5 box we have - I suppose it might
work with RHEL4 too.

Put the following %pre script block in your kickstart file to prevent
the listed drives from being used by fdisk/lvm/mkefs:

%pre
cat <<EOF > /tmp/partitioning
ignoredisk
--drives=sda,sdb,sdc,sdd,sde,sdf,sdg,sdh,sdi,sdj,sdk,sdl,sdm,sdn,sdo,sdp
,sdq,sdr,sds,sdt,sdu,sdv,sdw,sdx
key 49af89414d147589
EOF


In your partitioning section, include the file that you create in the
pre script by adding this line

%include /tmp/partitioning


And then correct for the drive-ordering that might mean that your
HBA-accessible drives come before your local storage. In this case, I
wanted the local HP smartarray disk to come before all the HBA disks.
Use the following line:

bootloader --location mbr --driveorder
cciss/c0d0,sda,sdb,sdc,sdd,sde,sdf,sdg,sdh,sdi,sdj,sdk,sdl,sdm,sdn,sdo,s
dp,sdq,sdr,sds,sdt,sdu,sdv,sdw,sdx

N.B. I have no idea what the "key 49af89414d147589" does in the pre
script - I've never noticed it before today. Anyone?


Regards,

Nik


_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list


_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to