Skip to content

Commit

Permalink
simplify root partition size suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-ferrier committed Mar 13, 2024
1 parent 2ad0e90 commit 8910e73
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions archinstall/lib/interactions/disk_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,21 +238,20 @@ def suggest_single_disk_layout(
if not filesystem_type:
filesystem_type = select_main_filesystem_format(advanced_options)

total_size_value = device.device_info.total_size.value
total_size_unit = device.device_info.total_size.unit

# root partition size processing
root_partition_size_gib = 20
if total_size_unit == disk.Unit.GiB:
if 51 > total_size_value // 10 > 19:
root_partition_size_gib = total_size_value // 10
elif total_size_unit == disk.Unit.TiB:
# maximum part size
total_device_size = device.device_info.total_size.convert(disk.Unit.GiB)
if total_device_size.value > 500:
# maximum size
root_partition_size_gib = 50
elif total_device_size.value < 100:
# minimum size
root_partition_size_gib = 20
else:
# 10% of total size
root_partition_size_gib = total_device_size.value // 10

sector_size = device.device_info.sector_size
min_size_to_allow_home_part = disk.Size(40, disk.Unit.GiB, sector_size)

root_partition_size = disk.Size(root_partition_size_gib, disk.Unit.GiB, sector_size)
using_subvolumes = False
using_home_partition = False
Expand Down

0 comments on commit 8910e73

Please sign in to comment.