1
0

pkgs/grow-last-partition-and-filesystem: Automatically move GPT backup header to end of device

This commit is contained in:
2025-09-21 14:36:04 +02:00
parent 539502cea0
commit 6954e75a5c
2 changed files with 4 additions and 0 deletions

View File

@@ -11,6 +11,9 @@ fi
DEVICE="$1"
echo "Move GTP backup header to end of disk"
sgdisk "${DEVICE}" --move-second-header
PARTITIONDATA="$(parted --script --json --fix "${DEVICE}" print)"
PARTNUMBER="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .number')"
PARTNAME="$(echo "${PARTITIONDATA}" | jq -r '.disk.partitions | last | .name')"