Skip to content

Commit

Permalink
runGrowPart: Get the partition number using len of '/dev/.da'
Browse files Browse the repository at this point in the history
With current solution `rootPart[len(rootPart)-1:]` if rootPart is
`/dev/vda12` then the partition come up as `1` instead of `12`. Current
patch make sure it provide correct partition info like `12`.
  • Loading branch information
praveenkumar committed Jun 26, 2023
1 parent 52cb9b2 commit c1e15a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func getrootPartition(sshRunner *crcssh.Runner, label string) (string, error) {

func runGrowpart(sshRunner *crcssh.Runner, rootPart string) error {
// with '/dev/[sv]da4' as input, run 'growpart /dev/[sv]da 4'
if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Growing %s partition", rootPart), "/usr/bin/growpart", rootPart[:len("/dev/.da")], rootPart[len(rootPart)-1:]); err != nil {
if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Growing %s partition", rootPart), "/usr/bin/growpart", rootPart[:len("/dev/.da")], rootPart[len("/dev/.da"):]); err != nil {
var exitErr *ssh.ExitError
if !errors.As(err, &exitErr) {
return err
Expand Down

0 comments on commit c1e15a5

Please sign in to comment.