[parted-devel] [PATCH 0/4] Backup GPT Header Handling

Brian C. Lane bcl at redhat.com
Sat Mar 29 03:46:15 UTC 2014


Here's a different approach, just drop the prompt to fix the backup gpt header.

The headers were both valid (crc matches, etc.) so only the location may be
wrong. If it is the _parse_header check will catch that there is extra space
and offer to fix it. When it does fix it it writes it to LBA-1 (which was my
primary reason for going to all this trouble) and fixes the LastUsableLBA.

The gpt-header-move.py was not doing a very good job moving the header, it
didn't update the LastUsableLBA which resulted in it overlapping. We don't
actually test for this (yet) so I fixed it to do a proper move and update.

For future discussion we ought to add a check to _parse_header that makes sure
MyLBA and AlternateLBA fall outside the range of FirstUsableLBA and
LastUsableLBA -- I'm not sure what the correct behavior is in that case though.

Also, I'm going to use parted-devel at lists.alioth.debian.org for patches and
discussions -- the bugs list makes a mess of things and we don't need to feed
all of our discussions into a bug tracker.

Brian C. Lane (4):
  libparted: Remove the prompt to fix the backup GPT header.
  tests: Update tests for new behavior
  tests: Add emit_superuser_warning for gpt tests
  tests: Use msdos-overlap to setup t0283

 libparted/labels/gpt.c                           | 27 ++------------
 tests/gpt-header-move.py                         |  6 +++-
 tests/msdos-overlap.py                           | 25 +++++++++++++
 tests/t0210-gpt-resized-partition-entry-array.sh | 26 ++++++++++++--
 tests/t0281-gpt-grow.sh                          |  3 +-
 tests/t0282-gpt-move-backup.sh                   |  7 ++--
 tests/t0283-overlap-partitions.sh                | 46 ++++--------------------
 7 files changed, 68 insertions(+), 72 deletions(-)
 create mode 100755 tests/msdos-overlap.py

-- 
1.8.5.3




More information about the parted-devel mailing list