Sdílet prostřednictvím


Recovering from Failed Disks in Tiered Storage Spaces on Windows 10 via PowerShell

I have a Windows 10 workstation at home which has a tiered storage space with 2 SSD and 6 HDD. I have a mirrored virtual disk using both tiers and I use this for regular storage, file sharing, and running my virtual machines.

A tiered storage space is one that mixes a "fast" set of SSD and a "slow" set of spinning disks to create a storage space that is both big _and_ fast. If you are unfamiliar with Tiered Storage Spaces, here are a couple of great blog posts here and here on the topic.

I had originally created this storage space when I was running Windows 2012R2 with the GUI, but even though there is no GUI (and it’s not supported) the tiered storage space works like a champ on Windows 10. While tiered storage spaces are not supported on Windows 10 (seriously, tiered spaces are intended for server only) all the commands below are the same across the client and server OS.

Due to some constraints during the initial build process ended up with a mismatched (size-wise) SSDs in the fast tier. I found another of my “small” SSDs on sale and I wanted to recover my “big” SSD for repurposing.

The task in front of me was simple, swap the disks. I was out of SATA ports on my system so I made the foolhardy move of simply unplugging the SSDtobeReplaced and plugging in the new SSD. Naturally this caused my mirrored storage space to go into a “degraded” state.

  • Note: The MSFT documentation on storage spaces is _very_ clear.  DON’T DO THIS IF AT ALL POSSIBLE.  We really, really, really want to have the new disk in place before removing the old one.

As I started doing some research on how to fix my mess, I found some good documents on how to repair a tiered storage space using the GUI. Only problem was that I had no GUI to do this as I am running a client OS now. I could have rebuilt my machine as a server OS and fixed the space that way, but I thought I’d see what PowerShell could do.

It turns out that Windows 10 PowerShell includes all the storage space commands needed to create, modify, and manage a tiered storage space. This was good news, except that there was little to no documentation on _how_ to actually do the repair. Initially I tried adding the drive to the pool as normal with the “add-physicadisk” command.

 

PS C:\WINDOWS\system32> get-virtualdisk

 

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach    Size

------------ --------------------- ----------------- ------------ --------------    ----

NTFS         Mirror                Degraded          Warning      False          5.68 TB

 

PS C:\WINDOWS\system32> Get-PhysicalDisk

 

FriendlyName              SerialNumber    CanPool OperationalStatus  HealthStatus Usage            Size

------------              ------------    ------- -----------------  ------------ -----            ----

ATA Samsung SSD 840       S1DBNSAF925671Y True    OK                 Healthy      Auto-Select 232.89 GB

Disk1                     WD-WMAZA3795023 False   OK                 Healthy      Auto-Select   1.82 TB

Disk2                     WD-WCAZA5713932 False   OK                 Healthy      Auto-Select   1.82 TB

SSD3                                      False   Lost Communication Warning      Auto-Select  446.5 GB

Disk3                     WD-WCAVY5436882 False   OK                 Healthy      Auto-Select   1.82 TB

Disk4                     WD-WCAZA5724921 False   OK                 Healthy      Auto-Select   1.82 TB

Disk5                     WD-WCAVY5805593 False   OK                 Healthy      Auto-Select   1.82 TB

Disk6                     WD-WMAZA3791851 False   OK                 Healthy      Auto-Select   1.82 TB

SSD2                      S1DBNSCF810110W False   OK                 Healthy      Auto-Select 232.25 GB

Samsung SSD 840 EVO 250GB S1DBNSAF925533D False   OK                 Healthy      Auto-Select 232.89 GB

 

PS C:\WINDOWS\system32> $SSD3 = Get-PhysicalDisk -SerialNumber S1DBNSAF925671Y

PS C:\WINDOWS\system32> Add-PhysicalDisk -StoragePoolFriendlyName pool1 -Usage HotSpare -PhysicalDisks $SSD3

PS C:\WINDOWS\system32> Repair-VirtualDisk -FriendlyName ntfs

PS C:\WINDOWS\system32> Get-StorageJob

 

Name   ElapsedTime JobState  PercentComplete IsBackgroundTask

----   ----------- --------  --------------- ----------------

Repair 00:00:00    Completed 100             False

 

I thought that it was odd that the repair job finished so quickly. Sure enough the virtual disk was still in degraded state.

 

PS C:\WINDOWS\system32> get-virtualdisk

 

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach    Size

------------ --------------------- ----------------- ------------ --------------    ----

NTFS         Mirror                Degraded          Warning      False          5.68 TB

 

I tried to think about what might have gone wrong with the repair and started looking at the details of the physical disk when I noticed that the media type of my SSD was listed as “unspecified”

PS C:\WINDOWS\system32> Get-PhysicalDisk -SerialNumber S1DBNSAF925671Y|fl

ObjectId                         : {1}\\NOTJJSB\root/Microsoft/Windows/Storage/Providers_v2\SPACES_PhysicalDisk.ObjectI

                                   d="{4f1a0953-5b0d-11e4-95d2-806e6f6e6963}:PD:{47abc017-9860-11e5-963d-00224d9ad22b}"

PassThroughClass                 :

PassThroughIds                   :

PassThroughNamespace             :

PassThroughServer                :

UniqueId                         : 0050430000000003

Description                      :

FriendlyName                     : ATA Samsung SSD 840

HealthStatus                     : Healthy

Manufacturer                     : ATA

Model                            : Samsung SSD 840

OperationalStatus                : OK

PhysicalLocation                 :

SerialNumber                     : S1DBNSAF925671Y

AllocatedSize                    : 268435456

BusType                          : RAID

CannotPoolReason                 : In a Pool

CanPool                          : False

DeviceId                         : 8

EnclosureNumber                  :

FirmwareVersion                  : EXT0

IsIndicationEnabled              :

IsPartial                        : False

LogicalSectorSize                : 512

MediaType : Unspecified

OtherCannotPoolReasonDescription :

PartNumber                       :

PhysicalSectorSize               : 512

Size                             : 249376538624

SlotNumber                       :

SoftwareVersion                  :

SpindleSpeed                     : Unknown

SupportedUsages                  : {Auto-Select, Manual-Select, Hot Spare, Retired...}

UniqueIdFormat                   : EUI64

Usage                            : Hot Spare

PSComputerName                   :

ClassName                        : MSFT_PhysicalDisk

 

This means that the storage pool had no idea this was an SSD (even though it was in the name) and so it didn’t know to use it to replace the failed drive in the SSD_Tier. “Easy Peasy” I heard myself mutter and I manually set the media type to SSD and re-tried the repair job.

 

PS C:\WINDOWS\system32> Get-PhysicalDisk -SerialNumber S1DBNSAF925671Y|Set-PhysicalDisk -MediaType SSD

PS C:\WINDOWS\system32> Repair-VirtualDisk -FriendlyName ntfs

PS C:\WINDOWS\system32> Get-StorageJob

 

Name   ElapsedTime JobState  PercentComplete IsBackgroundTask

----   ----------- --------  --------------- ----------------

Repair 00:00:00    Completed 100             False

 

 

PS C:\WINDOWS\system32> get-virtualdisk

 

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach    Size

------------ --------------------- ----------------- ------------ --------------    ----

NTFS         Mirror                Degraded          Warning      False          5.68 TB

 

BLERG!! Still no joy on the repair job. I was scratching my head and searching around when I came across a blog post by MVP Charbel Nemnom about how to replace a faulty disk in a two-way tiered storage space.

https://charbelnemnom.com/2014/09/step-by-step-how-to-replace-faulty-disk-in-two-way-mirrored-storage-tiered-space-storagespaces-ws2012r2/

 

I looked at the commands Charbel used and noticed the only difference between what he had done and my failed attempt was I specified “hotspare” as my usage type. I flipped the usage type to “autoselect” and re-ran the repair job.

 

PS C:\WINDOWS\system32> Get-PhysicalDisk -SerialNumber S1DBNSAF925671Y|Set-PhysicalDisk -Usage AutoSelect

PS C:\WINDOWS\system32> Repair-VirtualDisk -FriendlyName ntfs -AsJob

 

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command

--     ----            -------------   -----         -----------     --------             -------

183    CimJob90        CimJob          Running       True            NOTJJSB              Repair-VirtualDisk -Fr...

 

And sure enough, it was WORKING! 

PS C:\WINDOWS\system32> Get-StorageJob

 

Name         ElapsedTime JobState PercentComplete IsBackgroundTask

----         ----------- -------- --------------- ----------------

Repair       00:10:48    Running  65              False

Regeneration 00:10:49    Running  66              True

 

After about 30 minutes of repair (boy are SSDs _fast_), I removed the “failed” SSD and had a healthy virtual disk again. J

PS C:\WINDOWS\system32> $BadSSD = Get-PhysicalDisk -FriendlyName SSD3

PS C:\WINDOWS\system32> Remove-PhysicalDisk -StoragePoolFriendlyName pool1 -PhysicalDisks $BadSSD

 

I learned several lessons with this exercise. 

  1. Don’t make the choice of just unplugging an existing drive and swapping in a new one if possible. – The MSFT documents are very clear on this point.  Add the new drive first if possible

  2. If I don’t have an existing hot-spare disk when a drive actually does go bad, I have to add that disk as “autoselect”

  3. Try to read the official MSFT documentation better – the need to use “autoselect” is actually spelled out here.  J

 

Thanks for reading and enjoy tiered storage spaces!

 JJ Streicher-Bremer