Bug 97369 - allow clearpart --drives=hda,sda --initlabel
Summary: allow clearpart --drives=hda,sda --initlabel
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: anaconda   
(Show other bugs)
Version: 9
Hardware: All Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2003-06-13 18:41 UTC by Marc MERLIN
Modified: 2007-04-18 16:54 UTC (History)
0 users

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

Attachments (Terms of Use)

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

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 18:43:21 UTC
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 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

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 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.

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