Get-Disk and Get-PhysicalDisk return different results

I am trying to set up storage spaces on Windows 10 Pro, but I am confused by the output of Get-Disk and Get-PhysicalDisk:

PS C:\Windows\system32> Get-PhysicalDisk | select DeviceId,friendlyname,serialnumber,canpool
DeviceId friendlyname serialnumber canpool
-------- ------------ ------------ -------
2 Samsung SSD 980 PRO 500GB 0025_38BB_0152_4B00. False
1 Samsung SSD 980 PRO 500GB 0025_38BB_0152_4B51. False
0 Samsung SSD 870 QVO 2TB S5SUNF0R209736R False
PS C:\Windows\system32> Get-Disk | select Number,friendlyname,serialnumber
Number friendlyname serialnumber
------ ------------ ------------ 1 Samsung SSD 980 PRO 500GB 0025_38BB_0152_4B51.

What I am really trying to achieve is to create a tiered storage pool with disks 0 and 2, using 2 as a cache.

It seems the problem is that these physical disks are not recognized as "logical disks" (if that is a term). I have tried to Initialize-Disk (which is supposed to initialize a partition table) which can't find the disk by number:

PS C:\Windows\system32> Initialize-Disk -Number 0
Initialize-Disk : No MSFT_Disk objects found with property 'Number' equal to '0'.

And I have tried Reset-PhysicalDisk which does nothing to the list returned by Get-Disk.

So, two questions which I think is related:

  • how can I enable a physical disk to be "CanPool"?
  • how can I get disks listed from Get-PhysicalDisk to show up in Get-Disk?
6

2 Answers

The answer to your question is simply Get-Disk is logical disks only, and Get-PhysicalDisk returns the attached disk devices, but it looks like you know this.

Get-PhysicalDisk actually has a CannotPoolReason property which may be helpful to you:

Get-PhysicalDisk | Select DeviceID,CanPool,CannotPoolReason
deviceid canpool CannotPoolReason
-------- ------- ----------------
0 False Insufficient Capacity
2 False Insufficient Capacity
1 False Insufficient Capacity

Disks to be used in a storage pool must have no partition present (and therefore should not show up in Get-Disk and should not be initialized). Check with:

Get-Partition -DiskNumber 0,2

If you have any partitions listed, or if you have initialized the disks, use Reset-PhysicalDisk to fix. Note that this wipes all data on the disk, so be careful. Sometimes you may have to rescan for disks (or restart the machine) to get them to have CanPool set correctly.

Finally, once your disks can pool, you can create your storage pool. This is just an example, so change the values to suit your needs.

$PhysicalDisks = Get-PhysicalDisk -CanPool $True
# Create the pool
New-StoragePool -FriendlyName "Data" -StorageSubsystemFriendlyName "MyStorage*" -PhysicalDisks $PhysicalDisks | # And, optionally create a partition within your pool to use: New-VirtualDisk -FriendlyName "UserData" -Size 100GB -ProvisioningType Thin | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume

Storage spaces automatically uses your fastest tier of hard drive for caching. Good luck!

[edit] looks like you found an answer seconds before me :^)

2

Ok, I figured this out.

I rebooted from a linux live-USB to take a look at the partition table, and it turned out that the two disks were already partitioned for Storage Spaces. I had opened the GUI for storage spaces and decided that it didn't have the features I want (tiering), but apparently it had already partitioned the drives for storage spaces, and this made them unavailable for all other operations.

I even started reinstalling, but only one disk was available.

It is possible that I could have undone this using storage space management in either the control panel or powershell, but by this time the partitions had already been destroyed in my reinstallation attemt.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like