fix(partitioning): avoid alignment errors by using fill-gap logic for full space
This commit is contained in:
@@ -120,10 +120,13 @@ def create_partition(disk_device, size_mb, type_code="8300", name="Linux filesys
|
||||
next_num += 1
|
||||
|
||||
# Use -g (mbrtogpt) to ensure we can work on the disk if it was MBR
|
||||
# size_mb=0 means use all available space in the gap
|
||||
size_spec = f"+{size_mb}M" if size_mb > 0 else "0"
|
||||
|
||||
run_command([
|
||||
"sgdisk",
|
||||
"-g",
|
||||
"-n", f"{next_num}:0:+{size_mb}M",
|
||||
"-n", f"{next_num}:0:{size_spec}",
|
||||
"-t", f"{next_num}:{type_code}",
|
||||
"-c", f"{next_num}:{name}",
|
||||
disk_device
|
||||
|
||||
Reference in New Issue
Block a user