Bug 59530 - clearpart kickstart directive is broken
clearpart kickstart directive is broken
Product: Red Hat Linux
Classification: Retired
Component: anaconda (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2002-02-09 14:22 EST by Need Real Name
Modified: 2007-04-18 12:40 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 13:48:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Kickstart Configuration, with sensitive parts deleted and no %post (748 bytes, text/plain)
2002-02-13 21:35 EST, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2002-02-09 14:22:53 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.2)
Gecko/20010726 Netscape6/6.1

Description of problem:
The clearpart kickstart directive only does things if --all or --linux is
specified.  Essentially, the --drives flag has no effect.  This makes it
impossible to leave a drive untouched with a kickstart install, whilst still
repartitioning another drive.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Make a kickstart configuration that uses clearpart --drives <foo>.
2.  An install vs. that config will not clear any partitions (and will fail if
one attempts to specify new partitions for the drive that one wishes to
3.  Make a kickstart configuration that uses clearpart --all --drives <foo>.
4.  An install vs. that config will clear all partitions on all drives.

Actual Results:  Specified in the steps above...

Expected Results:  In the first case, it should just clear the partition tables
on the specified drives.  The second case is the only way to complete an
installation, but it can cause data loss (though it can be recovered by applying
an identical partition table to the affected drives).

Additional info:

The lines in the anaconda source where --all and --linux are the only options
effected can be found in autopart.py, line 765:

    if type == CLEARPART_TYPE_LINUX:
        linuxOnly = 1
    elif type == CLEARPART_TYPE_ALL:
        linuxOnly = 0
    elif type == CLEARPART_TYPE_NONE:
        raise ValueError, "Invalid clear part type in doClearPartAction"

See the second elif clause, where the function returns if one of --all or
--linux was not specified.  The code probably needs adjustment elsewhere.  I'd
submit a patch, but I am not familiar with Python.
Comment 1 Jeremy Katz 2002-02-11 12:07:03 EST
You have to specify both --all/--linux and a --drives specifier.  The drives
specifier is what the --all or --linux apply to (so that you can just remove the
Linux partitions from a drive if you were so inclined).

Also, if you're specifying multiple drives, you'll need the updates.img released
(bug #54293)
Comment 2 Need Real Name 2002-02-11 13:11:30 EST
It *is* a bug.  If --all is specified, it's still zapping the partition tables
on the other drives.
Comment 3 Need Real Name 2002-02-11 13:15:58 EST
Or rather, the following is still zapping the partition tables on hdh, even
though only hdg is specified:

clearpart --all --drives hdg
Comment 4 Jeremy Katz 2002-02-11 14:45:32 EST
Are you using the update disk?
Comment 5 Need Real Name 2002-02-13 21:35:14 EST
Created attachment 45639 [details]
Kickstart Configuration, with sensitive parts deleted and no %post
Comment 6 Need Real Name 2002-02-13 21:36:24 EST
It still doesn't work, even with the update disk.

I've attached the relevant parts of the kickstart configuration that I'm using
on the host.
Comment 7 Jeremy Katz 2002-02-19 18:31:21 EST
This is working for me (with the change that I have to s/hdg/hda/ throughout
since my boxes have hda and hdb, but there's no special casing of that sort)
here.  You booted with 'linux updates' and used the 20020117 update image?
Comment 8 Michael Fulbright 2002-04-10 14:20:48 EDT
Closing due to inactivity, please reopen if you contine to have problems.
Comment 9 Red Hat Bugzilla 2006-02-21 13:48:26 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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