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

Share this post:

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

 }
     

 }

reference: https://jtpedersen.com/2017/08/how-to-bring-a-refs-volume-online-again-if-it-gets-offline-and-alert-about-it/

Subscribe to our newsletter

Get the inside scoop! Sign up for our newsletter to stay in the know with all the latest news and updates.

Don’t forget to share this post!

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

Leave a Comment

Scroll to Top