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

Praveen Mittapalli 36 Reputation points

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,416 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChristopherW-MSFT 1,681 Reputation points

    Hi @Praveen Mittapalli

    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

    0 comments No comments