How to find disks not in use?

Stephen Weber 346 Reputation points
2023-01-23T15:33:18.3066667+00:00

I need to remove any disks which are not in use, here is the disks screen, I see several disks which do not have owners. Can I assume that these disks are not in use? If not what is the best way to determine disks which are orphaned? If I I attempt to delete a disk which is in use, will I get an error or warning message?

User's image

Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
603 questions
0 comments No comments
{count} votes

Accepted answer
  1. shiva patpi 13,171 Reputation points Microsoft Employee
    2023-01-23T16:35:16.9266667+00:00

    Hello @Stephen Weber ,

    Yeah ! That's the right way to find out if the disk is in use or not . 
    

    Here are the detailed answers for your questions with screen shot in my local testing:

    List of disks in my subscription:

    User's image

    If you click on any of the disks for which you see the owners , please observe below highlighted ones:

    Disk State: Reserved

    Managed By : Master (i.e. the VM name which is currently using this disk)

    Operating system: Since myne was the Linux OS VM disk

    Please Note: The delete button is disabled (Because it is actively in use)

    User's image

    Comparing to the one of the disk which is NOT in use:

    Disk State: UnAttached

    Managed By : -

    Operation System: -

    User's image

    Lets say if you previously had a Virtual Machine which is using the disk and you have deleted the VM but the OS disk was not deleted, then in those scenarios the disk screen shot looks like below:

    Disk State: Unattached (currently disk is not attached , hence it can be deleted)

    Managed By: -

    Operating System: Linux (Previously it was being used by Linux VM)

    User's image

    To summarize :-

    1. From portal you can't delete a disk which is in use. You can use powershell to delete the disk but it will fail with error "Disk in Use"
    2. To identify if the disk is in use or not : You can see owner or You can see the disk state. Kindly let us know if you have any additional questions, happy to help out ! Regards, Shiva.
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful