Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active September 6, 2021 20:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mczerniawski/2cab3e52f745d932461034d428521a80 to your computer and use it in GitHub Desktop.
Save mczerniawski/2cab3e52f745d932461034d428521a80 to your computer and use it in GitHub Desktop.
$disks=Get-PhysicalDisk | where {$_.operationalstatus -eq 'Transient Error'}
#Set disks to retired state
$disks | Select-Object UniqueId | ForEach-Object {
Set-PhysicalDisk -UniqueId $PSItem.UniqueId -Usage Retired
}
#remove disks from pool
$disks | ForEach-Object {
Remove-PhysicalDisk -PhysicalDisks $PSItem -StoragePoolFriendlyName 'S2D on HVCL0' -Confirm:$false
}
Get-PhysicalDisk -CanPool $true | ForEach-Object{
Add-PhysicalDisk -StoragePool 'S2D on HVCL0' -PhysicalDisks $PSItem
}
#add all nvme drives to the pool (wasn't added before)
Add-PhysicalDisk -PhysicalDisks (Get-PhysicalDisk -CanPool $True) -StoragePoolFriendlyName 'S2D on HVCL0'
#set nvme as journal
Set-PhysicalDisk -FriendlyName 'NVMe INTEL SSDPECME02' -Usage Journal
#verify
Get-PhysicalDisk -FriendlyName 'NVMe INTEL SSDPECME02'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment