Sanath Kumar
New Member
- Joined
- Jul 27, 2022
- Messages
- 2
- Thread Author
-
- #1
Below error is seen sometimes when I try to remove a disk from storagepool.
Remove-PhysicalDisk : One or more physical disks could not be removed because they are still in use.
Extended information:
The storage pool could not relocate data from one or more physical disks.
Physical Disks:
{0aa97094-5f62-4ef8-fb76-8eb66f1c11f7}
Activity ID: {9030d143-747c-4ce3-a45c-9c4e76481ac9}
At line:1 char:1
+ Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -UniqueId '60022 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..
Following is the sequence of commands that I run to remove a physicaldisk:
Set-PhysicalDisk -UniqueId '' -Usage Retired
Repair-VirtualDisk -FriendlyName LucidityVD1
Remove-PhysicalDisk -StoragePoolFriendlyName 'testSP1' -PhysicalDisks (Get-PhysicalDisk -UniqueId '' ) -Confirm:$false
This works most of the time, But sometimes fails. I am not able to find the reason why this fails.
Please Let me know the possible reasons why this could fail.
Remove-PhysicalDisk : One or more physical disks could not be removed because they are still in use.
Extended information:
The storage pool could not relocate data from one or more physical disks.
Physical Disks:
{0aa97094-5f62-4ef8-fb76-8eb66f1c11f7}
Activity ID: {9030d143-747c-4ce3-a45c-9c4e76481ac9}
At line:1 char:1
+ Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -UniqueId '60022 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..
Following is the sequence of commands that I run to remove a physicaldisk:
Set-PhysicalDisk -UniqueId '' -Usage Retired
Repair-VirtualDisk -FriendlyName LucidityVD1
Remove-PhysicalDisk -StoragePoolFriendlyName 'testSP1' -PhysicalDisks (Get-PhysicalDisk -UniqueId '' ) -Confirm:$false
This works most of the time, But sometimes fails. I am not able to find the reason why this fails.
Please Let me know the possible reasons why this could fail.
Solution
Below error is seen sometimes when I try to remove a disk from storagepool.
Remove-PhysicalDisk : One or more physical disks could not be removed because they are still in use.
Extended information:
The storage pool could not relocate data from one or more physical disks.
Physical Disks:
{0aa97094-5f62-4ef8-fb76-8eb66f1c11f7}
Activity ID: {9030d143-747c-4ce3-a45c-9c4e76481ac9}
At line:1 char:1
+ Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -UniqueId '60022 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..
Following is the sequence of commands that I run to remove a physicaldisk:
Set-PhysicalDisk -UniqueId '' -Usage Retired
Repair-VirtualDisk -FriendlyName LucidityVD1
Remove-PhysicalDisk -StoragePoolFriendlyName 'testSP1'...
- Joined
- Jul 4, 2015
- Messages
- 8,998
As it states in the error the disk is still in use. If it's just been marked retired you may just need to wait a bit, or you'll need to determine what has an open handle to it and clear the handles up. Windows does lazy writes which means even after a file copy appears to be complete it may not have actually completed. Common issue when trying to eject USB drives too
Sanath Kumar
New Member
- Joined
- Jul 27, 2022
- Messages
- 2
- Thread Author
-
- #3
Thank you for the response.As it states in the error the disk is still in use. If it's just been marked retired you may just need to wait a bit, or you'll need to determine what has an open handle to it and clear the handles up. Windows does lazy writes which means even after a file copy appears to be complete it may not have actually completed. Common issue when trying to eject USB drives too
How do I make sure that I clear all the handles to this disk so that I forcefully remove this disk? Is there some powershell command to clear all the handles?
Varadharajan K
Well-Known Member
- Joined
- May 22, 2020
- Messages
- 46
Disable storage pool and then remove disk.Below error is seen sometimes when I try to remove a disk from storagepool.
Remove-PhysicalDisk : One or more physical disks could not be removed because they are still in use.
Extended information:
The storage pool could not relocate data from one or more physical disks.
Physical Disks:
{0aa97094-5f62-4ef8-fb76-8eb66f1c11f7}
Activity ID: {9030d143-747c-4ce3-a45c-9c4e76481ac9}
At line:1 char:1
+ Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -UniqueId '60022 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..
Following is the sequence of commands that I run to remove a physicaldisk:
Set-PhysicalDisk -UniqueId '' -Usage Retired
Repair-VirtualDisk -FriendlyName LucidityVD1
Remove-PhysicalDisk -StoragePoolFriendlyName 'testSP1' -PhysicalDisks (Get-PhysicalDisk -UniqueId '' ) -Confirm:$false
This works most of the time, But sometimes fails. I am not able to find the reason why this fails.
Please Let me know the possible reasons why this could fail.
Varadharajan K
Well-Known Member
- Joined
- May 22, 2020
- Messages
- 46
Disable storage pool and then remove diskBelow error is seen sometimes when I try to remove a disk from storagepool.
Remove-PhysicalDisk : One or more physical disks could not be removed because they are still in use.
Extended information:
The storage pool could not relocate data from one or more physical disks.
Physical Disks:
{0aa97094-5f62-4ef8-fb76-8eb66f1c11f7}
Activity ID: {9030d143-747c-4ce3-a45c-9c4e76481ac9}
At line:1 char:1
+ Remove-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -UniqueId '60022 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~..
Following is the sequence of commands that I run to remove a physicaldisk:
Set-PhysicalDisk -UniqueId '' -Usage Retired
Repair-VirtualDisk -FriendlyName LucidityVD1
Remove-PhysicalDisk -StoragePoolFriendlyName 'testSP1' -PhysicalDisks (Get-PhysicalDisk -UniqueId '' ) -Confirm:$false
This works most of the time, But sometimes fails. I am not able to find the reason why this fails.
Please Let me know the possible reasons why this could fail.