From: Ignaz Forster Date: Tue, 22 Aug 2023 16:13:07 +0200 Subject: [PATCH] Move GTP header to the end on resized disk images Fedora CoreOS is handling the GPT move by putting flags into the disk's GUID (see also [gh#coreos/ignition#839]) and then adjusting the root disk in https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-gpt-setup.sh. We are not using the CoreOS Assembler and have no reason to change the UUID, so introducing a dracut service just to possibly move the GPT seems like overkill. Just do so when creating new partitions. --- internal/sgdisk/sgdisk.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/sgdisk/sgdisk.go b/internal/sgdisk/sgdisk.go index 29915809..9be5a9e6 100644 --- a/internal/sgdisk/sgdisk.go +++ b/internal/sgdisk/sgdisk.go @@ -138,6 +138,7 @@ func (op Operation) buildOptions() []string { } for _, p := range op.parts { + opts = append(opts, "--move-second-header") opts = append(opts, fmt.Sprintf("--new=%d:%s:+%s", p.Number, partitionGetStart(p), partitionGetSize(p))) if p.Label != nil { opts = append(opts, fmt.Sprintf("--change-name=%d:%s", p.Number, *p.Label)) -- 2.41.0