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 839458 - fdisk does not working properly when creating extended partition on rhel6.2
Summary: fdisk does not working properly when creating extended partition on rhel6.2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 782183 840685
TreeView+ depends on / blocked
 
Reported: 2012-07-12 02:19 UTC by mjin
Modified: 2018-12-05 15:35 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-07 19:39:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description mjin 2012-07-12 02:19:50 UTC
Description of problem:

when create extended partition on rhel6 via fdisk. start sector for newly created partition(default) is not exictly the end sector for last partition just created. 
there is a gap(2049 sectors) between partitions. 

/dev/sda5 109467648 151410687
/dev/sda6 151412736 172384255
/dev/sda7 172386304 193357823

after they have created some extended partitions, they only can allocate 1024 blocks for newly created partition,(say on /dev/sda10 in this case). after they have allocated 1024 blocks for that partition, they could allocate block size as they wanted if they add a new partition continueously, 

[root@localhost ~]# fdisk -cu /dev/sda

Command (m for help): p

Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders, total 584843264 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: 0x000961bc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648    67520511    33554432   82  Linux swap / Solaris
/dev/sda3        67520512   109463551    20971520   83  Linux
/dev/sda4       109463552   584843263   237689856    5  Extended
/dev/sda5       109467648   151410687    20971520   83  Linux
/dev/sda6       151412736   172384255    10485760   83  Linux
/dev/sda7       172386304   193357823    10485760   83  Linux
/dev/sda8       193359872   214331391    10485760   83  Linux
/dev/sda9       214333440   235304959    10485760   83  Linux

Command (m for help): n
First sector (109465600-584843263, default 109465600): 
Using default value 109465600
Last sector, +sectors or +size{K,M,G} (109465600-109467647, default 109467647): 
Using default value 109467647

Command (m for help): p

Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders, total 584843264 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: 0x000961bc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648    67520511    33554432   82  Linux swap / Solaris
/dev/sda3        67520512   109463551    20971520   83  Linux
/dev/sda4       109463552   584843263   237689856    5  Extended
/dev/sda5       109467648   151410687    20971520   83  Linux
/dev/sda6       151412736   172384255    10485760   83  Linux
/dev/sda7       172386304   193357823    10485760   83  Linux
/dev/sda8       193359872   214331391    10485760   83  Linux
/dev/sda9       214333440   235304959    10485760   83  Linux
/dev/sda10      109465600   109467647        1024   83  Linux

Partition table entries are not in disk order

Command (m for help): 

Command (m for help): n
First sector (235307008-584843263, default 235307008): 
Using default value 235307008
Last sector, +sectors or +size{K,M,G} (235307008-584843263, default 584843263): 
Using default value 584843263

Command (m for help): p

Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders, total 584843264 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: 0x000961bc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      411647      204800   83  Linux
/dev/sda2          411648    67520511    33554432   82  Linux swap / Solaris
/dev/sda3        67520512   109463551    20971520   83  Linux
/dev/sda4       109463552   584843263   237689856    5  Extended
/dev/sda5       109467648   151410687    20971520   83  Linux
/dev/sda6       151412736   172384255    10485760   83  Linux
/dev/sda7       172386304   193357823    10485760   83  Linux
/dev/sda8       193359872   214331391    10485760   83  Linux
/dev/sda9       214333440   235304959    10485760   83  Linux
/dev/sda10      109465600   109467647        1024   83  Linux
/dev/sda11      235307008   584843263   174768128   83  Linux

Partition table entries are not in disk order
-----------------------------------------------------------------------


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

fdisk (util-linux-ng 2.17.2)
IBM x3650 M4 ( sas 300GB ) and DELL R710 ( sas 300GB )
kernel 2.6.32-220.el6.x86_64
Red Hat Enterprise Linux Server release 6.2 (Santiago)

How reproducible:

always

Steps to Reproduce:
1.
2.
3.
  
Actual results:

there is a 2049 sectors gap between extended partitions, and could only allocate 1024 blocks for uncertion partition somehow.


Expected results:

there should be no gap between extended partitions, and should allocate blocks as we wanted.

Additional info:

Comment 2 mjin 2012-07-12 02:38:11 UTC
i cannot repreduce this issue in my test environment, it seems like this issue only happens with specific device...

Comment 3 Karel Zak 2012-07-12 15:02:49 UTC
It's expected behavior.

For each logical partition is there a special partition table, see http://en.wikipedia.org/wiki/Extended_boot_record, it means that there has to be at least 1 sector gap between logical partitions.

.. but because the default grain for non-DOS mode (-cu options) is 1 MiB (2049 sectors) to align partitions for compatibility with 4K disks, RAIDs, ... the gap is 1MiB.

It's better to have gaps between logical partitions than misaligned partitions :-)

Sorry, not a bug from my point of view.

Comment 5 Karel Zak 2012-08-07 19:39:47 UTC
Closing.


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