I tested and restarting computer clears the list.
Can't remove virtual disks completely
I'm creating a lot of differencing disks for my project and deleting them after some time.
I use "detach vdisk" command, they disappear from disk management but they are not completely removed...
When i use "list vdisk" command there is a huge list with all the virtual disks ever attached:
I couldn't find a way to clear this and I have no idea if it will impact performance at some point. Does anyone know where all this info is stored and how to remove it?
Is there any way to completely remove a virtual disk so it won't show up in this list after?
7 additional answers
Sort by: Most helpful
-
Malcolm Kobes 11 Reputation points
2020-10-25T23:23:35.63+00:00 Like the command you used "detatch vdisk" suggests, you detach the vdisk. The actual file does not get removed and does stay on the disk until you actualy remove the file.
(If the reply was helpful please don't forget to accept it as the answer, thank you)
-
Anonymous
2020-10-25T23:15:53.737+00:00 Can you remove them?
https://learn.microsoft.com/en-us/powershell/module/storage/remove-virtualdisk?view=win10-ps--please don't forget to Accept as answer if the reply is helpful--
-
Xiaowei He 9,901 Reputation points
2020-10-26T06:08:51.73+00:00 Hi,
As @Malcolm Kobes mentioned, when we use "detatch vdisk", it only stops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer, while the vdisk files still exist, we need to delete the VHDXs in the listed location manually.
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/detach-vdisk
Thanks for your time!
Best Regards,
Anne-----------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
gdlr 106 Reputation points
2020-10-26T08:23:32.777+00:00 But I delete the file after ... I use Remove-Item from powershell.
The disk still remains listed there. I have almost 3000 disks now ...
@Anonymous
I can't figure out how to use Remove-VirtualDisk here. I tried following commands but they don't work. Where can I find out the name or the friendly name of the virtual disks that show up in diskpart list?Remove-VirtualDisk -FriendlyName "VDisk 2852"
Remove-VirtualDisk -Name "VDisk 2852"
Also, I have to mention that the disks are created on a virtual machine that doesn't run Hyper-V services. Can this be causing the problem?