Disk spindown has always been an issue for various TrueNAS / FreeNAS users. This script utilizes iostat to detect I/O operations (reads, writes) on each disk. If a disk was neither read nor written for a given period of time, it is considered idle and is spun down.
Periodic reads of S.M.A.R.T. data performed by the smartctl service are excluded. This allows users to have S.M.A.R.T. reporting enabled while still being able to automatically spin down disks. The script moreover is immune to the periodic disk temperature reads in newer versions of TrueNAS.
For more information, installation and usage instructions as well as the most recent release, checkout the repository on GitHub: https://github.com/ngandrass/truenas-spindown-timer
Periodic reads of S.M.A.R.T. data performed by the smartctl service are excluded. This allows users to have S.M.A.R.T. reporting enabled while still being able to automatically spin down disks. The script moreover is immune to the periodic disk temperature reads in newer versions of TrueNAS.
Key Features
- Periodic S.M.A.R.T. reads do not reset the disk idle timers
- Configurable idle timeout and poll interval
- Support for ATA and SCSI devices
- Works with both TrueNAS Core and TrueNAS SCALE
- Per-disk idle timer / Independent spindown
- Automatic detection or explicit listing of drives to monitor
- Ignoring of specific drives (e.g. SSD with system dataset)
- Executable via Tasks as Post-Init Script, configurable via TrueNAS GUI
- Allows script placement on encrypted pool
- Optional shutdown after configurable idle time
For more information, installation and usage instructions as well as the most recent release, checkout the repository on GitHub: https://github.com/ngandrass/truenas-spindown-timer