For When You Can't Have The Real Thing
[ start | index | login ]
start > RedHat > kickstart > Automatic Drive Handling

Automatic Drive Handling

Created by dave. Last edited by dave, 11 years and 346 days ago. Viewed 4,128 times. #2
[diff] [history] [edit] [rdf]
labels
attachments

A Sample Way To Generalize Disk Layouts

An email from "Shabazian, Chip" <Chip.Shabazia at bankofamerica.com>:

I've got a great way that I've been doing this for years. It works for all types of drives, scsi, ide, even the cciss scsi controllers in HP DL Servers.

In %pre, I figure out what drives exist in the system, and write out a partion scheme based on one or two drives:

%pre

# Determine how many drives we have set $(list-harddrives) let numd=$#/2 d1=$1 d2=$3

if [ $numd -ge 2 ] ; then cat << EOF >> /tmp/partinfo part pv.01 --size=1 --grow --fstype=ext3 --ondisk=$d1 volgroup volgrp01 pv.01 part pv.02 --size=1 --grow --fstype=ext3 --ondisk=$d2 volgroup volgrp02 pv.02 #HOWEVER_YOU_WANT_TO_PARTITION EOF

else

cat << EOF >> /tmp/partinfo part pv.01 --size=1 --grow --fstype=ext3 --ondisk=$d1 volgroup volgrp01 pv.01 #HOWEVER_YOU_WANT_TO_PARTITION EOF

fi

I then %include the partitioning back up in the command section:
%include /tmp/partinfo

Oops, forgot to mention that list-hardrives also returns the SIZE of the drive. $2 is the size of the first drive, $4 the size of the second, and so on.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt