GNU bug report logs - #21136
incorrect partition size calculation

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: Gena Makhomed <gmm@HIDDEN>; dated Sun, 26 Jul 2015 17:02:01 UTC; Maintainer for parted is bug-parted@HIDDEN.

Message received at 21136 <at> debbugs.gnu.org:


Received: (at 21136) by debbugs.gnu.org; 18 Sep 2015 18:31:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 18 14:31:58 2015
Received: from localhost ([127.0.0.1]:37226 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Zd0Ry-0002u2-9o
	for submit <at> debbugs.gnu.org; Fri, 18 Sep 2015 14:31:58 -0400
Received: from mail-yk0-f175.google.com ([209.85.160.175]:35197)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <phillsusi@HIDDEN>) id 1Zd0Rw-0002tu-N7
 for 21136 <at> debbugs.gnu.org; Fri, 18 Sep 2015 14:31:57 -0400
Received: by ykdu9 with SMTP id u9so54439772ykd.2
 for <21136 <at> debbugs.gnu.org>; Fri, 18 Sep 2015 11:31:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-type:content-transfer-encoding;
 bh=ERIKBhX4dNNy0YvnAaX7wypNIWaD/5zQQGGreRrRTwE=;
 b=j5HeRLixKOiYR0amDOShB/X95DTutHw3tLdixpGSWBLrFsIy4ML6FAH0HPOU/WSuC3
 +41kV5vhG8kpQj9WNJI1wpEe1nZi7BnA27iL1ZZBmRHgzjiR5uzKTuBGUSJyX1rzctWH
 /JBLzw0Tk59xcKxe19NL8KHSrT38/mCxSOysXC0P+NtSm9d5RNwyswjYnusidZtTs7e1
 PSEpuHoXwzx9rYMb20TDTktw2HfD4isnQqppQ7cdtyVLU11JirWlo2RdwXkyxfRILKH6
 1DsoBdmVkz9KDfbQGsAmdqFN7LrocX9wb8loBSoGk7TbAWALVR37VhOp4gpw8Sj0cYNv
 1JHQ==
X-Received: by 10.129.75.3 with SMTP id y3mr5904341ywa.92.1442601116267;
 Fri, 18 Sep 2015 11:31:56 -0700 (PDT)
Received: from [10.1.1.230] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12])
 by smtp.googlemail.com with ESMTPSA id
 h205sm6388171ywc.2.2015.09.18.11.31.55
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 18 Sep 2015 11:31:55 -0700 (PDT)
Subject: Re: bug#21136: incorrect partition size calculation
To: Gena Makhomed <gmm@HIDDEN>, 21136 <at> debbugs.gnu.org
References: <558E0817.8050200@HIDDEN>
 <20150629174336.GK3170@HIDDEN> <5591906E.6040302@HIDDEN>
 <55957CA6.7000201@HIDDEN> <55B51273.6090809@HIDDEN>
From: Phil Susi <psusi@HIDDEN>
Message-ID: <55FC588F.9030402@HIDDEN>
Date: Fri, 18 Sep 2015 14:31:43 -0400
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
MIME-Version: 1.0
In-Reply-To: <55B51273.6090809@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 21136
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 7/26/2015 1:01 PM, Gena Makhomed wrote:
> I am just tested again on parted version 3.1
> - it uses one more sector in case of "mib" unit.

Ahh, the case matters.. very strange.






Information forwarded to bug-parted@HIDDEN:
bug#21136; Package parted. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Jul 2015 17:01:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 26 13:01:44 2015
Received: from localhost ([127.0.0.1]:59330 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZJPJ1-000348-Ri
	for submit <at> debbugs.gnu.org; Sun, 26 Jul 2015 13:01:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34317)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIz-000340-5n
 for submit <at> debbugs.gnu.org; Sun, 26 Jul 2015 13:01:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIy-0002eO-2D
 for submit <at> debbugs.gnu.org; Sun, 26 Jul 2015 13:01:40 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:55990)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIx-0002eK-V8
 for submit <at> debbugs.gnu.org; Sun, 26 Jul 2015 13:01:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47824)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIx-0001mD-16
 for bug-parted@HIDDEN; Sun, 26 Jul 2015 13:01:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIs-0002da-U2
 for bug-parted@HIDDEN; Sun, 26 Jul 2015 13:01:38 -0400
Received: from ideil.net ([77.120.97.32]:35485)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <gmm@HIDDEN>) id 1ZJPIs-0002ca-NW
 for bug-parted@HIDDEN; Sun, 26 Jul 2015 13:01:34 -0400
Received: from [172.17.17.20] (static.60.44.9.176.clients.your-server.de
 [176.9.44.60])
 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by ideil.net (Postfix) with ESMTP id 67EF5400C5
 for <bug-parted@HIDDEN>; Sun, 26 Jul 2015 20:02:27 +0300 (EEST)
Subject: incorrect partition size calculation
To: bug-parted@HIDDEN
References: <558E0817.8050200@HIDDEN>
 <20150629174336.GK3170@HIDDEN> <5591906E.6040302@HIDDEN>
 <55957CA6.7000201@HIDDEN>
From: Gena Makhomed <gmm@HIDDEN>
Message-ID: <55B51273.6090809@HIDDEN>
Date: Sun, 26 Jul 2015 20:01:39 +0300
User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
MIME-Version: 1.0
In-Reply-To: <55957CA6.7000201@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)

On 02.07.2015 21:02, Phil Susi wrote:

 >> BTW, "start and end are inclusive" - IMHO is very bad decision,
 >> because now it is not possible to partition disk using MiB units
 >> and always need use sectors and make all calculations manually.
 >
 > No.. MiB units work just fine.

I am just tested again on parted version 3.1
- it uses one more sector in case of "mib" unit.

 >> for example, parted -s /dev/sda mkpart primary 34s 1MiB
 >> now use one sector from second MiB and next partition
 >> will be created as unaligned.
 >
 > No, it doesn't... the partition ends on sector 2047, so the next
 > partition can start on sector 2048.

steps to reproduce bug:

Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start  End        Size       File system  Name     Flags
  1      34s    2047s      2014s                   primary  bios_grub
         2048s  67108822s  67106775s  Free Space

if I issue command "mkpart primary 1MiB 8193MiB" - all works fine:

Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start      End        Size       File system  Name     Flags
  1      34s        2047s      2014s                   primary  bios_grub
  2      2048s      16779263s  16777216s               primary
         16779264s  67108822s  50329559s  Free Space

but if I issue command "mkpart primary 1mib 8193mib" - BUG IS HERE:

Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start      End        Size       File system  Name     Flags
  1      34s        2047s      2014s                   primary  bios_grub
  2      2048s      16779264s  16777217s               primary
         16779265s  67108822s  50329558s  Free Space

==============================================================

difference only in unit name case: 'MiB' works fine,
'mib' create wrong partitions, used one more sector.

looks like this is bug, and behavior of parted
should be the same, regardless of unit name case: 'mib' or 'MiB'.

-- 
Best regards,
  Gena




Acknowledgement sent to Gena Makhomed <gmm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#21136; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.