Skip to content

Commit

Permalink
Nvme partition name (#207)
Browse files Browse the repository at this point in the history
nvme drives add `p9` to the partition name not a simple 9. 

Fixes #209
  • Loading branch information
mrbojangles3 authored Nov 5, 2024
1 parent aa6c237 commit 8c2480f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/fab/recipe/flatcar/control_os_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ func (i *ControlOSInstal) Run(ctx context.Context) error {
// The partition resize didn't wipe out the exisiting filesystem so we don't
// need to remake it, just expand the one that is on disk already. In our
// case we just moving the end of it, not the start
if err := i.execCmd(ctx, true, "resize2fs", dev+"9"); err != nil {
partition := "9"
if strings.Contains(dev, "nvme") {
partition = "p9"
}
if err := i.execCmd(ctx, true, "resize2fs", dev+partition); err != nil {
return fmt.Errorf("resizing filesystem on partition 9 on existing block device: %w", err)
}

Expand All @@ -158,7 +162,7 @@ func (i *ControlOSInstal) Run(ctx context.Context) error {
}

// 9 is the partition number for the root partition
if err := i.execCmd(ctx, true, "mount", "-t", "auto", dev+"9", MountDir); err != nil {
if err := i.execCmd(ctx, true, "mount", "-t", "auto", dev+partition, MountDir); err != nil {
return fmt.Errorf("mounting root: %w", err)
}

Expand Down

0 comments on commit 8c2480f

Please sign in to comment.