Skip to content

Commit

Permalink
growRootFileSystem: Use '/sysroot' option for xfs_growfs instead disk…
Browse files Browse the repository at this point in the history
… partition

The root partition for both microshift and openshift bundle is mounted
on `/sysroot` as xfs file system. So we can directly use this partition
to extend the size instead specifically provide the
device mapper path `/dev/rhel/root` (in case of microshift) or
block device partition `/dev/vda[n]` (in case of openshift).

This will help us to simplify same command for both types of bundles.
  • Loading branch information
praveenkumar committed Jun 26, 2023
1 parent c1e15a5 commit e6dd219
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ func growRootFileSystem(sshRunner *crcssh.Runner, preset crcPreset.Preset) error
}

logging.Infof("Resizing %s filesystem", rootPart)
if _, _, err := sshRunner.RunPrivileged("Remounting /sysroot read/write", "mount -o remount,rw /sysroot"); err != nil {
rootFS := "/sysroot"
if _, _, err := sshRunner.RunPrivileged(fmt.Sprintf("Remounting %s read/write", rootFS), "mount -o remount,rw", rootFS); err != nil {
return err
}
if _, _, err = sshRunner.RunPrivileged(fmt.Sprintf("Growing %s filesystem", rootPart), "xfs_growfs", rootPart); err != nil {
if _, _, err = sshRunner.RunPrivileged(fmt.Sprintf("Growing %s filesystem", rootFS), "xfs_growfs", rootFS); err != nil {
return err
}

Expand Down

0 comments on commit e6dd219

Please sign in to comment.