106 字
1 分钟
Configuring Watchdog and Automatic Hard Drive Sleep on RPi
- rpi 3b watchdog
- Automatic sleep for idle hard drives
Please modify the watchdog device based on your CPU model
hdparm
Install hdparm (omitted)
Test hdparm
sudo hdparm -y /dev/sda1If there’s no error, it’s supported
sudo hdparm -I /dev/sda1|grep cacheIf you see ”*”, caching is supported
Edit hdparm
sudo nano /etc/hdparm.confAdd
/dev/sda1 {write_cache = onspindown_time = 120}If caching isn’t supported, don’t add the write_cache line
The delay below is calculated as: idle sleep time (minutes) * 60 / 5
watchdog
Install watchdog (omitted)
Load watchdog
sudo modprobe bcm2835_wdtsudo nano /etc/modulesbcm2835_wdtEdit the configuration
sudo /etc/watchdog.confModify
max-load-1=24watchdog-device = /dev/watchdogwatchdog-timeout=20temperature-sensor = /sys/class/thermal/thermal_zone0/tempmax-temperature = 85000Start
sudo systemctl enable watchdog.servicesudo chkconfig watchdog onBonus: a fork bomb
:(){ :|: & };: Configuring Watchdog and Automatic Hard Drive Sleep on RPi
https://tski.uk/blog/en/rpi-watchdog-config/