Here you go. That's one of the disk on the pool (there's 6 of them)
The
-d atacam -n standby
you see is a try I made when I saw that reading smart values for one of the pool drive was spinning up the disk again (and that -d might be required to avoid smartcl to spin up the drive to find its kind). But it does not change a thing since it is overriden (I guess) by the smartd.conf.
Code:
/dev/ada1 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py\
-s S/../../(3)/(03)\
-d atacam -n standby
For the moment, I run the script directly from the terminal. The script itself is located at
/root/scripts/freenas-spindown-timer/spindown_timer.sh
.
The system dataset is on the boot pool, and I have no VM running nor shares being accessed. I left no other machine running other than the NAS itself to be sure and the disks were spinning up after a while.
One curious thing I noted is that the drives actually spin up around the 5 minutes most of the time. I set the standby timer in the script to 2 minutes to do some tests, and the drives did come up at regular interval around a multiple of 5 minutes (5, 10, 15 etc). Smart reads occur every 5 minute on my NAS so I bet this is related
Also, If I'm not using the script and use the standard TrueNAS implementation, the drives also spin up around the same time mark. So I guess this is not related to your script, but rather to the
-d removable -n never
that TrueNAS put in the smartcld.conf that will probably spin up the drive every time a smart read is executed...
One thing to be noted is that my drives are not in the smartcl database, so maybe smartd is doing something that wakes the drives on every read whereas that information would come from the database on a standard drive ?
Code:
=== START OF INFORMATION SECTION ===
Device Model: TOSHIBA HDWQ140
Serial Number: 80VVK49HFAYG
LU WWN Device Id: 5 000039 a3c602251
Firmware Version: FJ1M
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Mar 3 20:32:15 2021 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled