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, 17 years and 109 days ago. Viewed 5,773 times. #2
[diff] [history] [edit] [rdf]

A Sample Way To Generalize Disk Layouts

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

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:


# 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


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


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: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt