GNU bug report logs - #18329
mkpart clearing GPT attributes

Previous Next

Package: parted;

Reported by: Scott Sullivan <ssullivan <at> liquidweb.com>

Date: Mon, 25 Aug 2014 18:06:02 UTC

Severity: normal

To reply to this bug, email your comments to 18329 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#18329; Package parted. (Mon, 25 Aug 2014 18:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Scott Sullivan <ssullivan <at> liquidweb.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Mon, 25 Aug 2014 18:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Scott Sullivan <ssullivan <at> liquidweb.com>
To: bug-parted <at> gnu.org
Subject: mkpart clearing GPT attributes
Date: Mon, 25 Aug 2014 13:52:07 -0400
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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# lvcreate -L 10G -n test LVM
  Logical volume "test" created
[root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mklabel gpt
[root <at> 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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 0% 10%
[root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 10% 20%
[root <at> 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 <at> 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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show
2:63:1 (do not automount)
[root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 20% 100%
[root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show
[root <at> 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.




Information forwarded to bug-parted <at> gnu.org:
bug#18329; Package parted. (Tue, 26 Aug 2014 16:51:02 GMT) Full text and rfc822 format available.

Message #8 received at 18329 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Scott Sullivan <ssullivan <at> liquidweb.com>
Cc: 18329 <at> debbugs.gnu.org
Subject: Re: bug#18329: mkpart clearing GPT attributes
Date: Tue, 26 Aug 2014 09:50:19 -0700
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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# lvcreate -L 10G -n test LVM
>   Logical volume "test" created
> [root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mklabel gpt
> [root <at> 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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 0% 10%
> [root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 10% 20%
> [root <at> 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 <at> 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 <at> sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show
> 2:63:1 (do not automount)
> [root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# parted /dev/LVM/test -s mkpart lbah 20% 100%
> [root <at> sta-jenkins-slave-01 /opt/template-automation/distros]# sgdisk /dev/LVM/test --attributes=2:show
> [root <at> 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)




This bug report was last modified 10 years and 297 days ago.

Previous Next


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