Hard Drives Sleeping Constantly TOS_ARM2.0_5.1.73
Posted: 03 Mar 2026, 02:14
I did some troubleshooting on this issue. My 4 drive RAID5 (TRAID) kept sleeping and at the same time loosing the SMB connections. I am not sure if I have this completely grounded, but here is my report on the matter.
# TerraMaster Bug Report: Drives sleep continuously when "Hard Drive Sleep" set to "Never"
## Device & Firmware
- **Model:** TerraMaster F4-212
- **TOS Version:** TOS_ARM2.0_5.1.73
- **Drives:** 2x WD Red Plus WD80EFPX 8TB, 2x Seagate IronWolf ST8000VN004 8TB
- **Configuration:** RAID 5 (md0), ext4
## Summary
When "Hard Drive Sleep" is set to **"Never"** in Control Panel > Hardware & Power > Hardware, all drives are continuously put to sleep and woken up every few seconds. This makes the NAS unresponsive over SSH and SMB, effectively unusable.
## Symptoms
- NAS becomes unreachable over the network after a short period
- `dmesg` shows hundreds of "waking up from sleep" messages across all drives (ata1-ata4), occurring every few seconds continuously
- `hdparm -C /dev/sdX` shows all drives in "standby" state
- Process monitoring (`ps aux`) catches repeated `hdparm -Y /dev/sdX` commands being spawned on all drives every few seconds
## Root Cause 1: Bug in `/etc/tos/scripts/spindown`
The spindown script reads `standby=0` from `/etc/tos/standby.conf` (the value written by TOS when "Never" is selected). However, the `case` statement has no handler for `0`:
```bash
case $standby in
30m)
hdd_standby_timeout 241
;;
1h)
hdd_standby_timeout 242
;;
3h)
hdd_standby_timeout 246
;;
5h)
hdd_standby_timeout 250
;;
*)
hdd_standby_timeout 251
;;
esac
```
Because `0` does not match any named case, it falls through to the `*` default, which calls `hdd_standby_timeout 251` — setting a ~30-minute standby timer via `smartctl -s standby,251` on every drive. This means selecting "Never" actually enables an aggressive sleep timer.
### Suggested fix
Add a `0)` case:
```bash
case $standby in
0)
logger -t "standby" "standby disabled"
exit 0
;;
30m)
...
```
## Root Cause 2: Unknown process spamming `hdparm -Y`
Independent of the spindown script, an unidentified TOS process continuously spawns `hdparm -Y /dev/sdX` (full drive sleep) on all drives every few seconds. This was captured via process monitoring:
```
hdparm -Y /dev/sda
hdparm -Y /dev/sdb
hdparm -Y /dev/sdc
hdparm -Y /dev/sdd
```
These commands repeat on all drives in a loop. This occurs even after:
- Setting Hard Drive Sleep to "Never" in the TOS web UI
- Both `/tmp/TOS_CONFIG/standby.conf` and `/etc/tos/standby.conf` containing `standby=0`
- Disabling standby timers directly on drives via `smartctl -s standby,0`
- Disabling standby timers via `hdparm -S 0`
The parent process could not be identified — it is not `TOSDaemon` (no standby/hdparm strings in binary), `ScheduledTask`, or `ter_smartfan`.
## Workaround
Renaming the hdparm binary stops the sleep spam:
```bash
mv /sbin/hdparm /sbin/hdparm.disabled
```
This is not ideal as it must be re-applied after TOS firmware updates.
## Impact
- NAS becomes unreachable over the network (SSH, SMB, web UI all time out)
- Constant sleep/wake cycling (hundreds of times per hour) adds unnecessary wear to drives
- SMART long self-tests cannot complete if drives keep being put to sleep
- The "Never" option in the UI gives users a false sense that the setting is applied
## Date Discovered
2026-03-01
# TerraMaster Bug Report: Drives sleep continuously when "Hard Drive Sleep" set to "Never"
## Device & Firmware
- **Model:** TerraMaster F4-212
- **TOS Version:** TOS_ARM2.0_5.1.73
- **Drives:** 2x WD Red Plus WD80EFPX 8TB, 2x Seagate IronWolf ST8000VN004 8TB
- **Configuration:** RAID 5 (md0), ext4
## Summary
When "Hard Drive Sleep" is set to **"Never"** in Control Panel > Hardware & Power > Hardware, all drives are continuously put to sleep and woken up every few seconds. This makes the NAS unresponsive over SSH and SMB, effectively unusable.
## Symptoms
- NAS becomes unreachable over the network after a short period
- `dmesg` shows hundreds of "waking up from sleep" messages across all drives (ata1-ata4), occurring every few seconds continuously
- `hdparm -C /dev/sdX` shows all drives in "standby" state
- Process monitoring (`ps aux`) catches repeated `hdparm -Y /dev/sdX` commands being spawned on all drives every few seconds
## Root Cause 1: Bug in `/etc/tos/scripts/spindown`
The spindown script reads `standby=0` from `/etc/tos/standby.conf` (the value written by TOS when "Never" is selected). However, the `case` statement has no handler for `0`:
```bash
case $standby in
30m)
hdd_standby_timeout 241
;;
1h)
hdd_standby_timeout 242
;;
3h)
hdd_standby_timeout 246
;;
5h)
hdd_standby_timeout 250
;;
*)
hdd_standby_timeout 251
;;
esac
```
Because `0` does not match any named case, it falls through to the `*` default, which calls `hdd_standby_timeout 251` — setting a ~30-minute standby timer via `smartctl -s standby,251` on every drive. This means selecting "Never" actually enables an aggressive sleep timer.
### Suggested fix
Add a `0)` case:
```bash
case $standby in
0)
logger -t "standby" "standby disabled"
exit 0
;;
30m)
...
```
## Root Cause 2: Unknown process spamming `hdparm -Y`
Independent of the spindown script, an unidentified TOS process continuously spawns `hdparm -Y /dev/sdX` (full drive sleep) on all drives every few seconds. This was captured via process monitoring:
```
hdparm -Y /dev/sda
hdparm -Y /dev/sdb
hdparm -Y /dev/sdc
hdparm -Y /dev/sdd
```
These commands repeat on all drives in a loop. This occurs even after:
- Setting Hard Drive Sleep to "Never" in the TOS web UI
- Both `/tmp/TOS_CONFIG/standby.conf` and `/etc/tos/standby.conf` containing `standby=0`
- Disabling standby timers directly on drives via `smartctl -s standby,0`
- Disabling standby timers via `hdparm -S 0`
The parent process could not be identified — it is not `TOSDaemon` (no standby/hdparm strings in binary), `ScheduledTask`, or `ter_smartfan`.
## Workaround
Renaming the hdparm binary stops the sleep spam:
```bash
mv /sbin/hdparm /sbin/hdparm.disabled
```
This is not ideal as it must be re-applied after TOS firmware updates.
## Impact
- NAS becomes unreachable over the network (SSH, SMB, web UI all time out)
- Constant sleep/wake cycling (hundreds of times per hour) adds unnecessary wear to drives
- SMART long self-tests cannot complete if drives keep being put to sleep
- The "Never" option in the UI gives users a false sense that the setting is applied
## Date Discovered
2026-03-01