From unknown Wed Jun 18 23:18:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18329: mkpart clearing GPT attributes Resent-From: Scott Sullivan Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Mon, 25 Aug 2014 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18329 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: 18329@debbugs.gnu.org X-Debbugs-Original-To: bug-parted@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140898994924055 (code B ref -1); Mon, 25 Aug 2014 18:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Aug 2014 18:05:49 +0000 Received: from localhost ([127.0.0.1]:51948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLyeG-0006Fn-Hn for submit@debbugs.gnu.org; Mon, 25 Aug 2014 14:05:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52733) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLyRd-0005ot-Uu for submit@debbugs.gnu.org; Mon, 25 Aug 2014 13:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLyRP-0008Ni-GJ for submit@debbugs.gnu.org; Mon, 25 Aug 2014 13:52:36 -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 ([208.118.235.17]:52968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyRP-0008Nd-DF for submit@debbugs.gnu.org; Mon, 25 Aug 2014 13:52:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyRJ-0006im-0l for bug-parted@gnu.org; Mon, 25 Aug 2014 13:52:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLyRC-0008KW-QV for bug-parted@gnu.org; Mon, 25 Aug 2014 13:52:20 -0400 Received: from email.liquidweb.com ([67.227.164.41]:50295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLyRC-0008Jl-MP for bug-parted@gnu.org; Mon, 25 Aug 2014 13:52:14 -0400 Received: from data.wks.liquidweb.com (data.wks.liquidweb.com [10.30.104.4]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by email.liquidweb.com (Postfix) with ESMTPSA id B29FB600C1 for ; Mon, 25 Aug 2014 13:52:27 -0400 (EDT) Message-ID: <53FB77C7.7050506@liquidweb.com> Date: Mon, 25 Aug 2014 13:52:07 -0400 From: Scott Sullivan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Mon, 25 Aug 2014 14:05:42 -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: -5.0 (-----) Parted version: 3.1.6-e38d-dirty Summary: mkpart appears to be wiping out existing GPT attributes. To reproduce, consider the below example of me reproducing this issue. It doesn't seem like Parted should be clearing out existing GPT attributes for other pre-existing partitions just by creating a new partition with mkpart. [root@sta-jenkins-slave-01 /opt/template-automation/distros]# lvcreate -L 10G -n test LVM Logical volume "test" created [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mklabel gpt [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s p free Model: Linux device-mapper (linear) (dm) Disk /dev/dm-38: 10.7GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 17.4kB 10.7GB 10.7GB Free Space [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 0% 10% [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 10% 20% [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s p free Model: Linux device-mapper (linear) (dm) Disk /dev/dm-38: 10.7GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 17.4kB 1049kB 1031kB Free Space 1 1049kB 1074MB 1073MB lbah 2 1074MB 2147MB 1074MB lbah 2147MB 10.7GB 8590MB Free Space [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk -A 2:set:63 /dev/LVM/test Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. The operation has completed successfully. [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show 2:63:1 (do not automount) [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 20% 100% [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show [root@sta-jenkins-slave-01 /opt/template-automation/distros]# Can someone confirm this isn't expected behavior? I am happy to help with testing, on latest stable (3.2) or latest master if its useful. Our workaround for now is to globally re-apply the GPT attributes after creating all partitions. From unknown Wed Jun 18 23:18:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18329: mkpart clearing GPT attributes Resent-From: "Brian C. Lane" Original-Sender: "Debbugs-submit" Resent-CC: bug-parted@gnu.org Resent-Date: Tue, 26 Aug 2014 16:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18329 X-GNU-PR-Package: parted X-GNU-PR-Keywords: To: Scott Sullivan Cc: 18329@debbugs.gnu.org Received: via spool by 18329-submit@debbugs.gnu.org id=B18329.14090718295869 (code B ref 18329); Tue, 26 Aug 2014 16:51:02 +0000 Received: (at 18329) by debbugs.gnu.org; 26 Aug 2014 16:50:29 +0000 Received: from localhost ([127.0.0.1]:52688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMJwx-0001WZ-VJ for submit@debbugs.gnu.org; Tue, 26 Aug 2014 12:50:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19800) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMJwt-0001WI-Dj for 18329@debbugs.gnu.org; Tue, 26 Aug 2014 12:50:24 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7QGoL0M029272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Aug 2014 12:50:21 -0400 Received: from lister.brianlane.com (ovpn-113-194.phx2.redhat.com [10.3.113.194]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7QGoJeN009142 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 26 Aug 2014 12:50:20 -0400 Date: Tue, 26 Aug 2014 09:50:19 -0700 From: "Brian C. Lane" Message-ID: <20140826165019.GB2635@lister.brianlane.com> References: <53FB77C7.7050506@liquidweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53FB77C7.7050506@liquidweb.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -5.0 (-----) 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 Mon, Aug 25, 2014 at 01:52:07PM -0400, Scott Sullivan wrote: > Parted version: 3.1.6-e38d-dirty > > Summary: mkpart appears to be wiping out existing GPT attributes. > > To reproduce, consider the below example of me reproducing this issue. It doesn't seem like Parted should be clearing out existing GPT attributes for other pre-existing partitions just by creating a new partition with mkpart. > > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# lvcreate -L 10G -n test LVM > Logical volume "test" created > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mklabel gpt > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s p free > Model: Linux device-mapper (linear) (dm) > Disk /dev/dm-38: 10.7GB > Sector size (logical/physical): 512B/512B > Partition Table: gpt > Disk Flags: > > Number Start End Size File system Name Flags > 17.4kB 10.7GB 10.7GB Free Space > > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 0% 10% > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 10% 20% > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s p free > Model: Linux device-mapper (linear) (dm) > Disk /dev/dm-38: 10.7GB > Sector size (logical/physical): 512B/512B > Partition Table: gpt > Disk Flags: > > Number Start End Size File system Name Flags > 17.4kB 1049kB 1031kB Free Space > 1 1049kB 1074MB 1073MB lbah > 2 1074MB 2147MB 1074MB lbah > 2147MB 10.7GB 8590MB Free Space > > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk -A 2:set:63 /dev/LVM/test > Warning: The kernel is still using the old partition table. > The new table will be used at the next reboot. > The operation has completed successfully. > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show > 2:63:1 (do not automount) > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 20% 100% > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show > [root@sta-jenkins-slave-01 /opt/template-automation/distros]# > > > Can someone confirm this isn't expected behavior? I am happy to help with testing, on latest stable (3.2) or latest master if its useful. Our workaround for now is to globally re-apply the GPT attributes after creating all partitions. Sadly, yes, this is how it currently works. I am surprised to see that parted only tracks bit 0 and bit 2. The problem is that when it reads the partition table it only copies the state of the bits it knows about instead of making a copy of all of them. -- Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)