So we are having some issues with a REFS volume going offline, on a singel server storage pool if there is too much data being written to the volume in the morning. At the moment we have not figured out why. Disks are showing ok. Get-Physicaldisk and Get-Virtualdisk is ok. Everything says it’s healthy. And logs only show REFS being taken offline due to write error.
Now we have a scheduled task running on the server checking to see if the disk goes offline or not, and brings it online again. And also sends out an email that the volume is offline and now online again.
$status=Get-Disk | Where-Object OperationalStatus –Eq Offline
if ($status -ne $null)
Send-MailMessage -From "email address" -To "email adress" -SmtpServer IPAddressofnoauthsmtp -Subject "MasterDB Disk Offline" -Body $status
Get-Disk | Where-Object OperationalStatus –Eq Offline |set-disk -isoffline $false
Set-Disk -Number 5 -IsReadOnly $false
net start postgresql-x64-9.4
Start-Sleep -seconds 60
$status2=Get-Disk | Where-Object OperationalStatus –Eq Offline
if ($status2 -eq $null)
Send-MailMessage -From "email address" -To "email address" -SmtpServer IPAddressofnoauthsmtp -Subject "MasterDB Disk Online Now! " -Body "MasterDB Disk Online Now!"