Skip to content

Commit c1e15a5

Browse files
committed
runGrowPart: Get the partition number using len of '/dev/.da'
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`.
1 parent 52cb9b2 commit c1e15a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/crc/machine/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func getrootPartition(sshRunner *crcssh.Runner, label string) (string, error) {
158158

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

0 commit comments

Comments
 (0)