GNU bug report logs - #18329
mkpart clearing GPT attributes

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: Scott Sullivan <ssullivan@HIDDEN>; dated Mon, 25 Aug 2014 18:06:02 UTC; Maintainer for parted is bug-parted@HIDDEN.

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


Received: (at 18329) by debbugs.gnu.org; 26 Aug 2014 16:50:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 26 12:50:28 2014
Received: from localhost ([127.0.0.1]:52688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XMJwx-0001WZ-VJ
	for submit <at> 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 <bcl@HIDDEN>) id 1XMJwt-0001WI-Dj
 for 18329 <at> 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" <bcl@HIDDEN>
To: Scott Sullivan <ssullivan@HIDDEN>
Subject: Re: bug#18329: mkpart clearing GPT attributes
Message-ID: <20140826165019.GB2635@HIDDEN>
References: <53FB77C7.7050506@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <53FB77C7.7050506@HIDDEN>
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-Debbugs-Envelope-To: 18329
Cc: 18329 <at> debbugs.gnu.org
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: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://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: -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)




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

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


Received: (at submit) by debbugs.gnu.org; 25 Aug 2014 18:05:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 25 14:05:49 2014
Received: from localhost ([127.0.0.1]:51948 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XLyeG-0006Fn-Hn
	for submit <at> 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 <ssullivan@HIDDEN>) id 1XLyRd-0005ot-Uu
 for submit <at> 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 <ssullivan@HIDDEN>) id 1XLyRP-0008Ni-GJ
 for submit <at> 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 <ssullivan@HIDDEN>) id 1XLyRP-0008Nd-DF
 for submit <at> 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 <ssullivan@HIDDEN>) id 1XLyRJ-0006im-0l
 for bug-parted@HIDDEN; Mon, 25 Aug 2014 13:52:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ssullivan@HIDDEN>) id 1XLyRC-0008KW-QV
 for bug-parted@HIDDEN; 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 <ssullivan@HIDDEN>) id 1XLyRC-0008Jl-MP
 for bug-parted@HIDDEN; 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 <bug-parted@HIDDEN>; Mon, 25 Aug 2014 13:52:27 -0400 (EDT)
Message-ID: <53FB77C7.7050506@HIDDEN>
Date: Mon, 25 Aug 2014 13:52:07 -0400
From: Scott Sullivan <ssullivan@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:24.0) Gecko/20100101 Icedove/24.7.0
MIME-Version: 1.0
To: bug-parted@HIDDEN
Subject: mkpart clearing GPT attributes
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-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 25 Aug 2014 14:05:42 -0400
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: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://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: -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.




Acknowledgement sent to Scott Sullivan <ssullivan@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#18329; 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.