Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How to find out if a drive is spinning down properly.

Glorious1

Neophyte Sage
Joined
Nov 23, 2014
Messages
1,065
Joined
Aug 14, 2019
Messages
6
I'm trying to see if my disks will spin down after a period of time. So far no good. Is it possible to see which process is using the disks? Running the script I just get this.

Code:
camcontrol: error sending command
da0: UNKNOWN
ada0: SPINNING
ada1: SPINNING
ada2: SPINNING
ada3: SPINNING

can you put the shell code t the above disk check
 

johns007

Junior Member
Joined
Mar 21, 2019
Messages
17
So it seems here, that we have determined that we can't spin down idle drives. Too many variables, too many functions/daemons running especially a fully featured nas.
It's safe to say, we can put this one to rest by concluding that the drives will always be spinning. This is why i give my drives a maximum life of 5 years, even though i don't leave my nas on 24 hours a day, it's just the average used in data centres globally.
 

jones982

Newbie
Joined
Dec 1, 2020
Messages
2
So it seems here, that we have determined that we can't spin down idle drives.
I can confirm that here the disks are also spinning up even with no activity on the zfs pool (SMBv2).

I'm using this script to check the status:
Code:
#!/bin/sh

# method 1

for i in ada0 ada2; do

CM=$(camcontrol cmd $i -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r - | awk '{print $10}')
if [ "$CM" = "FF" ] ; then
echo "$i: SPINNING"
elif [ "$CM" = "00" ] ; then
echo "$i: IDLE"
else
echo "$i: UNKNOWN"
fi

done


# method 2

for i in ada0 ada2; do

smartctl --nocheck=standby /dev/$i > /dev/null 2>&1
if [ $? -ne 2 ] ; then
echo "$i: SPINNING"
else
echo "$i: IDLE"
fi

done

# to compare Start_Stop_Count

smartctl -a /dev/ada0 | grep "Start_Stop_Count"
smartctl -a /dev/ada2 | grep "Start_Stop_Count"


I spin the disks down with

camcontrol standby ada2
 
Top