Skip to content

Commit

Permalink
Don't count reserved partitions (gpt) when checking if any exist
Browse files Browse the repository at this point in the history
  • Loading branch information
wongma7 committed Jun 1, 2021
1 parent c249530 commit 5022cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/os/disk/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (APIImplementor) InitializeDisk(diskID string) error {
}

func (APIImplementor) PartitionsExist(diskID string) (bool, error) {
cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %s", diskID)
cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %s | Where Type -ne Reserved", diskID)
out, err := exec.Command("powershell", "/c", cmd).CombinedOutput()
if err != nil {
return false, fmt.Errorf("error checking presence of partitions on disk %s: %v, %v", diskID, out, err)
Expand Down

0 comments on commit 5022cbd

Please sign in to comment.