mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Reserving 8 GiB headroom between ISO and persistence partitions.
The persistence partition is created immediately after the ISO partition ends (1-MiB aligned). When `wrolpi-usb.sh upgrade` overwrites the ISO partition with a future, possibly-larger ISO, growth past the current ISO size would overwrite persistence-partition sectors. Reserve 8 GiB between them on first boot. Future ISO releases up to roughly 2x the current size (~3.3 GB) can be written into that gap without touching persistence. The cost is ~8 GiB of persistence the user can't reclaim. On a typical 128 GB USB this is ~6% of total capacity, which is comparable to filesystem overhead and rounding loss. Existing USBs flashed before this commit have no headroom — they need a one-time backup-and-reflash to pick it up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
76f28ae86a
commit
7310f3eb80
1 changed files with 9 additions and 1 deletions
|
|
@ -86,7 +86,15 @@ if [ -n "$BOOT_DRIVE" ]; then
|
|||
log "ERROR: failed to compute LAST_END from $BOOT_DRIVE partition table"
|
||||
exit 1
|
||||
fi
|
||||
START=$(( ((LAST_END + 2047) / 2048) * 2048 ))
|
||||
# Reserve 8 GiB of unused space between the ISO partition and the new
|
||||
# persistence partition. The `wrolpi-usb.sh upgrade` tool overwrites
|
||||
# the ISO partition with a (potentially larger) new ISO; without
|
||||
# headroom, growth past the current ISO size would clobber the
|
||||
# persistence partition's data. 8 GiB covers ~2x the current ISO
|
||||
# size — enough for several future releases. Cost: ~8 GiB of
|
||||
# persistence space the user doesn't see.
|
||||
HEADROOM_SECTORS=$(( 8 * 1024 * 1024 * 1024 / 512 ))
|
||||
START=$(( (((LAST_END + HEADROOM_SECTORS) + 2047) / 2048) * 2048 ))
|
||||
# --no-reread --force: required because the live medium is mounted from
|
||||
# this same drive. Adding a new partition entry past the mounted one
|
||||
# is safe; we use partx -a below to inform the running kernel without
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue