question

PraveenMittapalli-6705 avatar image
0 Votes"
PraveenMittapalli-6705 asked azure-cxp-api edited

how to get unallocated data disk details from OS level using powershell


get the list of disks that are attached to VM, but not configured in disk management? Ie. Disk volumes are not created but the disk is attached on the VMs in OS level.

Please help me on this.
Thanks in advance

azure-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChristopherW-MSFT avatar image
0 Votes"
ChristopherW-MSFT answered

Hi @PraveenMittapalli-6705

For Windows, when a Disk is attached to an Azure Virtual Machine and isn't allocated to a Volume, you can run a PowerShell Get-Disk to pull all attached Disks, then check the 'Partition Style' - A disk that hasn't been allocated will be 'RAW' by default .

If you want to query all of these 'RAW' Disks, you can run PowerShell: Get-Disk | Where-Object PartitionStyle –Eq 'RAW'
Alternatively, if you need a method of initializing ALL Disks that have been attached, you can run PowerShell: Get-Disk | Where-Object PartitionStyle –Eq 'RAW' | Initialize-Disk

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.