Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Last active May 13, 2024 16:02
Show Gist options
  • Select an option

  • Save mczerniawski/2cab3e52f745d932461034d428521a80 to your computer and use it in GitHub Desktop.

Select an option

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