@@ -33,10 +33,10 @@ type API interface {
33
33
IsDiskInitialized (diskNumber uint32 ) (bool , error )
34
34
// InitializeDisk initializes the disk `diskNumber`
35
35
InitializeDisk (diskNumber uint32 ) error
36
- // PartitionsExist checks if the disk `diskNumber` has any partitions.
37
- PartitionsExist (diskNumber uint32 ) (bool , error )
38
- // CreatePartitoin creates a partition in disk `diskNumber`
39
- CreatePartition (diskNumber uint32 ) error
36
+ // BasicPartitionsExist checks if the disk `diskNumber` has any basic partitions.
37
+ BasicPartitionsExist (diskNumber uint32 ) (bool , error )
38
+ // CreateBasicPartition creates a partition in disk `diskNumber`
39
+ CreateBasicPartition (diskNumber uint32 ) error
40
40
// Rescan updates the host storage cache (re-enumerates disk, partition and volume objects)
41
41
Rescan () error
42
42
// GetDiskNumberByName gets a disk number by page83 ID (disk name)
@@ -157,8 +157,8 @@ func (DiskAPI) InitializeDisk(diskNumber uint32) error {
157
157
return nil
158
158
}
159
159
160
- func (DiskAPI ) PartitionsExist (diskNumber uint32 ) (bool , error ) {
161
- cmd := fmt .Sprintf ("Get-Partition | Where DiskNumber -eq %d" , diskNumber )
160
+ func (DiskAPI ) BasicPartitionsExist (diskNumber uint32 ) (bool , error ) {
161
+ cmd := fmt .Sprintf ("Get-Partition | Where DiskNumber -eq %d | Where Type -eq Basic " , diskNumber )
162
162
out , err := runExec (cmd )
163
163
if err != nil {
164
164
return false , fmt .Errorf ("error checking presence of partitions on disk %d: %v, %v" , diskNumber , out , err )
@@ -170,7 +170,7 @@ func (DiskAPI) PartitionsExist(diskNumber uint32) (bool, error) {
170
170
return false , nil
171
171
}
172
172
173
- func (DiskAPI ) CreatePartition (diskNumber uint32 ) error {
173
+ func (DiskAPI ) CreateBasicPartition (diskNumber uint32 ) error {
174
174
cmd := fmt .Sprintf ("New-Partition -DiskNumber %d -UseMaximumSize" , diskNumber )
175
175
out , err := runExec (cmd )
176
176
if err != nil {
0 commit comments