diff --git a/pkg/config/cos.go b/pkg/config/cos.go index 4b1a1b948..bae516c1d 100644 --- a/pkg/config/cos.go +++ b/pkg/config/cos.go @@ -796,7 +796,33 @@ func calcCosPersistentPartSize(diskSizeGiB uint64, partSize string) (uint64, err return util.ByteToMi(size), nil } -func CreateRootPartitioningLayout(elementalConfig *ElementalConfig, hvstConfig *HarvesterConfig) (*ElementalConfig, error) { +func CreateRootPartitioningLayoutSeparateDataDisk(elementalConfig *ElementalConfig) *ElementalConfig { + elementalConfig.Install.Partitions = &ElementalDefaultPartition{ + OEM: &ElementalPartition{ + FilesystemLabel: "COS_OEM", + Size: DefaultCosOemSizeMiB, + FS: "ext4", + }, + State: &ElementalPartition{ + FilesystemLabel: "COS_STATE", + Size: DefaultCosStateSizeMiB, + FS: "ext4", + }, + Recovery: &ElementalPartition{ + FilesystemLabel: "COS_RECOVERY", + Size: DefaultCosRecoverySizeMiB, + FS: "ext4", + }, + Persistent: &ElementalPartition{ + FilesystemLabel: "COS_PERSISTENT", + Size: 0, + FS: "ext4", + }, + } + return elementalConfig +} + +func CreateRootPartitioningLayoutSharedDataDisk(elementalConfig *ElementalConfig, hvstConfig *HarvesterConfig) (*ElementalConfig, error) { diskSizeBytes, err := util.GetDiskSizeBytes(hvstConfig.Install.Device) if err != nil { return nil, err diff --git a/pkg/console/util.go b/pkg/console/util.go index 50171560d..ab10ea4ec 100644 --- a/pkg/console/util.go +++ b/pkg/console/util.go @@ -531,10 +531,12 @@ func doInstall(g *gocui.Gui, hvstConfig *config.HarvesterConfig, webhooks Render if hvstConfig.ShouldCreateDataPartitionOnOsDisk() { // Use custom layout (which also creates Longhorn partition) when needed - elementalConfig, err = config.CreateRootPartitioningLayout(elementalConfig, hvstConfig) + elementalConfig, err = config.CreateRootPartitioningLayoutSharedDataDisk(elementalConfig, hvstConfig) if err != nil { return err } + } else { + elementalConfig = config.CreateRootPartitioningLayoutSeparateDataDisk(elementalConfig) } if hvstConfig.DataDisk != "" {