Skip to content

Commit

Permalink
changes the partition sizes
Browse files Browse the repository at this point in the history
LVM would sometimes be missing space due to alignment taking up extra space.
  • Loading branch information
taukakao committed Nov 21, 2024
1 parent bbc9e4d commit 72ff33e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vanilla_installer/utils/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def __gen_auto_partition_steps(
setup_steps.append([disk, "setflag", ["2", "esp", True]])

# LVM PVs
setup_steps.append([disk, "mkpart", ["vos-root", "none", 1537, 23556]])
setup_steps.append([disk, "mkpart", ["vos-var", "none", 23556, -1]])
setup_steps.append([disk, "mkpart", ["vos-root", "none", 1537, 23656]])
setup_steps.append([disk, "mkpart", ["vos-var", "none", 23656, -1]])
part_prefix = f"{disk}p" if re.match(r"[0-9]", disk[-1]) else f"{disk}"
setup_steps.append([disk, "pvcreate", [part_prefix + "3"]])
setup_steps.append([disk, "pvcreate", [part_prefix + "4"]])
Expand Down Expand Up @@ -361,7 +361,8 @@ def setup_partition(
# - 512 MiB from the init LV
# - 1024 MiB from the metadata LV
# - 1028 MiB from LVM's internals (4 MiB header and 1024 MiB for thin)
thin_size = (values["size"] / 1_048_576) - 1024 - 512 - 1028
# - 100 MiB to account for various alignment issues
thin_size = (values["size"] / 1_048_576) - 1024 - 512 - 1028 - 100
setup_steps.append(
[part_disk, "lvcreate", ["root-meta", "vos-root", "linear", 1024]]
)
Expand Down

0 comments on commit 72ff33e

Please sign in to comment.