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 3, 2021
1 parent 2b7dc43 commit 85daba4
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 @@ -158,7 +158,7 @@ func (DiskAPI) InitializeDisk(diskNumber uint32) error {
}

func (DiskAPI) PartitionsExist(diskNumber uint32) (bool, error) {
cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %d", diskNumber)
cmd := fmt.Sprintf("Get-Partition | Where DiskNumber -eq %d | Where Type -ne Reserved", diskNumber)
out, err := runExec(cmd)
if err != nil {
return false, fmt.Errorf("error checking presence of partitions on disk %d: %v, %v", diskNumber, out, err)
Expand Down

0 comments on commit 85daba4

Please sign in to comment.