[util-linux] cfdisk cannot read 1MiB-aligned partition tables

Bug #545966 reported by Laurent Bonnaud
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Gentoo Linux
Confirmed
Medium
partman-base (Ubuntu)
Invalid
Undecided
Unassigned
ubiquity (Ubuntu)
Invalid
Undecided
Unassigned
util-linux (Fedora)
Fix Released
Medium
util-linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I installed lucid from CD on a spare laptop. I chose the "Use entire disk" option.

The problem is that the created partition cannot be read by cfdisk:

# cfdisk /dev/sda
             FATAL ERROR: Bad primary partition 1: Partition ends in the final partial cylinder
                                        Press any key to exit cfdisk

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

Here is the partition table as seen by fdisk:

# fdisk -clu /dev/sda

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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: 0x000a8693

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 378650623 189324288 83 Linux
/dev/sda2 378652671 390721535 6034432+ 5 Extended
/dev/sda5 378652672 390721535 6034432 82 Linux swap / Solaris

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

Here is the partition table as seen by gparted.

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

What is the point of having 2 small unallocated chunks ?

Revision history for this message
ceg (ceg) wrote :

I got the same fatal error stating cfdisk.

             FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylind
                                        Press any key to exit cfdisk

Installed manually, creating only logical partitions: 500M /boot, 3GB raid1 for /home, rest raid1 with lvm for swap and root (8GB virtualbox disks)

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
ceg (ceg) wrote :

mine was the RC, alternate CD

summary: - [lucid beta1] ubiquity creates a strange partition table
+ [lucid] install creates a strange partition table
ceg (ceg)
Changed in partman-base (Ubuntu):
status: New → Confirmed
status: Confirmed → New
Revision history for this message
Evan (ev) wrote : Re: [lucid] install creates a strange partition table

Can you please try with one of the latest daily images and let us know via this bug report whether or not it's still occurring? I believe this bug is a duplicate of bug 558382.

Alternate:
http://cdimage.ubuntu.com/daily/

Desktop:
http://cdimage.ubuntu.com/daily-live/

Changed in ubiquity (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

I think I have an answer for comment #3:

From https://wiki.ubuntu.com/LucidLynx/ReleaseNotes :

By default, Ubuntu 10.04 LTS aligns partitions on disk to 1 MiB (1048576 bytes) boundaries. This ensures maximum performance on many modern disks, particularly solid state drives but also new "Advanced Format" disks with physical sectors larger than the traditional 512 bytes. Very few systems nowadays need the old alignment, used in the days of MS-DOS when it was useful for partitions to start at the beginning of a cylinder.

This leaves the "partition unreadable by cfdisk" bug. I will try with the final lucid release...

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

I tested with the final lucid ISO and cfdisk is still unable to read the partition table created by ubiquity.

Changed in ubiquity (Ubuntu):
status: Incomplete → Confirmed
Changed in partman-base (Ubuntu):
status: New → Confirmed
summary: - [lucid] install creates a strange partition table
+ [lucid] ubiquity/partman creates a partition table that cfdisk cannot
+ read
Revision history for this message
Marti (intgr) wrote : Re: [lucid] ubiquity/partman creates a partition table that cfdisk cannot read

So if cfdisk cannot read a partition table that's 1MiB-aligned, then surely it's a cfdisk bug, not the installer?

This also explains why cfdisk fails with disks formatted in Windows Vista.

Changed in ubiquity:
status: Unknown → Confirmed
Revision history for this message
In , Steve (steve-redhat-bugs) wrote :

Description of problem:
After installing F14-Alpha 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.18-4.fc14.x86_64
F14-Alpha net installer CD

How reproducible:
I believe this is an "always".

Steps to Reproduce:
Although I have seen the cfdisk error on disks, this method uses a VM image file.
1. Create an 8G VM disk image file:
$ qemu-img create f14-alpha.img 8G
2. Install F14-Alpha to it after choosing the full-disk partition option.
3. After installation reboot the VM and run:
# cfdisk -P s /dev/sda

Actual results:
[root@fir log]# 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:

[root@fir tmp]# fdisk -lu /dev/sda

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 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: 0x0003a31f

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 16777215 7875584 8e Linux LVM
[root@fir tmp]#

The VM image file is exactly 8589934592 bytes.

When I attempted to use cfdisk on a disk that it could not read, the only option to get cfdisk working was to repartition using "cfdisk -z /dev/sdX" and let cfdisk figure where the last sector should be. Unfortunately, this wastes sectors at the end of the disk. The installer partitioning uses those last sectors.

Revision history for this message
In , Karel (karel-redhat-bugs) wrote :

The problem is that some parts of cfdisk are still based on CHS partitioning. For example the size of the device is expected as a multiple of the cylinder size.

I have fixed the problem in upstream repository:
http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commit;h=73356e0553bd9ac00f556891a4798064c0ee6849

fedora will be updated ASAP (probably next week)

Revision history for this message
In , Steve (steve-redhat-bugs) wrote :

(In reply to comment #1)
> The problem is that some parts of cfdisk are still based on CHS partitioning.
> For example the size of the device is expected as a multiple of the cylinder
> size.
>
> I have fixed the problem in upstream repository:
> http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commit;h=73356e0553bd9ac00f556891a4798064c0ee6849
>
> fedora will be updated ASAP (probably next week)

Thanks, Karel!

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

This bug still exists in maverick with:

 - a partition table created with the 10.10 beta installer
 - util-linux 2.17.2-0ubuntu1

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

util-linux-ng-2.18-4.2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/util-linux-ng-2.18-4.2.fc14

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

util-linux-ng-2.18-4.2.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update util-linux-ng'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/util-linux-ng-2.18-4.2.fc14

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

util-linux-ng-2.18-4.3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/util-linux-ng-2.18-4.3.fc14

summary: - [lucid] ubiquity/partman creates a partition table that cfdisk cannot
- read
+ ubiquity/partman creates a partition table that cfdisk cannot read
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

util-linux-ng-2.18-4.3.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
Marti (intgr) wrote :

I have updated the summary because 1MiB-aligning partitions is the *intended* behavior. cfdisk is at fault here -- it fails with partitions created by recent Windows releases as well as newer Linux partitioning tools.

The statuses on partman-base/ubiquity should be marked as invalid as far as I can tell.

summary: - ubiquity/partman creates a partition table that cfdisk cannot read
+ [util-linux] cfdisk cannot read 1MiB-aligned partition tables
Changed in ubiquity (Ubuntu):
status: Confirmed → Invalid
Changed in partman-base (Ubuntu):
status: Confirmed → Invalid
Changed in util-linux (Ubuntu):
status: New → Confirmed
description: updated
Changed in gentoo:
status: Unknown → Confirmed
Revision history for this message
Marcos Felipe Mello (marcosfrm) wrote :

Fixed upstream (pos-2.18 fix).

http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commit;h=73356e0553bd9ac00f556891a4798064c0ee6849

Reference (Fedora):
https://bugzilla.redhat.com/show_bug.cgi?id=630340

And what about Ubuntu push util-linux 2.19 (currently rc3) into Natty? Lots and lots of bug fixes and enhancements since 2.17.2.

Revision history for this message
Marcos Felipe Mello (marcosfrm) wrote :

Marti is right. Not a partman-base/ubiquity bug.

Changed in gentoo:
importance: Unknown → Medium
Changed in ubiquity:
importance: Unknown → Medium
Revision history for this message
Marcos Felipe Mello (marcosfrm) wrote :

util-linux 2.19 stable (10-Feb-2011)
https://lkml.org/lkml/2011/2/10/72
http://www.kernel.org/pub/linux/utils/util-linux/v2.19/v2.19-ReleaseNotes

Let's hope Debian update its package soon.

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

This bug is fixed in oneiric. Thanks!

Changed in util-linux (Ubuntu):
status: Confirmed → Fix Released
Colin Watson (cjwatson)
no longer affects: ubiquity
Changed in util-linux (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.