Bug 97369 - allow clearpart --drives=hda,sda --initlabel
allow clearpart --drives=hda,sda --initlabel
Product: Red Hat Linux
Classification: Retired
Component: anaconda (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-06-13 14:41 EDT by Marc MERLIN
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-08-06 17:25:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 2003-06-13 14:41:11 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
%include /tmp/clearpart

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"
    chvt 3
    echo "Fatal error, can't detect ide or scsi from /proc/partitions"
    cat /proc/partitions
    # We die here
Comment 1 Marc MERLIN 2003-06-13 14:43:21 EDT
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
Comment 2 Jeremy Katz 2003-08-06 16:48:01 EDT
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 17:19:42 EDT

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

Note You need to log in before you can comment on or make changes to this bug.