Bug 97369

Summary: allow clearpart --drives=hda,sda --initlabel
Product: [Retired] Red Hat Linux Reporter: Marc MERLIN <marc_soft>
Component: anacondaAssignee: Jeremy Katz <katzj>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-06 21:25:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marc MERLIN 2003-06-13 18:41:11 UTC
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
%include /tmp/clearpart

%pre
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"
else
    chvt 3
    echo "Fatal error, can't detect ide or scsi from /proc/partitions"
    cat /proc/partitions
    # We die here
    read
fi

Comment 1 Marc MERLIN 2003-06-13 18:43:21 UTC
Additionally, it'd be great if --ondrive would take a drive number, as in
--ondrive=1
that way, I don't have to hardcode hda or sda and worry about the installer
maybe installing on the second drive

Comment 2 Jeremy Katz 2003-08-06 20:48:01 UTC
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.

Comment 3 Marc MERLIN 2003-08-06 21:19:42 UTC
Ok.

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
file

Comment 4 Jeremy Katz 2003-08-06 21:25:50 UTC
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.