xbxd/spindown-timer
Disk Nap
A timer for spinning down idle ZFS drives. It watches pool activity and waits out routine disk checks, so my storage disks can take a break when nothing needs them.
Project details
Primary language: Shell
Last commit:
Language mix
- Shell 100%
Weekly commits
Commit counts by UTC week start for the last 52 weeks.
23 commits total; busiest week: 2026-01-11 (12 commits).
README
TrueNAS Spindown Timer
Monitors ZFS pool I/O activity and automatically spins down idle hard drives after a configurable timeout period. Designed for TrueNAS SCALE v25+ with systemd support.
Features
- Monitor individual drives or entire ZFS pools
- Configurable timeout and poll intervals
- Automatic system shutdown after extended idle periods (optional)
- Resistant to S.M.A.R.T. polling interference
- Dual logging: systemd journal + file-based logs
- Survives TrueNAS updates via automatic service restoration
Quick Start (TrueNAS SCALE v25+)
# 1. Copy files to persistent storage
cp -r spindown-timer /mnt/app-data/opt/
# 2. Make scripts executable
chmod +x /mnt/app-data/opt/spindown-timer/*.sh
chmod +x /mnt/app-data/opt/spindown-timer/scripts/*.sh
# 3. Install systemd services
sudo /mnt/app-data/opt/spindown-timer/install-services.sh
# 4. Install bootstrap service (survives updates)
sudo ln -s /mnt/app-data/opt/spindown-timer/systemd/spindown-bootstrap.service \
/etc/systemd/system/spindown-bootstrap.service
sudo systemctl daemon-reload
sudo systemctl enable --now spindown-bootstrap.service
# 5. Verify services are running
sudo systemctl status spindown-media spindown-nasConfiguration
Edit wrapper scripts to modify parameters:
- Media pool:
scripts/run-spindown-media.sh - NAS pool:
scripts/run-spindown-nas.sh
Common parameters:
-t 2700- Spindown timeout (seconds)-p 600- I/O poll interval (seconds)-i pool-name- Pools to ignore-s 1800- System shutdown timeout (optional)
After changes: sudo systemctl restart spindown-media (or spindown-nas)
Monitoring
# View live logs
sudo journalctl -u spindown-media -f
sudo journalctl -u spindown-nas -f
# Or check log files
tail -f /mnt/app-data/opt/spindown-timer/logs/spindown-media.log
tail -f /mnt/app-data/opt/spindown-timer/logs/spindown-nas.logAfter TrueNAS Update
TrueNAS updates wipe systemd services. Restore with one command:
sudo ln -s /mnt/app-data/opt/spindown-timer/systemd/spindown-bootstrap.service \
/etc/systemd/system/spindown-bootstrap.service
sudo systemctl enable --now spindown-bootstrap.serviceThe bootstrap service automatically restores and starts your spindown services.
Documentation
- Systemd Setup Guide - Detailed installation, configuration, and troubleshooting
- AGENTS.md - For developers/coding agents working on this project
Compatibility
- TrueNAS SCALE v25+: Full support via systemd
- TrueNAS SCALE v24 and earlier: Use legacy init scripts (see
scripts/spindown-start--*.sh) - TrueNAS CORE: FreeBSD mode (automatically detected)
License
MIT License - See original project: https://github.com/ngandrass/truenas-spindown-timer
Credits
Based on truenas-spindown-timer by Niels Gandraß.
Systemd integration for TrueNAS SCALE v25+ compatibility.