Removing a disk from Storage Pool is hanging, why?

Removing a disk from Storage Pool is hanging, why?

Q. I'm trying to remove a disk in my Storage Pool that I've replaced with another but it is hanging, why?
Dept - File Systems

A. Storage Spaces is present in both the client and server versions of Windows. You likely have the Storage Space (virtual disk) using Mirroring which means every block of data on one disk is also written to another disk. If you want to replace a disk you would shutdown the machine, replace the disk with a new disk then in Storage Spaces control panel applet add the new disk into the pool at which point Storage Spaces will use the disk as a replacement for the old and the option to remove the old disk will become available however when you do the Remove action it will just stay hung as shown.

The reason for this is that behind the scenes even though you have replaced the disk the repair process which triggers a regeneration action that has to copy all the blocks to the new disk has not completed. You will be able to see this if you run the PowerShell Get-StorageJob cmdlet.

PS C:\WINDOWS\system32> get-storagejob

Name     ElapsedTime JobState PercentComplete IsBackgroundTask
----     ----------- -------- --------------- ----------------
Repair       03:26:57    Running  60          False
Regeneration 03:27:00    Running  60          True

Until the regeneration and repair is complete you cannot remove the disk which is why the removal appears to hang. I actually prefer to perform the whole process using PowerShell instead of the Storage Spaces control panel applet. For example I view the storage pools, add my new disk to the pool, make the old disk as retired and trigger a repair. Once the repair is complete I remove the disk. If you are unsure of the serial number of the virtual disk to add run the Get-PhysicalDisk cmdlet.

PS C:\WINDOWS\system32> Get-StoragePool

FriendlyName OperationalStatus HealthStatus IsPrimordial IsReadOnly
------------ ----------------- ------------ ------------ ----------
Primordial   OK        Healthy      True     False     
Storage pool OK        Healthy      False    False    


PS C:\WINDOWS\system32> Get-StoragePool -FriendlyName "Storage Pool" | Add-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -SerialNumber WD-WX11D26H4PJX)

PS C:\WINDOWS\system32> Get-PhysicalDisk

FriendlyName       SerialNumber     CanPool OperationalStatus  HealthStatus Usage        Size
------------       ------------     ------- -----------------  ------------ -----        ----
WDC WD6001FZWX-00A2VA0 WD-WX11D26H4E14      False   OK         Healthy      Auto-Select   5.46 TB
NVMe Samsung SSD 950   1E15_B061_5338_2500. False   OK         Healthy      Auto-Select 476.94 GB
WDC WD60EFRX-68MYMN1            False   Lost Communication Warning      Auto-Select   5.46 TB
WDC WD6001FZWX-00A2VA0 WD-WX11D26H4PJX      False   OK         Healthy      Auto-Select   5.46 TB

PS C:\WINDOWS\system32> Set-PhysicalDisk -FriendlyName "WDC WD60EFRX-68MYMN1" -Usage Retired

PS C:\WINDOWS\system32> Get-StorageJob

Name        ElapsedTime JobState  PercentComplete IsBackgroundTask
----        ----------- --------  --------------- ----------------
AddPhysicalDisk 00:00:00    Completed 100         False       
Repair      00:00:00    Completed 100         False       

PS C:\WINDOWS\system32> Get-VirtualDisk

FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach    Size
------------ --------------------- ----------------- ------------ --------------    ----
Data     Mirror        Incomplete    Warning      False      5.45 TB

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

PS C:\WINDOWS\system32> get-storagejob

Name     ElapsedTime JobState PercentComplete IsBackgroundTask
----     ----------- -------- --------------- ----------------
Repair       04:52:51    Running  82          False
Regeneration 04:52:53    Running  82          True

PS C:\WINDOWS\system32> Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -FriendlyName "WDC WD60EFRX-68MYMN1") -StoragePoolFriendlyName "Storage Pool"

PS C:\WINDOWS\system32> Get-PhysicalDisk

FriendlyName     SerialNumber     CanPool OperationalStatus HealthStatus Usage        Size
------------     ------------     ------- ----------------- ------------ -----        ----
WD6001FZWX Top       WD-WX11D26H4E14      False   OK        Healthy      Auto-Select   5.46 TB
NVMe Samsung SSD 950 1E15_B061_5338_2500. False   OK        Healthy      Auto-Select 476.94 GB
WD6001FZWX Bottom    WD-WX11D26H4PJX      False   OK        Healthy      Auto-Select   5.46 TB

Note that the removal uses the friendly name. If you have multiple disks with the SAME friendly name then change the friendly name of the disks still present in the system via the serial number. For example below I view the disks then change the friendly name using the serial number. Note I CANNOT do this on a removed disk sinces its serial number is not available:

PS C:\WINDOWS\system32> get-physicaldisk

FriendlyName       SerialNumber     CanPool OperationalStatus  HealthStatus Usage        Size
------------       ------------     ------- -----------------  ------------ -----        ----
WDC WD6001FZWX-00A2VA0 WD-WX11D26H4E14      False   OK         Healthy      Auto-Select   5.46 TB
NVMe Samsung SSD 950   1E15_B061_5338_2500. False   OK         Healthy      Auto-Select 476.94 GB
WDC WD60EFRX-68MYMN1            False   Lost Communication Warning      Retired       5.46 TB
WDC WD6001FZWX-00A2VA0 WD-WX11D26H4PJX      False   OK         Healthy      Auto-Select   5.46 TB

PS C:\WINDOWS\system32> get-physicaldisk -serialnumber WD-WX11D26H4E14 | set-physicaldisk -NewFriendlyName "WD6001FZWX Top"
PS C:\WINDOWS\system32> get-physicaldisk

FriendlyName       SerialNumber     CanPool OperationalStatus  HealthStatus Usage        Size
------------       ------------     ------- -----------------  ------------ -----        ----
WD6001FZWX Top     WD-WX11D26H4E14      False   OK         Healthy      Auto-Select   5.46 TB
NVMe Samsung SSD 950   1E15_B061_5338_2500. False   OK         Healthy      Auto-Select 476.94 GB
WDC WD60EFRX-68MYMN1            False   Lost Communication Warning      Retired       5.46 TB
WDC WD6001FZWX-00A2VA0 WD-WX11D26H4PJX      False   OK         Healthy      Auto-Select   5.46 TB

 

 

 

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish