From unknown Mon Jun 23 04:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21136: incorrect partition size calculation Resent-From: Gena Makhomed Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Sun, 26 Jul 2015 17:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21136 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 21136@debbugs.gnu.org X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143793010411793 (code B ref -1); Sun, 26 Jul 2015 17:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Jul 2015 17:01:44 +0000 Received: from localhost ([127.0.0.1]:59330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJPJ1-000348-Ri for submit@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 ) id 1ZJPIz-000340-5n for submit@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 ) id 1ZJPIy-0002eO-2D for submit@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 ) id 1ZJPIx-0002eK-V8 for submit@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 ) id 1ZJPIx-0001mD-16 for bug-parted@gnu.org; Sun, 26 Jul 2015 13:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJPIs-0002da-U2 for bug-parted@gnu.org; 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 ) id 1ZJPIs-0002ca-NW for bug-parted@gnu.org; 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 ; Sun, 26 Jul 2015 20:02:27 +0300 (EEST) References: <558E0817.8050200@csdoc.com> <20150629174336.GK3170@lister.brianlane.com> <5591906E.6040302@csdoc.com> <55957CA6.7000201@ubuntu.com> From: Gena Makhomed Message-ID: <55B51273.6090809@csdoc.com> 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@ubuntu.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-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 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 From unknown Mon Jun 23 04:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21136: incorrect partition size calculation Resent-From: Phil Susi Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Fri, 18 Sep 2015 18:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21136 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: Gena Makhomed , 21136@debbugs.gnu.org Received: via spool by 21136-submit@debbugs.gnu.org id=B21136.144260111811166 (code B ref 21136); Fri, 18 Sep 2015 18:32:01 +0000 Received: (at 21136) by debbugs.gnu.org; 18 Sep 2015 18:31:58 +0000 Received: from localhost ([127.0.0.1]:37226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zd0Ry-0002u2-9o for submit@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 ) id 1Zd0Rw-0002tu-N7 for 21136@debbugs.gnu.org; Fri, 18 Sep 2015 14:31:57 -0400 Received: by ykdu9 with SMTP id u9so54439772ykd.2 for <21136@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) References: <558E0817.8050200@csdoc.com> <20150629174336.GK3170@lister.brianlane.com> <5591906E.6040302@csdoc.com> <55957CA6.7000201@ubuntu.com> <55B51273.6090809@csdoc.com> From: Phil Susi Message-ID: <55FC588F.9030402@ubuntu.com> 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@csdoc.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) 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 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. From unknown Mon Jun 23 04:15:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21136: Fwd: Inconsistent behavior creating partitions with 'Xmib' and 'X%' (off-by-1 error?) References: <55B51273.6090809@csdoc.com> In-Reply-To: <55B51273.6090809@csdoc.com> Resent-From: Diederik de Haas Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Sun, 22 Aug 2021 23:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21136 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 21136@debbugs.gnu.org Received: via spool by 21136-submit@debbugs.gnu.org id=B21136.16296756116800 (code B ref 21136); Sun, 22 Aug 2021 23:41:02 +0000 Received: (at 21136) by debbugs.gnu.org; 22 Aug 2021 23:40:11 +0000 Received: from localhost ([127.0.0.1]:40015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHx4U-0001lV-Fa for submit@debbugs.gnu.org; Sun, 22 Aug 2021 19:40:11 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:42521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHsNo-0007AG-7w for 21136@debbugs.gnu.org; Sun, 22 Aug 2021 14:39:49 -0400 Received: from bagend.localnet (86-126-20-31.ftth.glasoperator.nl [31.20.126.86]) (Authenticated sender: didi.debian@cknow.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id AA087100004 for <21136@debbugs.gnu.org>; Sun, 22 Aug 2021 18:39:41 +0000 (UTC) From: Diederik de Haas Date: Sun, 22 Aug 2021 20:39:40 +0200 Message-ID: <3683537.3MUJHtE5cs@bagend> Organization: Connecting Knowledge MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3290451.ZLsnD45Bv9"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Mailman-Approved-At: Sun, 22 Aug 2021 19:40:08 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.7 (-) --nextPart3290451.ZLsnD45Bv9 Content-Type: multipart/mixed; boundary="nextPart2174835.V8gTvE2t98"; protected-headers="v1" Content-Transfer-Encoding: 7Bit From: Diederik de Haas To: 21136@debbugs.gnu.org Subject: Fwd: Inconsistent behavior creating partitions with 'Xmib' and 'X%' (off-by-1 error?) Date: Sun, 22 Aug 2021 20:39:40 +0200 Message-ID: <3683537.3MUJHtE5cs@bagend> Organization: Connecting Knowledge This is a multi-part message in MIME format. --nextPart2174835.V8gTvE2t98 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" I send the msg below to the bug-parted@gnu.org list, but I'm not sure it arrived. https://lists.gnu.org/archive/html/bug-parted/ are refreshed every 15 minutes, but after > 30 minutes, it hadn't shown up. Then I searched the bug-parted archive and found bug #21136 which seems VERY related to my issue. Sorry for not searching first. I made a copy of the 'parted-bug-test-mb.sh' script and replaced 'mib' with 'MiB' and that went better, although it too failed to create the 4th partition, but that's likely due to qemu's 100M != 100MiB according to parted. So it seems like the bug is still present in 3.4. ---------- Forwarded Message ---------- Subject: Inconsistent behavior creating partitions with 'Xmib' and 'X%' (off- by-1 error?) Date: zondag 22 augustus 2021, 19:59:06 CEST From: Diederik de Haas To: bug-parted@gnu.org [I'm not sure this is the appropriate place/way and if not, apologies, and can you point me to the right place/way] Hi, This is a forward of https://bugs.debian.org/988146 where I reported that partitions were created differently when using 'mib' unit vs '%' unit. To demonstrate it, I created 3 scripts which creates a 100MB image and do the partitioning within that. When reporting the Debian bug, I only had the mixed test and 'parted-bug-test- mixed.sh' is identical to the one attached here, apart from an 'else' clause which explicitly deletes a prior created image. In parted-bug-test-mixed.sh, I mixed 'mib' and '%' and due to the 100MB, that should've worked, but it did not. When using only 'mib' then the script fails too. When using only '%' then the script succeeds. I think parted does the right thing when using '%'. Relevant portion of output when running the mixed script: ======================================================= Creating partition table ... Done Creating 1st partition ('4mib' '20%') ... Done Creating 2nd partition ('20%' '40%' ... Done Creating 3rd partition ('40mib' '60mib') ... Done Showing partition layout Disk temp/parted-test.img: 100 MiB, 104857600 bytes, 204800 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: 0x03f77810 Device Boot Start End Sectors Size Id Type temp/parted-test.img1 8192 40959 32768 16M c W95 FAT32 (LBA) temp/parted-test.img2 40960 81919 40960 20M 83 Linux temp/parted-test.img3 81920 122880 40961 20M 83 Linux Creating 4th partition ('60mib' '100%' ... Error: You requested a partition from 62,9MB to 105MB (sectors 122880..204799). The closest location we can manage is 62,9MB to 105MB (sectors 122881..204799). ======================================================= Cheers, Diederik ----------------------------------------- --nextPart2174835.V8gTvE2t98 Content-Disposition: attachment; filename="parted-bug-test-mb.sh" Content-Transfer-Encoding: 7Bit Content-Type: application/x-shellscript; name="parted-bug-test-mb.sh" #!/bin/sh BUILD_DIR="temp" IMAGE_NAME="parted-test-mb.img" IMAGE_PATH="$BUILD_DIR/$IMAGE_NAME" IMAGE_SIZE="100M" echo "BUILD_DIR: $BUILD_DIR" echo "IMAGE_NAME: $IMAGE_NAME" echo "IMAGE_PATH: $IMAGE_PATH" echo "IMAGE_SIZE: $IMAGE_SIZE" if [ ! -d "$BUILD_DIR" ] ; then echo "directory $BUILD_DIR doesn't exist; create it" mkdir $BUILD_DIR else if [ -f "$IMAGE_PATH" ] ; then echo "Removing previous image" rm "$IMAGE_PATH" fi fi echo "Creating image at '$IMAGE_PATH' of size '$IMAGE_SIZE'" qemu-img create -f raw "$IMAGE_PATH" "$IMAGE_SIZE" echo "Image file created" echo -n "Creating partition table ... " /sbin/parted -s $IMAGE_PATH mklabel msdos echo "Done" echo -n "Creating 1st partition ('4mib' '20mib') ... " /sbin/parted -s $IMAGE_PATH mkpart primary fat32 '4mib' '20mib' echo "Done" echo -n "Creating 2nd partition ('20mib' '40mib' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '20mib' '40mib' echo "Done" echo -n "Creating 3rd partition ('40mib' '60mib') ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '40mib' '60mib' echo "Done" echo "" echo "Showing partition layout" /sbin/fdisk -l $IMAGE_PATH echo "" echo -n "Creating 4th partition ('60mib' '100mib' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '60mib' '100mib' echo "Done" --nextPart2174835.V8gTvE2t98 Content-Disposition: attachment; filename="parted-bug-test-perc.sh" Content-Transfer-Encoding: 7Bit Content-Type: application/x-shellscript; name="parted-bug-test-perc.sh" #!/bin/sh BUILD_DIR="temp" IMAGE_NAME="parted-test-perc.img" IMAGE_PATH="$BUILD_DIR/$IMAGE_NAME" IMAGE_SIZE="100M" echo "BUILD_DIR: $BUILD_DIR" echo "IMAGE_NAME: $IMAGE_NAME" echo "IMAGE_PATH: $IMAGE_PATH" echo "IMAGE_SIZE: $IMAGE_SIZE" if [ ! -d "$BUILD_DIR" ] ; then echo "directory $BUILD_DIR doesn't exist; create it" mkdir $BUILD_DIR else if [ -f "$IMAGE_PATH" ] ; then echo "Removing previous image" rm "$IMAGE_PATH" fi fi echo "Creating image at '$IMAGE_PATH' of size '$IMAGE_SIZE'" qemu-img create -f raw "$IMAGE_PATH" "$IMAGE_SIZE" echo "Image file created" echo -n "Creating partition table ... " /sbin/parted -s $IMAGE_PATH mklabel msdos echo "Done" echo -n "Creating 1st partition ('4%' '20%') ... " /sbin/parted -s $IMAGE_PATH mkpart primary fat32 '4%' '20%' echo "Done" echo -n "Creating 2nd partition ('20%' '40%' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '20%' '40%' echo "Done" echo -n "Creating 3rd partition ('40%' '60%') ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '40%' '60%' echo "Done" echo "" echo "Showing partition layout" /sbin/fdisk -l $IMAGE_PATH echo "" echo -n "Creating 4th partition ('60%' '100%' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '60%' '100%' echo "Done" --nextPart2174835.V8gTvE2t98 Content-Disposition: attachment; filename="parted-bug-test-mixed.sh" Content-Transfer-Encoding: 7Bit Content-Type: application/x-shellscript; name="parted-bug-test-mixed.sh" #!/bin/sh BUILD_DIR="temp" IMAGE_NAME="parted-test-mixed.img" IMAGE_PATH="$BUILD_DIR/$IMAGE_NAME" IMAGE_SIZE="100M" echo "BUILD_DIR: $BUILD_DIR" echo "IMAGE_NAME: $IMAGE_NAME" echo "IMAGE_PATH: $IMAGE_PATH" echo "IMAGE_SIZE: $IMAGE_SIZE" if [ ! -d "$BUILD_DIR" ] ; then echo "directory $BUILD_DIR doesn't exist; create it" mkdir $BUILD_DIR else if [ -f "$IMAGE_PATH" ] ; then echo "Removing previous image" rm "$IMAGE_PATH" fi fi echo "Creating image at '$IMAGE_PATH' of size '$IMAGE_SIZE'" qemu-img create -f raw "$IMAGE_PATH" "$IMAGE_SIZE" echo "Image file created" echo -n "Creating partition table ... " /sbin/parted -s $IMAGE_PATH mklabel msdos echo "Done" echo -n "Creating 1st partition ('4mib' '20%') ... " /sbin/parted -s $IMAGE_PATH mkpart primary fat32 '4mib' '20%' echo "Done" echo -n "Creating 2nd partition ('20%' '40%' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '20%' '40%' echo "Done" echo -n "Creating 3rd partition ('40mib' '60mib') ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '40mib' '60mib' echo "Done" echo "" echo "Showing partition layout" /sbin/fdisk -l $IMAGE_PATH echo "" echo -n "Creating 4th partition ('60mib' '100%' ... " /sbin/parted -s $IMAGE_PATH mkpart primary ext4 '60mib' '100%' echo "Done" --nextPart2174835.V8gTvE2t98-- --nextPart3290451.ZLsnD45Bv9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQT1sUPBYsyGmi4usy/XblvOeH7bbgUCYSKZ7AAKCRDXblvOeH7b bphdAQDBjMcnHv4iyntrMMTqzOcLkfraHxb/hFFBChFoTyGTJQD+L+Y7JnV0Td5h pj/AJhN6EWeayanWbDEWoEPYsX1a6gg= =TC0Y -----END PGP SIGNATURE----- --nextPart3290451.ZLsnD45Bv9-- From unknown Mon Jun 23 04:15:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Gena Makhomed Subject: bug#21136: closed (Re: bug#21136: Fwd: Inconsistent behavior creating partitions with 'Xmib' and 'X%' (off-by-1 error?)) Message-ID: References: <55B51273.6090809@csdoc.com> X-Gnu-PR-Message: they-closed 21136 X-Gnu-PR-Package: parted Reply-To: 21136@debbugs.gnu.org Date: Thu, 26 Aug 2021 21:34:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1630013641-4739-1" This is a multi-part message in MIME format... ------------=_1630013641-4739-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21136: incorrect partition size calculation which was filed against the parted package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21136@debbugs.gnu.org. --=20 21136: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21136 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1630013641-4739-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21136-close) by debbugs.gnu.org; 26 Aug 2021 21:33:30 +0000 Received: from localhost ([127.0.0.1]:50651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJN06-0001Di-Lj for submit@debbugs.gnu.org; Thu, 26 Aug 2021 17:33:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJN04-0001DZ-5m for 21136-close@debbugs.gnu.org; Thu, 26 Aug 2021 17:33:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630013607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hNUuzS8j5wSpugXQyAyVn/eacI/8KDWHiBgZGux4cJw=; b=W7xaUkz9Ew/wZ/pOQyVGRi/LQRk8E7Gg/JMmv+o3JNOBWnEK7zbqhwByMxpSEx/1LCMN75 GfGmXWjJNQCK+5MFPuarXCKa7Oz7ctuNU8ex2J0/DRfAJTPJr3bjqw/9hkd3D/S/ea5yUp wfMZeRGW9/qgltI3H1Nt0FyLMq37MdA= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-Nrqzjx8bO6S7kBcZjUTjtA-1; Thu, 26 Aug 2021 17:33:25 -0400 X-MC-Unique: Nrqzjx8bO6S7kBcZjUTjtA-1 Received: by mail-pl1-f199.google.com with SMTP id u6-20020a170902bf46b029012c971d6226so1476339pls.21 for <21136-close@debbugs.gnu.org>; Thu, 26 Aug 2021 14:33:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hNUuzS8j5wSpugXQyAyVn/eacI/8KDWHiBgZGux4cJw=; b=AHw+YReZ6wqzq0UoCx24FSL1S9veCkhthLBJwIAN+s47+PpAWGHcXD67R+0loI2qm8 d18rSbR8cM72Af1ap+Zy0NPWl+DBqnM05cPQPqoQ+QKe+JOVCFZn22ByIb2soyLrdWHL KVIBOP+ZNXhjNu4JhnjESzKLIER3FwR5e5vg9bWAyAbkiR8ZF7K3jjw27HWm1oQTacso 7LvC0J4WCZOd07L0zxw2CI07VQGZpGKNdzlV+MglvYagyJgmNQyHjJatf3oNZ0Nj08n9 jVEn0TarmO0hgJRN+HfpYP+O0aUcZHH0f0Hg4Wf3HRroY+VeMgQRkAX4F3c/49pvsJxI fQ6w== X-Gm-Message-State: AOAM5337gscNd6hfStrHue6BhcUZyJ2gqW7or4+AFlVJif3p6256+NVt seuN1SnUMOzc0Cqhpx2Hnw0T3BkdTNZFsbtMJLLSFb//DzsZQQvvwohwXDj9ZYjypZTer/an1OR 0qpuls/4MddGXYNLUV9+PcTnwvkJqK7IWbNp8iNEp86mWCyT8XwoPYMMjor5Q/teiHDuT X-Received: by 2002:a05:6a00:1147:b029:3e0:8c37:938e with SMTP id b7-20020a056a001147b02903e08c37938emr5631542pfm.65.1630013603766; Thu, 26 Aug 2021 14:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym1OJpDx9RiHChhq9x4fGiW8YdaSr7uIwwJZQrquaFgZwlFYxg3oCt61gCO/t8yedro0mUtQ== X-Received: by 2002:a05:6a00:1147:b029:3e0:8c37:938e with SMTP id b7-20020a056a001147b02903e08c37938emr5631521pfm.65.1630013603304; Thu, 26 Aug 2021 14:33:23 -0700 (PDT) Received: from ohop.brianlane.com ([2601:603:5000:3e9:52e5:49ff:fe52:c5be]) by smtp.gmail.com with ESMTPSA id w2sm3689159pjq.5.2021.08.26.14.33.22 for <21136-close@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 14:33:22 -0700 (PDT) Date: Thu, 26 Aug 2021 14:33:20 -0700 From: "Brian C. Lane" To: 21136-close@debbugs.gnu.org Subject: Re: bug#21136: Fwd: Inconsistent behavior creating partitions with 'Xmib' and 'X%' (off-by-1 error?) Message-ID: References: <55B51273.6090809@csdoc.com> <3683537.3MUJHtE5cs@bagend> MIME-Version: 1.0 In-Reply-To: <3683537.3MUJHtE5cs@bagend> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bcl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21136-close X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.7 (-) -- Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart ------------=_1630013641-4739-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Jul 2015 17:01:44 +0000 Received: from localhost ([127.0.0.1]:59330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJPJ1-000348-Ri for submit@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 ) id 1ZJPIz-000340-5n for submit@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 ) id 1ZJPIy-0002eO-2D for submit@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 ) id 1ZJPIx-0002eK-V8 for submit@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 ) id 1ZJPIx-0001mD-16 for bug-parted@gnu.org; Sun, 26 Jul 2015 13:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJPIs-0002da-U2 for bug-parted@gnu.org; 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 ) id 1ZJPIs-0002ca-NW for bug-parted@gnu.org; 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 ; Sun, 26 Jul 2015 20:02:27 +0300 (EEST) Subject: incorrect partition size calculation To: bug-parted@gnu.org References: <558E0817.8050200@csdoc.com> <20150629174336.GK3170@lister.brianlane.com> <5591906E.6040302@csdoc.com> <55957CA6.7000201@ubuntu.com> From: Gena Makhomed Message-ID: <55B51273.6090809@csdoc.com> 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@ubuntu.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 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 ------------=_1630013641-4739-1--