From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 27 01:59:39 2015 Received: (at submit) by debbugs.gnu.org; 27 Jun 2015 05:59:39 +0000 Received: from localhost ([127.0.0.1]:58597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8j9O-00044V-9k for submit@debbugs.gnu.org; Sat, 27 Jun 2015 01:59:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45153) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8fiF-0007Wb-8k for submit@debbugs.gnu.org; Fri, 26 Jun 2015 22:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8fi9-0007Yh-42 for submit@debbugs.gnu.org; Fri, 26 Jun 2015 22:19:17 -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]:48985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8fi9-0007Yd-0z for submit@debbugs.gnu.org; Fri, 26 Jun 2015 22:19:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8fi8-0007uL-4z for bug-parted@gnu.org; Fri, 26 Jun 2015 22:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8fi3-0007Y7-3I for bug-parted@gnu.org; Fri, 26 Jun 2015 22:19:16 -0400 Received: from ideil.net ([77.120.97.32]:51770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8fi2-0007Xs-Ro for bug-parted@gnu.org; Fri, 26 Jun 2015 22:19:11 -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 A185B400C5 for ; Sat, 27 Jun 2015 05:19:19 +0300 (EEST) Message-ID: <558E0817.8050200@csdoc.com> Date: Sat, 27 Jun 2015 05:19:03 +0300 From: Gena Makhomed User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: bug-parted@gnu.org Subject: incorrect partition size calculation 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-Mailman-Approved-At: Sat, 27 Jun 2015 01:59:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Hello, All! incorrect partition size calculation # parted -v parted (GNU parted) 2.3 Model: ATA HGST HUS724040AL (scsi) Disk /dev/sda: 7814037168s how to reproduce: parted -s /dev/sda mklabel gpt parted -s /dev/sda -a none mkpart primary 34s 2047s parted -s /dev/sda set 1 bios_grub on parted -s /dev/sda mkpart primary 2048s 2099199s parted -s /dev/sda set 2 raid on parted -s /dev/sda mkpart primary 2099200s 102764543s parted -s /dev/sda set 3 raid on parted -s /dev/sda mkpart primary zfs 102764544s 7814037134s parted (parted) unit s (parted) print free Model: ATA HGST HUS724040AL (scsi) Disk /dev/sda: 7814037168s Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 34s 2047s 2014s primary bios_grub 2 2048s 2099199s 2097152s primary raid 3 2099200s 102764543s 100665344s primary raid 4 102764544s 7814037134s 7711272591s primary (parted) ======================================= parted reports what /dev/sda4 partition has size of 7711272591s but this is not true, partition size is 7711272590s: 7814037168 - 2014 - 2097152 - 100665344 - 34 - 34 == 7711272590 P.S. sorry, I can't find bugzilla for parted and can't check what this bug for parted was previously reported and fixed. -- Best regards, Gena From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 29 13:43:54 2015 Received: (at submit) by debbugs.gnu.org; 29 Jun 2015 17:43:54 +0000 Received: from localhost ([127.0.0.1]:33284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9d61-0004s7-Vr for submit@debbugs.gnu.org; Mon, 29 Jun 2015 13:43:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49387) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9d60-0004rs-6X for submit@debbugs.gnu.org; Mon, 29 Jun 2015 13:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9d5u-0008W9-8U for submit@debbugs.gnu.org; Mon, 29 Jun 2015 13:43:47 -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]:43710) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d5u-0008W4-5v for submit@debbugs.gnu.org; Mon, 29 Jun 2015 13:43:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d5t-0000id-9G for bug-parted@gnu.org; Mon, 29 Jun 2015 13:43:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9d5q-0008VB-3T for bug-parted@gnu.org; Mon, 29 Jun 2015 13:43:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9d5p-0008UN-UK for bug-parted@gnu.org; Mon, 29 Jun 2015 13:43:42 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id E07BB35B8A6 for ; Mon, 29 Jun 2015 17:43:38 +0000 (UTC) Received: from lister.brianlane.com (ovpn-113-104.phx2.redhat.com [10.3.113.104]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5THhaj4017174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 29 Jun 2015 13:43:38 -0400 Date: Mon, 29 Jun 2015 10:43:36 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: Re: bug#20909: incorrect partition size calculation Message-ID: <20150629174336.GK3170@lister.brianlane.com> References: <558E0817.8050200@csdoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <558E0817.8050200@csdoc.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On Sat, Jun 27, 2015 at 05:19:03AM +0300, Gena Makhomed wrote: > Hello, All! > > incorrect partition size calculation > > # parted -v > parted (GNU parted) 2.3 > > Model: ATA HGST HUS724040AL (scsi) > Disk /dev/sda: 7814037168s > > how to reproduce: > > parted -s /dev/sda mklabel gpt > parted -s /dev/sda -a none mkpart primary 34s 2047s > parted -s /dev/sda set 1 bios_grub on > parted -s /dev/sda mkpart primary 2048s 2099199s > parted -s /dev/sda set 2 raid on > parted -s /dev/sda mkpart primary 2099200s 102764543s > parted -s /dev/sda set 3 raid on > parted -s /dev/sda mkpart primary zfs 102764544s 7814037134s > > parted > (parted) unit s > (parted) print free > Model: ATA HGST HUS724040AL (scsi) > Disk /dev/sda: 7814037168s > Sector size (logical/physical): 512B/512B > Partition Table: gpt > > Number Start End Size File system Name Flags > 1 34s 2047s 2014s primary bios_grub > 2 2048s 2099199s 2097152s primary raid > 3 2099200s 102764543s 100665344s primary raid > 4 102764544s 7814037134s 7711272591s primary > > (parted) > > ======================================= > > parted reports what /dev/sda4 partition has size of 7711272591s > but this is not true, partition size is 7711272590s: > > 7814037168 - 2014 - 2097152 - 100665344 - 34 - 34 == 7711272590 You are off by 1. start and end are inclusive so the size of sda4 is: 1 + (7814037134 - 102764544) = 7711272591 -- Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 29 14:38:01 2015 Received: (at submit) by debbugs.gnu.org; 29 Jun 2015 18:38:01 +0000 Received: from localhost ([127.0.0.1]:33324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9dwO-0007hF-N3 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 14:38:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41310) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9dwL-0007h1-Fw for submit@debbugs.gnu.org; Mon, 29 Jun 2015 14:37:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9dwE-0002yk-Sk for submit@debbugs.gnu.org; Mon, 29 Jun 2015 14:37:52 -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]:41716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9dwE-0002yZ-QW for submit@debbugs.gnu.org; Mon, 29 Jun 2015 14:37:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9dwD-0006z9-Kg for bug-parted@gnu.org; Mon, 29 Jun 2015 14:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9dw5-0002vy-6x for bug-parted@gnu.org; Mon, 29 Jun 2015 14:37:49 -0400 Received: from ideil.net ([77.120.97.32]:39934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9dw5-0002uy-0c for bug-parted@gnu.org; Mon, 29 Jun 2015 14:37:41 -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 27AA6400C5 for ; Mon, 29 Jun 2015 21:37:52 +0300 (EEST) Message-ID: <5591906E.6040302@csdoc.com> Date: Mon, 29 Jun 2015 21:37:34 +0300 From: Gena Makhomed User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: bug-parted@gnu.org Subject: Re: bug#20909: incorrect partition size calculation References: <558E0817.8050200@csdoc.com> <20150629174336.GK3170@lister.brianlane.com> In-Reply-To: <20150629174336.GK3170@lister.brianlane.com> 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@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On 29.06.2015 20:43, Brian C. Lane wrote: >> incorrect partition size calculation >> >> # parted -v >> parted (GNU parted) 2.3 >> >> Model: ATA HGST HUS724040AL (scsi) >> Disk /dev/sda: 7814037168s >> >> how to reproduce: >> >> parted -s /dev/sda mklabel gpt >> parted -s /dev/sda -a none mkpart primary 34s 2047s >> parted -s /dev/sda set 1 bios_grub on >> parted -s /dev/sda mkpart primary 2048s 2099199s >> parted -s /dev/sda set 2 raid on >> parted -s /dev/sda mkpart primary 2099200s 102764543s >> parted -s /dev/sda set 3 raid on >> parted -s /dev/sda mkpart primary zfs 102764544s 7814037134s >> >> parted >> (parted) unit s >> (parted) print free >> Model: ATA HGST HUS724040AL (scsi) >> Disk /dev/sda: 7814037168s >> Sector size (logical/physical): 512B/512B >> Partition Table: gpt >> >> Number Start End Size File system Name Flags >> 1 34s 2047s 2014s primary bios_grub >> 2 2048s 2099199s 2097152s primary raid >> 3 2099200s 102764543s 100665344s primary raid >> 4 102764544s 7814037134s 7711272591s primary >> >> (parted) >> >> ======================================= >> >> parted reports what /dev/sda4 partition has size of 7711272591s >> but this is not true, partition size is 7711272590s: >> >> 7814037168 - 2014 - 2097152 - 100665344 - 34 - 34 == 7711272590 > > You are off by 1. start and end are inclusive so the size of sda4 is: > > 1 + (7814037134 - 102764544) = 7711272591 > yes, you are right, sorry. 7814037168 - 2014 - 2097152 - 100665344 - 33 - 33 -1 == 7711272591 2014s, 2097152s, 100665344s and 7711272591s is size of partitions, 1s size of MBR and 33s + 33s is size of two copies of GPT. 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. 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. if use common scheme as in java - start index inclusive and end index exclusive, - disk partitioning will be very easy and obvious: parted -s /dev/sda mkpart primary 34s 1MiB parted -s /dev/sda mkpart primary 1MiB 1025MiB parted -s /dev/sda mkpart primary 1025MiB 50178MiB parted -s /dev/sda mkpart primary 50178MiB -- -34s 1-MiB alignment boundary recommended for all GPT partitions except bios_grub one, which contains core.img for read-only access: https://en.wikipedia.org/wiki/BIOS_boot_partition -- Best regards, Gena From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 02 14:03:22 2015 Received: (at 20909-done) by debbugs.gnu.org; 2 Jul 2015 18:03:23 +0000 Received: from localhost ([127.0.0.1]:37922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAipW-0001MI-3X for submit@debbugs.gnu.org; Thu, 02 Jul 2015 14:03:22 -0400 Received: from mail-yk0-f170.google.com ([209.85.160.170]:36563) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAipT-0001M3-Es for 20909-done@debbugs.gnu.org; Thu, 02 Jul 2015 14:03:20 -0400 Received: by ykdr198 with SMTP id r198so75261994ykd.3 for <20909-done@debbugs.gnu.org>; Thu, 02 Jul 2015 11:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=g2KbGN2WLNwlEMlcmWJQf6UCzG31OoB50xDkKSv1M9o=; b=e7+HJU/ubmAKdRi/RGf98LncAci5Ky2Tb6CApc2Mr1U5m1dWj6+L8147Du09+Xmz/N uu8jq6mO8iHrR+585OIvYUo+saT5eix5Z4/lkqJE91qcBGK0tbKditUxtiT636uRm6Cu kjL4r7GR/SmuM0Ip237hqtTkfuUWHsJcAUHqZPfZinucBGwYy1WbdmoR7m7qz92wFmCN 55PkiqtiyR/6mHQ0mXZ7z75sypbF6MwWYC7ZNWYYqvda0B+Y3l7Xt33qLHv6j+si14+b L8kT6C/xLQk2aWjKzDcVP6G9qd7D8rrkhrrqz2Twm1lvlshL20zYRAWTAy12jrCl3Z+6 3AuA== X-Received: by 10.170.128.16 with SMTP id u16mr39631108ykb.49.1435860193723; Thu, 02 Jul 2015 11:03:13 -0700 (PDT) Received: from [10.1.1.233] (fl-67-77-88-12.sta.embarqhsd.net. [67.77.88.12]) by mx.google.com with ESMTPSA id f2sm6280264ywf.5.2015.07.02.11.03.13 for <20909-done@debbugs.gnu.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jul 2015 11:03:13 -0700 (PDT) Message-ID: <55957CA6.7000201@ubuntu.com> Date: Thu, 02 Jul 2015 14:02:14 -0400 From: Phil Susi User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: 20909-done@debbugs.gnu.org Subject: Re: bug#20909: incorrect partition size calculation References: <558E0817.8050200@csdoc.com> <20150629174336.GK3170@lister.brianlane.com> <5591906E.6040302@csdoc.com> In-Reply-To: <5591906E.6040302@csdoc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20909-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 6/29/2015 2:37 PM, Gena Makhomed wrote: >> You are off by 1. start and end are inclusive so the size of sda4 is: >> >> 1 + (7814037134 - 102764544) = 7711272591 >> Closing for this reason. > 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. > 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. From unknown Sat Aug 16 21:12:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 31 Jul 2015 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator