Skip to content

Commit 1c0e464

Browse files
authored
log mkfs.ext4 stderr output (#2474)
Log the stderr output when `mkfs.ext4` fails during scratch formatting. This should help troubleshooting easier, e.g. when the binary is missing or not properly symlinked etc. Signed-off-by: Maksim An <maksiman@microsoft.com>
1 parent c9ae50d commit 1c0e464

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/lcow/scratch.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func CreateScratch(ctx context.Context, lcowUVM *uvm.UtilityVM, destFile string,
105105
err = cmd.Run()
106106
cancel()
107107
if err != nil {
108+
log.G(ctx).WithError(err).WithField("stderr", mkfsStderr.String()).Error("mkfs.ext4 failed")
108109
return fmt.Errorf("failed to `%+v` following hot-add %s to utility VM: %w", cmd.Spec.Args, destFile, err)
109110
}
110111

0 commit comments

Comments
 (0)