Skip to content

Commit

Permalink
Merge pull request #18 from Sh4d1/fix_fstype
Browse files Browse the repository at this point in the history
fix: scope ext3/4 specific options
  • Loading branch information
Sh4d1 authored Apr 29, 2020
2 parents 6e153cc + 50c16e1 commit 2fe4492
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion driver/diskutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,15 @@ func (d *diskUtils) formatDevice(devicePath string, fsType string) error {
return err
}

mkfsArgs := []string{"-m", "0", devicePath}
mkfsArgs := []string{devicePath}
if fsType == "ext4" || fsType == "ext3" {
mkfsArgs = []string{
"-F", // Force mke2fs to create a filesystem
"-m0", // 0 blocks reserved for the super-user
devicePath,
}
}

return exec.Command(mkfsPath, mkfsArgs...).Run()
}

Expand Down

0 comments on commit 2fe4492

Please sign in to comment.