How to bring a REFS volume online again if it get’s offline and alert about it.

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!" 

 }
     

 }

 

2 thoughts on “How to bring a REFS volume online again if it get’s offline and alert about it.

  • September 6, 2021 at 10:14 am
    Permalink

    Ta for the script … we have the same issue, although a server reboot seems to have helped somewhat. Did you ever find the cause?

    Reply
    • September 6, 2021 at 2:47 pm
      Permalink

      No we never did find the solution for it.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *