Why Windows Utilities Show Different Views of System Storage
Windows utilities don’t always seem to agree on the number of disks installed on your computer.
Let me show you an example.
If you look at Figure 1, you can see the Disk Management console on a machine that is running Windows Server 2022. The Disk Management console shows two physical disks: the system disk and an unprovisioned disk that is currently offline. Note the disk numbers (Windows assigns a number to each disk). The system disk is disk 0 and the unprovisioned disk is disk 3.
Figure 1. The Disk Management console displays two disks: Disk 0 and Disk 3.
Now look at Figure 2. I opened an elevated PowerShell session and am using both the Get-Disk cmdlet and the Get-PhysicalDisk cmdlet to view the disks installed in the system. Both cmdlets see only one disk (disk 0), despite showing Disk Management console of them discs.
Figure 2. While the Disk Management console sees two disks, PowerShell sees a single disk (disk 0).
So what about the DiskPart utility? Well, if I enter the DiskPart command, followed by the List Disk command, I see three disks (Disk 0, Disk 3, and Disk 4). See what it looks like in Figure 3.
Picture 3. The DiskPart utility shows that three disks are installed.
Three Windows utilities, three views
As you may remember, PowerShell showed one disk, Disk Management console showed two disks, and DiskPart showed three disks. There are simple explanations for why Windows utilities disagree on the number of existing disks in the system.
Let’s start with the simplest explanation first. The Disk Management console, in fact, shows three disks. It’s just that Windows has a bad habit of opening the Disk Management console in a window that’s too small to show you everything. In Figure 4, you can see that when the Disk Management console window is maximized, it does indeed show three disks (Disk 0, Disk 3, and Disk 4).
Figure 4. Maximizing the Disk Management console window revealed additional disks.
OK, but why does PowerShell only show one disk? To answer this question, you need to turn your attention to another Windows utility that lists disks connected to the system: Device Manager. If I open Device Manager and expand the Disk Drives section, I see four Microsoft Virtual Disks and one Microsoft Storage Space device.
Figure 5. Device Manager presents yet another view of the drives connected to the server.
This is where the problem lies. Windows Storage Spaces controls access to certain system disks. If I open the server manager, you can see that a storage pool has been created on this machine. A virtual disk (the one the system identified as Disk 4) was created from the storage pool. Even though the unprovisioned disk is not part of the storage pool, it is treated as a poolable disk.
Picture 6. Windows Storage Spaces are in use on the machine.
That said, let’s see what happens when the storage pool is deleted. For the sake of demonstration, I deleted the 50 GB ramdisk and deleted the MyPool storage pool. I also detached the disks that were previously part of the storage pool, just to avoid confusion. Now if I enter the Get-Disk cmdlet in PowerShell, I see the system disk (disk 1) and the new disk (disk 3) which has not yet been provisioned.
Picture 7. PowerShell now shows disk not provisioned.
Of course, in the real world, if you’ve had trouble setting up a storage pool, you’ll probably want to add the new disk to the pool and use it there. However, my goal in writing this article was not to debate whether you should use storage pools, but rather to explain why PowerShell might not recognize the existence of certain disks.