correct partition type for EFI

This commit is contained in:
Aaron Honeycutt 2025-04-10 09:47:33 -06:00
parent 0c4f154325
commit efb80cacea

View file

@ -18,12 +18,12 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> {
disk.partition_table_create(PartitionTableKind::GPT)?;
let partition_type = PartitionKind::builder()
.guid(Guid::LinuxRootx86_64)
let boot_part_type = PartitionKind::builder()
.guid(Guid::EfiSystem)
.build()?;
let boot = Partition::builder()
.partition_type(partition_type.clone())
.boot_part_type(partition_type.clone())
.name("EFI")
//Assuming 512 bytes per sector, 2_097_152 sectors <=> 1 GiB.
.size_in_sectors(2_097_152)
@ -31,8 +31,12 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> {
let _ = disk.partition_add(boot)?;
let root_part_type = PartitionKind::builder()
.guid(Guid::LinuxRootx86_64)
.build()?;
let root = Partition::builder()
.partition_type(partition_type)
.root_part_type(partition_type)
.name("Root")
.size_in_sectors(121_634_816)
// 500GB