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 723352 - cfdisk cannot read default installer partitioning
Summary: cfdisk cannot read default installer partitioning
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-19 21:15 UTC by Ivan Pablo Anauati
Modified: 2018-11-14 11:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 17:11:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 630340 0 low CLOSED cfdisk cannot read default installer partitioning 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2011:1691 0 normal SHIPPED_LIVE Low: util-linux-ng security, bug fix, and enhancement update 2011-12-06 01:02:36 UTC

Description Ivan Pablo Anauati 2011-07-19 21:15:22 UTC
Description of problem:

After installing RHEL6.1 with the default full-disk partitioning, cfdisk
reports:

FATAL ERROR: Bad primary partition 1: Partition ends in the final partial
cylinder

fdisk reports the partitioning without complaint.



Version-Release number of selected component (if applicable):
util-linux-ng-2.17.2-12.el6.x86_64 

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:
[root@redhat ~]# cfdisk -P s /dev/sda
FATAL ERROR: Bad primary partition 1: Partition ends in the final partial
cylinder

Expected results:
cfdisk displays the partitions.

Additional info:

<<From one of our engineers>>

The numbers you are seeing overlap (7616) is normal, albeit misleading. That is a cylinder number, and is the default display when using dos-compatible fdisk modes, and viewing the units in terms of cylinders.  Here is another example from my computer:

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a077f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        7784    62009344   83  Linux

*Note that I'm using newer fdisk, so it now is capable of recognizing when a partition isn't optimized geometrically. This is one reason fdisk's default output now shows sectors, rather than cylinders.


 To see the actual boundaries, you need to switch fdisk into the newer "sectors" display:

fdisk -l -c nondos -u sectors /dev/sda


Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a077f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   125044735    62009344   83  Linux

See how there is no overlap?
cfdisk has a bug because it still expects to deal with cylinders.

Comment 3 Karel Zak 2011-07-19 21:31:17 UTC
This bug is already fixed in Fedora (bug #630340) and upstream.

Comment 8 Karel Volný 2011-10-13 10:29:26 UTC
I guess I'd need some help verifying this ... how to create disk schema which triggers the bug?

- I mean, is there any easier method than going through the actual install?

I've tried to create two partitions across the whole disk (just 16 MiB for testing purposes) by both fdisk and parted, and cfdisk haven't complained about that ...

Comment 9 Karel Zak 2011-10-17 08:21:14 UTC
# modprobe scsi_debug dev_size_mb=512 sector_size=512
(or try to use loop device, not sure)

# fdisk -c -u /dev/sdb
(create one partition on whole disk (default sectors: first=2048, last=1048575)

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb06e6c19.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (2048-1048575, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1048575, default 1048575): 
Using default value 1048575

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

# cfdisk  /dev/sdb   <--- ERROR without the patch

Comment 10 Karel Volný 2011-10-19 15:06:30 UTC
fdisk doesn't seem to like loop devices ...

it seems that sector_size doesn't need to be specified

dev_size_mb=512 is what matters - it doesn't work (reproduce the bug) with 513 ... and more important, it doesn't work with anything smaller than 512, which would make it a bit troublesome to test

but there seems to be a workaround - size 1024 triggers the bug too ... so creating the device of the same size with virtual_gb=1 does the job without consuming so much memory

Comment 12 errata-xmlrpc 2011-12-06 17:11:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1691.html


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