Powershell – How to safely swap/replace a PhysicalDisk in a Parity Storage Pool

powershellstorage-spaceswindows-server-2012-r2

I have Storage Space configured with Parity resiliency that has a total of 5 SATA drives. 4 of the drives are near full capacity (90% used).

I am now getting a low capacity warning because this. I have no more SATA ports available for additional drives (and I don't want to use USB 2.0/USB 3.0), so my plan was to replace two of the existing 2 TB drives with 3 TB drives. As well as a capacity increase, the idea is the during the rebuilding/repairing the remaining 2 TB drives will hopefully be "balanced" a bit, so their usage will be below my custom set threshold of 85%.

Storage Spaces configuration

As I have parity I can survive one disk being pulled out of the space without any data loss, however I want to perform the swap properly, rather than that simulating hard disk failure by simply pull one drive out.

What steps do I need to take to perform this task? I'm aware I'd need to use PowerShell but I'm looking for specific guidance to ensure that the swap is done correctly. I'm thinking I'll also need to do this with one disk at time, otherwise I'll lose the pool.

Best Answer

  1. Retire the disk that you want to replace:

Set-PhysicalDisk -FriendlyName 'WDC...' -Usage Retired

  1. Repair the virtual disk and distribute the remaining data from the retired disk to the healthy disks:

Repair-VirtualDisk -FriendlyName 'MOTHERSHIP'

  1. Finally, remove the retired disk:

$PDToRemove = Get-PhysicalDisk -FriendlyName 'WDC...'

Remove-PhysicalDisk -PhysicalDisks $PDToRemove -StoragePoolFriendlyName 'Media Storage'

You can't use -FriendlyName when using Remove-PhysicalDisk, instead you can store the output of Get-PhysicalDisk in a variable and pass it to Remove-PhysicalDisk, PowerShell will then convert it to the correct object for you.

You may also get a warning about fault tolerance when running this command. Providing you have resiliency, this won't cause any issues.

Then add the new disk as usual.

Related Topic