Skip to content

Commit

Permalink
fix init partition being too small to contain all necessary data
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Feb 13, 2025
1 parent 3245956 commit ddbf978
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vanilla_installer/defaults/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class PartitionSelector(Adw.PreferencesPage):
},
"root_part_expand": {
"mountpoint": "/",
"min_size": 22_011_707_392, # 20.5 GB
"min_size": 22_523_707_392, # 20.5 GB
"partition": None,
"fstype": None,
},
Expand Down
12 changes: 6 additions & 6 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, 23656]])
setup_steps.append([disk, "mkpart", ["vos-var", "none", 23656, -1]])
setup_steps.append([disk, "mkpart", ["vos-root", "none", 1537, 24168]])
setup_steps.append([disk, "mkpart", ["vos-var", "none", 24168, -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 All @@ -245,7 +245,7 @@ def __gen_auto_partition_steps(
setup_steps.append([disk, "vgcreate", ["vos-var", [part_prefix + "4"]]])

# Init files LV
setup_steps.append([disk, "lvcreate", ["init", "vos-root", "linear", 512]])
setup_steps.append([disk, "lvcreate", ["init", "vos-root", "linear", 1024]])
setup_steps.append([disk, "lvm-format", ["vos-root/init", "ext4", "vos-init"]])

# LVM root thin pool
Expand Down Expand Up @@ -353,19 +353,19 @@ def setup_partition(
setup_steps.append([part_disk, "pvcreate", [part]])
setup_steps.append([part_disk, "vgcreate", ["vos-root", [part]]])
setup_steps.append(
[part_disk, "lvcreate", ["init", "vos-root", "linear", 512]]
[part_disk, "lvcreate", ["init", "vos-root", "linear", 1024]]
)
setup_steps.append(
[part_disk, "lvm-format", ["vos-root/init", "ext4", "vos-init"]]
)

# LVM root thin pool
# Total pool size is the disk size, subtracted by:
# - 512 MiB from the init LV
# - 1024 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)
# - 100 MiB to account for various alignment issues
thin_size = (values["size"] / 1_048_576) - 1024 - 512 - 1028 - 100
thin_size = (values["size"] / 1_048_576) - 1024 - 1024 - 1028 - 100
setup_steps.append(
[part_disk, "lvcreate", ["root-meta", "vos-root", "linear", 1024]]
)
Expand Down

0 comments on commit ddbf978

Please sign in to comment.