A disk object models the operating system's concept of a disk device. The disk may be directly attached to the computer system, or a virtual disk exposed to the system through the use of a Storage Management Provider.
{'Description':'This parameter indicates that it is OK to remove data partitions from the disk. If this parameter is FALSE or NULL, Clear will fail in the presence of a data partition.','In':True}
RemoveOEM
boolean
1
✓
-
{'Description':'This parameter indicates that it is OK to remove OEM and other special partitions. If this parameter is FALSE or not specified, Clear will fail in the presence of these types of partitions.','In':True}
ZeroOutEntireDisk
boolean
2
✓
-
{'Description':'If TRUE, this parameter instructs Clear to zero out the entire disk in addition to removing all partition information. If the parameter is FALSE or NULL, only the first and last megabyte of the disk is zeroed.','In':True}
'This method removes partition information and uninitializes a disk, sending it back into a RAW state. The caller must specify RemoveData, RemoveOEM or both with this method unless they first delete all data partitions, known OEM partitions, and ESP partitions on the disk. This requirement excludes metadata partitions such as the MSR, the LDM metadata partition, and unknown OEM partitions.'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The disk has not been initialized.', 'The disk is read only.', 'The disk is offline.', 'Cannot clear with OEM partitions present. To clear OEM partitions, use the RemoveOEM flag.', 'Cannot clear with data partitions present. To clear data partitions, use the RemoveData flag.', 'Operation not supported on a critical disk.', 'There is no media in the device.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be removed from the cluster to perform this operation.']
'This method converts the partition style of an already initialized disk.'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The disk has not been initialized.', 'The disk is read only.', 'The disk is offline.', 'Operation not supported on a critical disk.', 'Cannot convert the style of a disk with data or other known partitions on it.', 'The disk is not large enough to support a GPT partition style.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be removed from the cluster to perform this operation.']
ConvertStyle method is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 2 namespaces
{'Description':'This parameter specifies the desired size (measured in bytes) for the partition. This must be equal to or less than the size specified by the disk's LargestFreeExtent property. This parameter cannot be used with UseMaximumSize.','In':True,'Units':'Bytes'}
UseMaximumSize
boolean
1
✓
-
{'Description':'If set to TRUE, the partition will fill the largest free extent on the disk. This parameter cannot be used with the Size parameter.','In':True}
Offset
uint64
2
✓
-
{'Description':'This parameter specifies the partition offset (measured in bytes). If the offset is not aligned and the Alignment parameter is not specified, the offset is rounded up or down to the closest alignment boundary depending on the size of the disk on which the partition is created.','In':True,'Units':'Bytes'}
Alignment
uint32
3
✓
-
{'In':True,'Units':'Bytes'}
DriveLetter
char16
4
✓
-
{'Description':'This parameter allows the user to specify a drive letter for the partition at the time of creation. This parameter cannot be used in conjunction with AssignDriveLetter. If both parameters are specified, an Invalid Parameter error will be returned. If the drive letter is not available, the partition will be created, but error '42002' will be returned.','In':True}
AssignDriveLetter
boolean
5
✓
-
{'Description':'If AssignDriveLetter is set to TRUE, the next available drive letter will be assigned to the created partition. If no more drive letters are available, the partition will be created with no drive letter. This parameter cannot be used in conjunction with DriveLetter. If both parameters are specified, an Invalid Parameter error will be returned.','In':True}
MbrType
uint16
6
✓
-
{'Description':'Specifies the MBR partition type. MbrType can only be set if the disk's PartitionStyle property is set to 1 - 'MBR', otherwise an error will be returned. If this parameter is not specified, CreatePartition will default to type 6 - 'Huge'.','In':True,'Values':['FAT12', 'FAT16', 'Extended', 'Huge', 'IFS', 'FAT32']}
GptType
string
7
✓
-
{'Description':'Specifies the GPT partition type. GptType is only valid if the disk's PartitionStyle property is set to 2 - 'GPT', otherwise an error will be returned. If this parameter is not specified, CreatePartition will default to {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7} - 'Basic Data'.','In':True,'Values':['System Partition', 'Microsoft Reserved', 'Basic data', 'LDM Metadata', 'LDM Data', 'Microsoft Recovery']}
IsHidden
boolean
8
✓
-
{'Description':'If TRUE, the partition will not be able to receive a drive letter assignment, nor will mount manager assign a volume GUID name. The partition will not be enumerated by the FindFirstVolume and FindNextVolume functions. The partition can be opened by its associated volume device name (i.e. \?GLOBALROOT\Device\HarddiskVolumeX).','In':True}
IsActive
boolean
9
✓
-
{'Description':'If TRUE, the partition's MBR active bit will be set, and the partition will become bootable. This parameter is only valid for MBR disks.','In':True}
'This method will attempt to create a new partition on the disk. By default, it creates a data partition using the largest available free extent. On MBR disks, CreatePartition will automatically create an extended partition when needed.'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Size Not Supported', 'Not enough available capacity', 'Access denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'You must specify a size by using either the Size or the UseMaximumSize parameter. You can specify only one of these parameters at a time.', 'The disk has not been initialized.', 'The disk is read only.', 'The disk is offline.', 'The disk's partition limit has been reached.', 'The specified partition alignment is not valid. It must be a multiple of the disk's sector size.', 'A parameter is not valid for this type of partition.', 'The specified partition type is not valid.', 'Only the first 2 TB are usable on MBR disks.', 'The specified offset is not valid.', 'There is no media in the device.', 'Operation not supported on a non-empty removable disk.', 'The specified partition layout is invalid.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be in cluster maintenance mode and the cluster resource status must be online to perform this operation.', 'The requested access path is already in use.', 'Cannot assign access paths to hidden partitions.', 'The access path is not valid.']
CreatePartition method is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 2 namespaces
{'Description':'Specifies the desired partition style for the disk. If no value is given, Initialize will default to 2 - 'GPT'.','In':True,'Values':['MBR', 'GPT']}
'This method initializes a RAW disk with a particular partition style. If no partition style is specified, GPT will be selected by default. If the disk is already initialized, this method will fail with a well defined error code.'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The disk has already been initialized.', 'The specified partition type is not valid.', 'The disk is not large enough to support a GPT partition style.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be in cluster maintenance mode and the cluster resource status must be online to perform this operation.']
Initialize method is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 2 namespaces
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'Operation not supported on a critical disk.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be in cluster maintenance mode and the cluster resource status must be online to perform this operation.']
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be in cluster maintenance mode and the cluster resource status must be online to perform this operation.']
'This method refreshes the cached disk layout information. This is useful when the backing disk has changed size (if the backing data store is a VHD or a virtual disk).'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The disk has not been initialized.', 'The disk is offline.']
Refresh method is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 5 namespaces
{'Description':'If TRUE, the disk will be made read-only. If FALSE, the disk will become writable.','In':True}
Signature
uint32
1
✓
-
{'Description':'Sets the MBR signature of the disk. This parameter is only valid when the disk's PartitionStyle property is set to 1 - 'MBR'. An error will be returned if the disk is any other partition style.','In':True}
Guid
string
2
✓
-
{'Description':'Sets the GPT guid of the disk. This parameter is only valid when the disk's PartitionStyle property is set to 2 - 'GPT'. An error will be returned if the disk is any other partition style.','In':True}
'Sets various attributes and properties of the disk. The disk must be online for most attributes to be set.'
Values
['Success', 'Not Supported', 'Unspecified Error', 'Timeout', 'Failed', 'Invalid Parameter', 'Disk is in use', 'Access Denied', 'There are not enough resources to complete the operation.', 'Cache out of date', 'The disk has not been initialized.', 'The disk is offline.', 'A parameter is not valid for this type of partition.', 'Operation not supported on a critical disk.', 'The specified object is managed by the Microsoft Failover Clustering component. The disk must be in cluster maintenance mode and the cluster resource status must be online to perform this operation.']
'This property indicates that the computer is configured to start off of this disk. On computers with BIOS firmware, this is the first disk that the firmware detects during startup. On computers that use EFI firmware, this is the disk that contains the EFI System Partition (ESP). If there are no disks or multiple disks with an ESP partition, this flag is not set for any disk.'
BootFromDisk property is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 2 namespaces
'This field indicates the largest contiguous block of free space on the disk. This is also the largest size of a partition which can be created on the disk.'
Units
'Bytes'
LargestFreeExtent property is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 2 namespaces
'Location contains the PnP location path of the disk. The format of this string depends on the bus type. If the bus type is SCSI, SAS, or PCI RAID, the format is #(PTL). If the bus type is IDE, ATA, PATA, or SATA, the format is #(CTL). For example, a SCSI location may look like: PCIROOT(0)#PCI(1C00)#PCI(0000)#SCSI(P00T01L01). Note: For Hyper-V and VHD images, this member is NULL because the virtual controller does not return the location path.'
Location property is in 1 class (MSFT_Disk) of ROOT\Microsoft\Windows\Storage\ms_409 and in 10 namespaces
'This field indicates the logical sector size of the disk in bytes. For example: a 4K native disk will report 4096, while a 512 emulated disk will report 512.'
'If IsOffline is TRUE, this property informs the user of the specific reason for the disk being offline. 1 - 'Policy': The user requested the disk to be offline. 2 - 'Redundant Path': The disk is used for multi-path I/O. 3 - 'Snapshot': The disk is a snapshot disk. 4 - 'Collision': There was a signature or identifier collision with another disk. 5 - 'Resource Exhaustion': There were insufficient resources to bring the disk online. 6 - 'Critical Write Failures': There were critical write failures on the disk. 7 - 'Data Integrity Scan Required': A data integrity scan is required.'
'Denotes the provisioning type of the disk device. 1 - 'Thin' means that the storage for the disk is allocated on-demand. 2 - 'Fixed' means that the storage is allocated up front.'
'UniqueId of a disk contains the VPD Page 0x83 information that uniquely identifies this disk. The following types are accepted (in order of precedence): 8 - SCSI Name String; 3 - FCPH Name; 2 - EUI64, 1 - Vendor Id, 0 - Vendor Specific. If the disk is an exposed VirtualDisk, UniqueId is used map the association between the two objects.'
'A disk object models the operating system's concept of a disk device. The disk may be directly attached to the computer system, or a virtual disk exposed to the system through the use of a Storage Management Provider.'