diff --git a/pkgs/grow-last-partition-and-filesystem/default.nix b/pkgs/grow-last-partition-and-filesystem/default.nix index 06dac05..2ae2144 100644 --- a/pkgs/grow-last-partition-and-filesystem/default.nix +++ b/pkgs/grow-last-partition-and-filesystem/default.nix @@ -10,6 +10,7 @@ writeShellApplication { text = builtins.readFile ./grow-last-partition-and-filesystem.sh; runtimeInputs = [ e2fsprogs + gptfdisk jq parted ]; diff --git a/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh b/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh index 864b035..54847c8 100755 --- a/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh +++ b/pkgs/grow-last-partition-and-filesystem/grow-last-partition-and-filesystem.sh @@ -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')"