Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520838 - sys-apps/util-linux-2.25: cfdisk sometimes writes incorrect partition table
Summary: sys-apps/util-linux-2.25: cfdisk sometimes writes incorrect partition table
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://thread.gmane.org/gmane.linux.u...
Whiteboard: waiting for util-linux-2.25.1
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2014-08-25 15:17 UTC by Michał Górny
Modified: 2014-09-05 13:20 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-25 15:17:30 UTC
$ fdisk -l /dev/sdb 

Disk /dev/sdb: 111.8 GiB, 120033041920 bytes, 234439535 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
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sdb1  *          63  93755339  93755277 44.7G  7 HPFS/NTFS/exFAT
/dev/sdb2       93755392 234439534 140684143 67.1G  5 Extended
/dev/sdb5       93757440 135700479  41943040   20G 83 Linux


So I run cfdisk, delete sdb5 and create a new, larger partition on top of it. In cfdisk's view everything looks ok -- sdb1, sdb2 and sdb5. However, it's written to the disk wrong:

$ fdisk -l /dev/sdb 

Disk /dev/sdb: 111.8 GiB, 120033041920 bytes, 234439535 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
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot    Start       End  Sectors Size Id Type
/dev/sdb1       93757440 146186239 52428800  25G 83 Linux


So it writes the new logical partition as primary, and discarding everything else... I suspect the issue lies within 'delete' since after restoring the primary partition using testdisk, adding extended + logical works fine.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-25 15:22:50 UTC
I've p.masked the new version so that our users don't run into this issue.
Comment 2 octoploid 2014-08-25 17:38:39 UTC
You should report this upstream.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-25 18:13:18 UTC
(In reply to octoploid from comment #2)
> You should report this upstream.

I know but I'll test -9999 first.
Comment 4 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2014-08-31 11:38:45 UTC
Here is the fix - could we get a -r1 with this patch applied?

https://github.com/karelzak/util-linux/commit/613596b3873a0d7d45396e066eee097b082ff833
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-31 11:40:03 UTC
Is that really necessary? Upstream is preparing the bugfix release already.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-08-31 14:00:55 UTC
(In reply to Michał Górny from comment #5)
> Is that really necessary? Upstream is preparing the bugfix release already.

Exactly. util-linux-2.25.1_rc1 was already released and I planned to wait for the 2.25.1 final release to commit.
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-09-05 13:20:23 UTC
+*util-linux-2.25.1 (05 Sep 2014)
+
+  05 Sep 2014; Lars Wendler <polynomial-c@gentoo.org>
+  -util-linux-2.22.2.ebuild, -util-linux-2.25.ebuild,
+  +util-linux-2.25.1.ebuild, -files/util-linux-2.25-lscpu-pic.patch,
+  metadata.xml:
+  Version bump. Removed old.
+