Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 623261

Summary: clearpart --initlabel is broken for disks with a whole disk format.
Product: Red Hat Enterprise Linux 6 Reporter: Hans de Goede <hdegoede>
Component: anacondaAssignee: David Lehman <dlehman>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0Keywords: RHELNAK
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In some circumstances, disks that contain a whole disk format (e.g. a LVM Physical Volume populating a whole disk) are not cleared correctly using the clearpart --initlabel kickstart command. Adding the --all switch — as in clearpart --initlabel --all — ensures disks are cleared correctly
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-01 19:04:54 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 Hans de Goede 2010-08-11 18:00:34 UTC
When a ks file contains:
clearpart --initlabel

And one of the disks to be cleared contains a whole disk format like a whole disk lvm PV "clearpart --initlabel" is not honored and the disk will not be given a fresh disklabel.

Comment 2 RHEL Program Management 2010-08-11 18:18:49 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 David Cantrell 2010-08-11 20:32:26 UTC
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

New Contents:
Some disks containing a whole disk format, such as a whole disk LVM PV, may not be cleared correctly with the "clearpart --initlabel" command in kickstart.  In these cases, users may add a %pre section to the kickstart file to run "parted -s /dev/PATH mklabel msdos" on the problem device.  The clearpart command should then work as expected.  See the RHEL 6.0 Kickstart documentation for more information on the %pre section.

Comment 5 Hans de Goede 2010-08-12 10:29:53 UTC
About the technote, I believe that an easier workaround exists. When discussing this with dlehman yesterday it was mentioned that while:

clearpart --initlabel 

Will not do the right thing for whole disk formats, that:

clearpart --initlabel --linux

Will do the right thing for linux whole disk formats, ie a PV / mdraid member (albeit the disklabel for whole disk formats will get cleared later in the 
 partition process then the ones for regular partitioned disks).

Thinking more about this, that means that:
clearpart --initlabel --all

Should do the right thing for all formats. dlehman do you agree with this
assessment ? If so I think we should modify the technote to document this as a workaround instead.

Comment 6 David Lehman 2010-08-12 14:46:23 UTC
That is correct. The --linux and --all modifiers will have the same effect for whole-disk formats as they do for formats on partitions.

Comment 7 Hans de Goede 2010-08-12 17:53:24 UTC
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.

Diffed Contents:
@@ -1 +1 @@
-Some disks containing a whole disk format, such as a whole disk LVM PV, may not be cleared correctly with the "clearpart --initlabel" command in kickstart.  In these cases, users may add a %pre section to the kickstart file to run "parted -s /dev/PATH mklabel msdos" on the problem device.  The clearpart command should then work as expected.  See the RHEL 6.0 Kickstart documentation for more information on the %pre section.+Some disks containing a whole disk format, such as a whole disk LVM PV, may not be cleared correctly with the "clearpart --initlabel" command in kickstart. To work around this issue use "clearpart --initlabel --all"

Comment 10 Ryan Lerch 2010-08-31 02:49:57 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Some disks containing a whole disk format, such as a whole disk LVM PV, may not be cleared correctly with the "clearpart --initlabel" command in kickstart. To work around this issue use "clearpart --initlabel --all"+Disks that contain a whole disk format (e.g. a LVM Physical Volume populating a whole disk) might not be cleared correctly using the "clearpart --initlabel" kickstart command. To work around this issue, use the kickstart command "clearpart --initlabel --all"

Comment 11 Ryan Lerch 2010-09-01 00:10:25 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Disks that contain a whole disk format (e.g. a LVM Physical Volume populating a whole disk) might not be cleared correctly using the "clearpart --initlabel" kickstart command. To work around this issue, use the kickstart command "clearpart --initlabel --all"+In some circumstances, disks that contain a whole disk format (e.g. a LVM Physical Volume populating a whole disk) are not cleared correctly using the clearpart --initlabel kickstart command. Adding the --all switch — as in clearpart --initlabel --all — ensures disks are cleared correctly

Comment 12 RHEL Program Management 2010-10-01 19:04:54 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.