HomeFreeBSD

Check for minimum partition size

Description

Check for minimum partition size

On Linux block devices used for vdevs will by partitioned. The block
device must be large enough for an 64M partition starting at offset
of 2048 sectors (part1), and a second 64M reserved partition at the
end of the device (part9).

This commit adds a capacity check when creating the GPT label to
immediately detect a device which is too small. With the existing
code this would be caught slightly latter when attempting to use
the partition. Catching it sooner let's us print a more useful error.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15898

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Feb 16 2024, 5:07 PM
Tony Hutter <hutter2@llnl.gov>Committed on Apr 29 2024, 8:50 PM
Parents
rG5dda8c091026: Add VERIFY0P() and ASSERT0P() macros.
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rG9f1d3db73035: Check for minimum partition size (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Apr 29 2024, 8:50 PM