From 7a5d5ee40e1bad756d81f64a3e42f2988f2d696c Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Fri, 23 Jun 2023 17:22:39 +0100 Subject: [PATCH] make disk->hdr_bak actually be the GPT backup header I do not know who thought this should be a "backup" copy of the primary GPT header... --- gpt-utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpt-utils.cpp b/gpt-utils.cpp index 8405f1e..eb265fd 100644 --- a/gpt-utils.cpp +++ b/gpt-utils.cpp @@ -639,7 +639,8 @@ int gpt_disk_get_disk_info(const char *dev, struct gpt_disk *dsk) gpt_header_size = GET_4_BYTES(disk->hdr + HEADER_SIZE_OFFSET); // FIXME: pointer offsets crc bleh disk->hdr_crc = crc32(0, disk->hdr, gpt_header_size); - disk->hdr_bak = gpt_get_header(dev, PRIMARY_GPT); + + disk->hdr_bak = gpt_get_header(dev, SECONDARY_GPT); if (!disk->hdr_bak) { fprintf(stderr, "%s: Failed to get backup header\n", __func__); goto error;