Re: Identifying SCSI or IDE drives in %pre

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Here is the simple test I do:

#
# Determine primary drive type (IDE or SATA/SCSI)
#
DRIVE=''

parted -s /dev/hda > /dev/null 2>&1
if [ "$?" = 0 ]
then
   DRIVE=hda
else
   parted -s /dev/sda > /dev/null 2>&1
   if [ "$?" = 0 ]
   then
      DRIVE=sda
   fi
fi

#
# Then you can just configure your drives based on matching the type
#
if [ "$DRIVE" = "hda" ]
then
   # echo your desired IDE partitioning > /tmp/part-include
else
   # echo your desired SATA/SCSI partitioning > /tmp/part-include
fi

#
# Then in the main body of the kickstart config before the # %pre, you would specify an include where the partitioning
# normally would be:
#
%include /tmp/part-include

Rodney

Daniel Segall wrote:
I deploy kickstarts to a number of different configurations. The servers have IDE, SAS, or SCSI drives. My partitioning is always the same, but if it's an IDE server, I do a software raid1. The SCSI & SAS servers have hardware raid1. Currently I manage multiple configs to make this happen. I'd like to start using list-harddrives in %pre, and generate the partition tables from that. It's really simple, if sd = yes, then partition normally. hd = yes then partition with raid config.

I know this has been covered before, and I have searched and found some examples, but not exactly what I'm looking for. I am not a programmer, so if someone could help me with the logic here, that would be sweet.

Thanks!

--
-Dan

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux