pkgs/grow-last-partition-and-filesystem: Automatically move GPT backup header to end of device
This commit is contained in:
@@ -10,6 +10,7 @@ writeShellApplication {
|
||||
text = builtins.readFile ./grow-last-partition-and-filesystem.sh;
|
||||
runtimeInputs = [
|
||||
e2fsprogs
|
||||
gptfdisk
|
||||
jq
|
||||
parted
|
||||
];
|
||||
|
@@ -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')"
|
||||
|
Reference in New Issue
Block a user