Page MenuHomeFreeBSD

gpart: Be less picky about GPT Tables in some cases
ClosedPublic

Authored by imp on Oct 24 2023, 11:13 PM.
Tags
None
Referenced Files
F102010969: D42359.id.diff
Wed, Nov 6, 12:44 PM
Unknown Object (File)
Mon, Nov 4, 8:44 PM
Unknown Object (File)
Sat, Oct 12, 2:36 PM
Unknown Object (File)
Sat, Oct 12, 2:36 PM
Unknown Object (File)
Sat, Oct 12, 12:37 PM
Unknown Object (File)
Oct 1 2024, 8:43 PM
Unknown Object (File)
Oct 1 2024, 7:05 PM
Unknown Object (File)
Oct 1 2024, 2:51 PM
Subscribers
None

Details

Summary

When we're recoverying a damangae GPT, or when we're restoring a backed
up partition tables, don't enforce the 4k alignment for start/end LBAs.
This is useful for 512e/4kn drives when we're creating a new partition
table or partition. However, when we're trying to fix / restore an old
partition, we shouldn't force this alignment, since in that case it's
more important to use the partition table as is than to optimize
performance by rounding (which isn't required by the standard).

Sponsored by: Netflix

Test Plan

This requires a newer mkimg.
We should also not enforce 128 as the minimum number of partitions, but that's quite a bit harder to do correctly.
It's a lot easier to not do the 512e/4kn optimization, which will fix gpart restore (and gpart recover) for newer mkimg images.

We should do the optimization when making a brand-new partition scheme / partition. However, we shouldn't when restoring / fixing an existing drive, since the data is at fixed offsets that we can't really affect. We already allow it on read, and this just extends that to scenarios where we're effectively dealing with extant partitions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable