Red Hat Bugzilla – Bug 97369
allow clearpart --drives=hda,sda --initlabel
Last modified: 2007-04-18 12:54:49 EDT
I'd like a kickstart file that works for both IDE and SCSI but doesn't wipe
the second drive.
Right now anaconda dies saying that either hda or sda doesn't exist.
I have to do bad hackery like this:
# Clear all partitions from the first disk
if [ `cat /proc/partitions | grep 'hda ' | wc -l` -gt 0 ]; then
echo "clearpart --drives=hda --initlabel" > /tmp/clearpart
echo "IDE drive detected"
elif [ `cat /proc/partitions | grep 'sda ' | wc -l` -gt 0 ]; then
echo "clearpart --drives=sda --initlabel" > /tmp/clearpart
echo "SCSI drive detected"
echo "Fatal error, can't detect ide or scsi from /proc/partitions"
# We die here
Additionally, it'd be great if --ondrive would take a drive number, as in
that way, I don't have to hardcode hda or sda and worry about the installer
maybe installing on the second drive
Defining what is the "first" drive gets me three answers from talking with three
different people. This is exactly why we added the %include syntax was so that
people could get exactly what they wanted.
But "first drive" isn't that hard to figure out, especially when the system
only has IDE or SCSI.
If it has both, no need to be too fancy and guess what the bios is going to boot,
just default to hda
That's still ways better than nothing, or a custom include script
I guess a syntax similar to grub's (hd0,0) for first partition of the first drive
whether it's IDE or SCSI would have been more convenient for the kickstart config
If a system only has IDE or SCSI, then it's easy to make the kickstart config
correct also. Things are only ever complicated in environments where they get
mixed and when you start throwing things like cciss into the fray.
Grub's syntax doesn't help, it has the exact same problems (which is why there
is a way to reorder drives on the advanced boot loader screen).
Again, this is *exactly* the scenario that %include exists for, so that you can
use the criteria that makes the most sense to you.