Windows Storage Spaces – Remove physical disk from storage pool with PowerShell

I have an Intel NUC with 8 GB as media center and Hyper-V host for a test domain controller. I attached 2 physical external disks (1x 2,5″ USB 3, 1x 3,5″ USB 2) and created a storage pool. A couple of weeks later, I bought a new 2,5″ USB 3 disk with 1 TB to replace the older USB 2.0 disk. That disk is a lot quieter than the older one.

First, attach the new disk and make sure it’s added to your storage pool. You can’t remove the physical disk from the console when it’s in use. The only option is to rename a disk:Remove-PhysicalDisk-1

Remove physical disk from the storage pool with PowerShell

Open PowerShell (as Administrator) and paste the following code:



As you can see, my drives are in a healthy state and operational. We need the FriendlyName of the device. You can use -AutoSize after ft or just use FriendlyName:

Get-PhysicalDisk | ft FriendlyName


Copy the FriendlyName of the Physical Drive you want to remove from the storage pool and use the following code:

Set-PhysicalDisk -FriendlyName “<DeviceName>” -Usage Retired


We have to repair the Virtual Disks on the drives, because some Virtual Disks are maybe located on the retired drive. Firstly, make sure you know the name of the Virtual Disk:



If your Virtual Disk names are too long for the output, you can use

Get-VirtualDisk | ft -AutoSize

Copy the FriendlyName of the first Virtual Disk and type:

Repair-VirtualDisk -FriendlyName “YourVirtualDisk”

Do this for every Virtual Disk in the storage pool. Some repairs are quick, because the Virtual Disk was not located on the drive or was very small.

Open a new PowerShell window to monitor the repairs with



Last but not least: remove the PhysicalDisk if all repairs are successfully done. Make sure that your drive is in the output of the following command:

Get-PhysicalDisk | Where-Object { $_.Usage -eq ‘Retired’}


Assign the disk to a variable:

$DiskToRemove = Get-PhysicalDisk | Where-Object { $_.Usage -eq ‘Retired’}

Find the name of the storage pool:



Delete the physical disk from the storage pool:

Remove-PhysicalDisk -PhysicalDisks $DiskToRemove -StoragePoolFriendlyName “Storage pool”

This should work! Your drive should now be deleted.


Remove-PhysicalDisk: One of the physical disks specified could not be removed because it is still in use.


If the Remove-PhysicalDisk command doesn’t work, try to remove the disk when the device is turned off, so you can see which virtual disk is using the physical drive. Turn the device off and attach the drive. I had a simple storage space on the old hard disk. I had to delete that storage space manually before the command above worked.


26 thoughts on “Windows Storage Spaces – Remove physical disk from storage pool with PowerShell

  1. Do you have a “Simple” storage space or a “Parity” storage space? I’m looking for something to remove drives from my simple storage space without losing data.


  2. I have >3TB available in my pool and i want to remove a drive holding 2,73TB. I did all the cammands… as discribed two repairs took over 5h, so i think i copied alot… but still i get:
    Remove-PhysicalDisk : One of the physical disks specified could not be removed because it is still in use.

    what shud i do…

    ps. sorry for bad english 😉


  3. I have done it all. The troubleshooting is a bit unclear. Are you suggesting put the old failed drive back in the enclosure?? I don’t have any free sata ports left on the Motherboard!


    1. Hi William,

      Try to remove (unplug) the harddisk when your server/PC is turned off, and turn the server/pc back on. Then you know which virtual disk is actually using the drive. Turn the device (server/pc) off again and plug the harddisk back in. Migrate the data from the virtual disk that is in use to another virtual disk and remove the old virtual disk. My virtual disk was quite small, so I was able to migrate the data to another virtual disk.

      Is that possible for your environment?


      1. THANKS so much for the reply. I have done all the tricks and tips from every article I could find including Jose Barreto’s blog. When I started this whole debacle I had like TRULY Just a Bunch Of Disks!! 1- 4Tb, 2- 500Gb, 1- 1Tb(which is the one that went bad), and 1- 2Tb. I used the TechNet article and Brien Posey’s to use as the main guides. I put another 4Tb in checked firmware and all the stuff mentioned by everyone. Brien even was kind enough LIKE YOURSELF to answer an email and suggested the “trick” of running the PS commands which fail then immediately use Storage Spaces GUI to right click and “remove” the Physical Disk……. NO DICE I canNOT get rid of that sucker no matter what. As you suggest it IS already removed from the computer and it’s under my arm as we speak. I KNOW someone somewhere out there HAS the magic command to make it go away and allow the Virtual Disk(which shows up) to “attach) there WAS another Virtual Disk and it has attached just peachy. There was nothing special about the other one. I had an issue with an “object” that couldn’t be removed while fooling around with the new Remote Desktop on 2012R2 and emailed Freek Bearson about it. He knew of it like everybody knows about this Physical Disk not removing deal but I managed to somehow get through to a MS Engineer who gave me a WMI script to run through the WMI Management console and sure enough: gone!! I DID use thin provisioning which I now read some bad things about. There was only a total of 576Gb of data so space is not the issue. I’m luckier than most in that I DO have a DPM backup of the Virtual Volume that is only 2 days old. I just did not want to nuke everything, recreate things and “restore” the volume from the backup IF I did not need to as there is no real guidance out there on that. THANKS again for listening, guess I’m gonna wing it on deleting everything, recreate, then “restore” from the DPM backup…..probably REALLY mess things up and have to rebuild the server!!! I just get SO bound up that nobody has an answer to a question many many have asked and they are still active in a lot of forums. THX


      2. Hi…

        i got same problem but different error…

        Remove-PhysicalDisk : One or more physical disks are not in the pool.
        Activity ID: {48f65220-ec54-49fa-9676-99d5ac100caa}
        At line:1 char:1
        + Remove-PhysicalDisk -PhysicalDisks $Disk -StoragePoolFriendlyName “St …
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/…_StorageCmdlets) [Remove-PhysicalDisk], CimException
        + FullyQualifiedErrorId : StorageWMI 51006,Remove-PhysicalDisk

        Should i shutdown the server and unplug the retired disk? could this happened safely without affecting the entire system? FYI, my server is in clustered mode and it sit down in a single pool with 4 virtualdisk.

        I want to take out 8 HDD in my SOFS Server and use it in another server. FYI, all 8 hdd was added recently


  4. Hi Jean-Paul,

    I want to remove one a physical disk ; and then replace it by a new one ; but I am afraid there may be issues during the “repair” process. For example what if there is a bad-block ? It would be best to have a combined “Retire & Repair” operation ; so the disk being retired would still be used ; if needed ; in case of bad-block.

    Do you know if there is such a possibility ?



    1. Hi Gregory,

      I think that this should not be a problem, because you have to move your storage pool manually to one of your new disks. So first insert your new disk, add the disk to your storage pool and when your old disk has a bad block, your data is still save. I guess that you can take it out of the storage pool and check afterwards on the same server? Or you have to insert the old disk into another system and check for failures with that machine.

      Good luck and let me know if this works for you!




  5. Hi Jean-Paul and many thanks for your article.
    I’m doing some test on a microserver to be prepared when i setup things in the real world 🙂

    I’m trying to simulate a safe remove scenario without a replacement, using virtual disk with resilency on Parity.
    I followed your instruction, but the repair operation fails.

    Here are the steps i tryed:
    – Connected a series of physical disks (using USB external disks and raid external disks)
    – Created a storage pool with these disks, getting a total space of about 5TB.
    – Created a new Thin Virtual Disk with resiliency mode on parity.
    – Copied on the new virtual disk some files (20Gb of data)
    – Set one physical disk to retired. I’ts a 500Gb disk.
    – In the pool there are a total of 5 physical disks, 4 are still active and there is a lot of space available (the pool is 5TB in size)
    – When i run the repair command i get this error:
    Repair-VirtualDisk : Failed
    At line:1 char:1
    + Repair-VirtualDisk -FriendlyName Media
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/…SFT_VirtualDisk) [Repair-VirtualDisk], CimEx
    + FullyQualifiedErrorId : StorageWMI 4,Repair-VirtualDisk

    Can you help me?


  6. Hello Jean-Paul,

    I try to arrange your instructions to remove an old hard drive and replace it with a new one.
    (It is a Simple Volume on them)

    But with the command “Repair Virtual Disk -FriendlyName” Your Virtual Disk “” he springer always 100% and does not move data …

    Do you have a tip for me?


    (Translated with Google ;o) )


  7. Worked like a charm thanks man. Was searching everywhere how to remove the failed disk that still showed as lost communication even though storage pool was healthy and no repair jobs were running. The GUI is horrible and kept locking up on me so Power Shell was a must. Cheers!


      1. Well I tried all this on Windows 10 but the drives are just stuck. My storage space is saying it’s 37.8 TB but I have 5 – 3TB drives stuck in Waiting for removal”. Once you set a drive for removal – even with space – you can’t do more than 1 or 2 at at a time. I can’t get the Virtual attached even though it says healthy. I can’t take the drives out – even powered off – I get the message too many drives are disconnected or retired. There has to be a way. I’m in parity, drives moved what appears to be all the data; 6 – 99+% filled 3TB drives, 1 – 4TB @ 94% and a 5 TB and 1 TB @ 50 %. I have 5 – 3 TB drives stuck and the storage space is dead. I have to find a way – it has my entire movie collection on it and the disks are spread amongst my 4 kids on the other side of the country. HELP – PLEASE! Thanks, Tom


      2. Hi Tom,

        That doesn’t sound good. I must say that I haven’t used Storage Spaces anymore. Most of my data is in the cloud now. Is it possible to just create a new pool with the remaining drives and start from scratch?


      3. That’s going to be a last resort. I have 14 TB of data and I would like to recover most of it before I blow it away.


  8. Used to have a drive “R:” then one drive failed, I removed and installed a new drive. Can get it to recover. Now I have done so many different things, I don’t know where I am at. Can you have a look?

    PS C:\Users\jroy> Get-PhysicalDisk

    FriendlyName SerialNumber MediaType CanPool OperationalStatus HealthStatus Usage
    ———— ———— ——— ——- —————– ———— —–
    TS256GSSD320 A28045136932180100BE SSD False OK Healthy Auto-S…
    ST2000DM 001-1CH164 SCSI Disk Device W241B0JW Unspecified False OK Healthy Auto-S…
    ST2000DM 001-1CH164 SCSI Disk Device Unspecified False Lost Communication Warning Retired
    ST2000DM001-1CH164 Z2F0SHLV Unspecified False OK Healthy Auto-S…
    ST2000DM 006-2DM164 SCSI Disk Device Unspecified False Lost Communication Warning Auto-S…

    PS C:\Users\jroy> Get-PhysicalDisk | ft FriendlyName

    ST2000DM 001-1CH164 SCSI Disk Device
    ST2000DM 001-1CH164 SCSI Disk Device
    ST2000DM 006-2DM164 SCSI Disk Device

    PS C:\Users\jroy> Set-PhysicalDisk -FriendlyName “ST2000DM 001-1CH164 SCSI Disk Device” -Usage Retired
    Set-PhysicalDisk : Access denied
    Activity ID: {24ee45ff-9093-4516-830b-2a2034dd141d}
    At line:1 char:1
    + Set-PhysicalDisk -FriendlyName “ST2000DM 001-1CH164 SCSI Disk Device” …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : PermissionDenied: (StorageWMI:ROOT/Microsoft/…_StorageCmdlets) [Set-PhysicalDisk], CimException
    + FullyQualifiedErrorId : StorageWMI 40001,Set-PhysicalDisk

    PS C:\Users\jroy> Get-VirtualDisk

    FriendlyName Usage MediaType ResiliencySettingName PhysicalDiskRedundancy OperationalStatus HealthStatus IsManualAttach Size FootprintOnPool StorageEfficiency
    ———— —– ——— ——————— ———————- —————– ———— ————– —- ————— —————–
    My First Space Data Unspecified Parity 1 Detached Unhealthy False 3.63 TB 40.25 GB 9,236.02 %

    PS C:\Users\jroy> Repair-VirtualDisk -FriendlyName “My First Space”
    Repair-VirtualDisk : Access denied
    Activity ID: {a3817be8-91a9-467f-8928-0bb889bcd9e0}
    At line:1 char:1
    + Repair-VirtualDisk -FriendlyName “My First Space”
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : PermissionDenied: (StorageWMI:ROOT/Microsoft/…SFT_VirtualDisk) [Repair-VirtualDisk], CimException
    + FullyQualifiedErrorId : StorageWMI 40001,Repair-VirtualDisk

    PS C:\Users\jroy>


  9. Hello Sir,

    The repairing of the StoragePool does not work.

    PS U:\> Repair-VirtualDisk -FriendlyName “StorgaepoolVD”
    Repair-VirtualDisk : Failed
    At line:1 char:1
    + Repair-VirtualDisk -FriendlyName “StorgaepoolVD”
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/…SFT_VirtualDisk) [Repair-VirtualDisk], CimEx
    + FullyQualifiedErrorId : StorageWMI 4,Repair-VirtualDisk

    It’s the correct StoragePool Name – StorgaepoolVD that’s how it was created with the mis-spelled name.

    While removing the Failed Disk from the Pool. It has already been replaced with the new one but still the VD says as Degraded and this Disk shows up Lost Communication.

    PS U:\> Get-PhysicalDisk | select -Index 13 | fl

    ObjectId : {1}\\XXXXXX\root/Microsoft/Windows/Storage/Providers_v2\SPACES_Phy
    PassThroughClass :
    PassThroughIds :
    PassThroughNamespace :
    PassThroughServer :
    UniqueId :
    AllocatedSize : 536870912
    BusType : Unknown
    CannotPoolReason : In a Pool
    CanPool : False
    Description :
    DeviceId :
    EnclosureNumber :
    FirmwareVersion :
    FriendlyName : PhysicalDisk-1
    HealthStatus : Warning
    IsIndicationEnabled :
    IsPartial : False
    LogicalSectorSize : 0
    Manufacturer :
    MediaType : HDD
    Model :
    OperationalStatus : Lost Communication
    OtherCannotPoolReasonDescription :
    PartNumber :
    PhysicalLocation :
    PhysicalSectorSize : 0
    SerialNumber :
    Size : 299305533440
    SlotNumber :
    SoftwareVersion :
    SpindleSpeed : 0
    SupportedUsages : {Auto-Select, Manual-Select, Hot Spare, Retired…}
    Usage : Retired
    PSComputerName :

    When I try to remove the Physical Disk it says – It’s in Use.

    Is there any FIX that Microsoft has released?

    PS U:\> Remove-PhysicalDisk -PhysicalDisks $brokendisk -StoragePoolFriendlyName StoragePool
    Remove-PhysicalDisk : One of the physical disks specified could not be removed because it is still in use.
    At line:1 char:1
    + Remove-PhysicalDisk -PhysicalDisks $brokendisk -StoragePoolFriendlyName StorageP …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (StorageWMI:ROOT/Microsoft/…_StorageCmdlets) [Remove-PhysicalDisk], CimException
    + FullyQualifiedErrorId : StorageWMI 51004,Remove-PhysicalDisk



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s