0.5.1-pre1, with new code to enable moving the backup GPT data
structures, for the benefit of those who add disks to a RAID array.
diff --git a/gpt.cc b/gpt.cc
index 5885486..3a98037 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -900,7 +900,7 @@
printf("The operation has completed successfully.\n");
} else {
printf("Warning! An error was reported when writing the backup file.\n");
- printf("It may not be useable!\n");
+ printf("It may not be usable!\n");
} // if/else
close(fd);
@@ -1817,6 +1817,14 @@
return (goOn);
} // GPTData::ClearGPTData()
+// Set the location of the second GPT header data to the correct location.
+// Intended to help users of RAID arrays that have been resized.
+void GPTData::FixSecondHeaderLocation() {
+ mainHeader.backupLBA = secondHeader.currentLBA = diskSize - UINT64_C(1);
+ mainHeader.lastUsableLBA = secondHeader.lastUsableLBA = diskSize - mainHeader.firstUsableLBA;
+ secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1);
+} // GPTData::FixSecondHeaderLocation()
+
void GPTData::SetName(uint32_t partNum, char* theName) {
if ((partNum >= 0) && (partNum < mainHeader.numParts))
if (partitions[partNum].GetFirstLBA() > 0)