Is there a way that OMV can report (email) by script or any other method when a disk goes into sleep mode or spin down? I searched a bit and found something for freenas, but I am not sure if this might work form OMV. I am not to familiar with the cli commands.
Code
First you need to identify the drive you want to take a look at:
Code (text):
nanotube# camcontrol devlist
<ST1500DL003-9V16L CC32> at scbus0 target 0 lun 0 (pass0,ada0)
<ST1500DL003-9V16L CC32> at scbus2 target 0 lun 0 (pass1,ada1)
<USB 2.0 Flash Drive 5.00> at scbus6 target 0 lun 0 (pass2,da0)
So on my system, ada0 and ada1 are my two harddrives that I'm interested in. I will inspect the power state of ada0.
Code (text):
nanotube# camcontrol cmd ada0 -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r -
50 00 00 00 00 40 00 00 00 FF 00
Take a look at the 10th hexadecimal value in the output. If this
says "FF", the drive is spinning, if it says "00" the drive is spun
down. It's that easy!!
I wrote a little script that checks both of my drives every 30 seconds
so I can see if they indeed fall asleep after 5 minutes like I told them
to in the GUI:
Code (text):
nanotube# cat standby_check
#!/usr/local/bin/bash
while [ 1 ]
do
ada0_out=`camcontrol cmd ada0 -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r -`
ada1_out=`camcontrol cmd ada1 -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r -`
echo "ADA0: $ada0_out -- ADA1: $ada1_out"
sleep 30
done
nanotube# ./standby_check
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 FF 00 -- ADA1: 50 00 00 00 00 40 00 00 00 FF 00
ADA0: 50 00 00 00 00 40 00 00 00 00 00 -- ADA1: 50 00 00 00 00 40 00 00 00 00 00
ADA0: 50 00 00 00 00 40 00 00 00 00 00 -- ADA1: 50 00 00 00 00 40 00 00 00 00 00
^C
nanotube#
Note how both drive started in a spun up state and after 9 checks
(4.5 minutes) they went to a spun down state (the ZFS pool had been idle
for a few seconds before I started the command).
I hope this is useful to someone out there. It beats listening with your
ear glued to the drive, in the hopes of being able to hear the moment
when the drive spins down.
Display More
more can be read here I hope someone can assist.