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.