Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion archinstall/lib/disk/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import math
import time
from pathlib import Path

Expand Down Expand Up @@ -195,7 +196,15 @@ def _setup_lvm(
desired_size = sum([vol.length for vol in vg.volumes], Size(0, Unit.B, SectorSize.default()))

delta = desired_size - avail_size
max_vol_offset = delta.convert(Unit.B)
delta_bytes = delta.convert(Unit.B)

# Round the offset up to the next physical extent (PE, 4 MiB by default)
# to ensure lvcreate`s internal rounding doesn`t consume space reserved
# for subsequent logical volumes.
pe_bytes = Size(4, Unit.MiB, SectorSize.default()).convert(Unit.B)
pe_count = math.ceil(delta_bytes.value / pe_bytes.value)
rounded_offset = pe_count * pe_bytes.value
max_vol_offset = Size(rounded_offset, Unit.B, SectorSize.default())

max_vol = max(vg.volumes, key=lambda x: x.length)

Expand Down