Subject: bug#17108: [PATCH 1/4] libparted: Check AlternateLBA against LBA-1

From: "Brian C. Lane" <[email-masked]>
Date: Thu, 27 Mar 2014 16:10:11 -0700

On Thu, Mar 27, 2014 at 12:55:31PM -0400, Phillip Susi wrote:
> Parted is correct here: the backup *is* in the wrong place, since it
> is at the end of where *we* think the disk is rather than where the
> header thinks it is.  I changed the code to be this way in the first
> place so that this complaint would not be triggered by growing a disk,
> leaving both the LastUableLba and backup locations unchanged.

I think we should remove the second prompt and only check for header at
end of disk. When we fix the header location we should also be adjusting
LastUsableLBA based on the disk size anyway.

Also note that the existing calculations for the backup partition table
entries are relative to AlternateLBA, not LastUsableLBA. In practice
when parted operates on things there is no difference, but according to
the comments in t0210 others may not do the same thing and there is
nothing in the UEFI spec that guarantees that the PTE will start at
LastUsableLBA+1 -- that's why the header has a pointer to the start of
the PTE instead of just calculating it.

In summary:
 * I am pretty confident that my patches are correct
 * We may need additional changes to remove the 'do you want to grow'
   prompt. I think we probably do.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)