HDD Sleep/Spindown/Standby

EDIT – This may be a little off-topic but with good intentions

whats wrong with unraid? yes u r right about the price, but from what i saw they have a perpetual license. if u use it a lot, i think it’s worth it. a while back actually the license price was cheaper….

Before March 27, 2024, the unlimited license for Unraid was known as the Pro license and cost $129. It was a one-time perpetual purchase that included lifetime updates.

The pricing was updated as part of a significant change to Unraid’s licensing structure. The old tier system of Basic, Plus, and Pro, which was based on the number of devices, was replaced with new license types

i just never heard any big issues mention about unraid, so not sure what ur trust issue is in regard to them.

as for truenas, i had no real reason not to use it. in fact it’s probably the best nas os i’ve ever used. the initial setup felt daunting, but after using it for a while, it’s actually quite good.

for unraid sleep mode, AI said this

Yes, Unraid can have a sleep mode in 2025, but it is not a native feature of the operating system and is dependent on your hardware. The most common and user-friendly method is to use a community plugin for Suspend-to-RAM (S3 sleep) and to manually configure Wake-on-LAN (WOL).

The core reason Unraid does not officially support sleep is that hardware and Linux kernel compatibility can vary, making a reliable out-of-the-box solution difficult to guarantee.

Method 1: Use the Dynamix S3 Sleep plugin

The most widely used approach is to install the Dynamix S3 Sleep plugin from the Community Applications store. This provides a web-based graphical interface for setting up sleep functions.

How to set up the plugin:

  1. Install the plugin: In the Unraid WebGUI, navigate to the Apps tab, search for “Dynamix S3 Sleep,” and install it.

  2. Configure settings: Go to Settings > Sleep Settings to configure idle conditions, schedules, and Wake-on-LAN (WOL) options. You can set a maximum wait time for array or network inactivity before the server goes to sleep.

  3. Use commands for customization: The plugin also allows you to run custom commands before the server goes to sleep or after it wakes up. This enables you to send notifications or prepare applications for the change in power state.

Method 2: Configure manually via the command line

For more advanced users, it is possible to configure sleep settings directly through the command line. This gives you greater control over the process.

How to set up manually:

  1. Connect to your server via the WebGUI terminal or SSH.

  2. Identify your network interface by running ifconfig and noting the device name (e.g., eth0).

  3. Enable Wake-on-LAN by using the ethtool command: ethtool -s eth0 wol g. Replace eth0 with your network interface name.

  4. Initiate sleep manually by running echo -n mem > /sys/power/state.

Important considerations and potential issues

  • Reliability: Many users report that getting sleep mode to work consistently can be a challenge. Depending on your hardware and OS version, your server might not wake up properly or may require a hard reboot.

  • Active processes: Sleep may not be feasible if you are running services that perform many background tasks, such as Plex or the *arr applications (Radarr, Sonarr, etc.), which require an “always-on” server for automation.

  • Hardware efficiency: As an alternative or supplement to sleep, consider focusing on a power-efficient hardware build. This includes using low-idle-power CPUs and configuring your hard drives to spin down when not in use.

Official Unraid 7.0 power mode feature

In early 2025, Unraid 7.0 was released and introduced a new Power Mode setting under Settings. This feature allows you to optimize the system for power efficiency, balance, or performance. While not a traditional “sleep mode,” it provides official system-wide power management options to reduce energy consumption.

$249 for the perpetual license with lifetime updates.

https://account.unraid.net/buy

i’d be happy to pay that cause i use my nas a lot, but no reason to move from truenas which i’m very comfortable with. but if u need sleep then, you want to use something else. Not sure if the unraid sleep is any good or not though :thinking:

i’m part of the 24/7 spin camp so not a big deal for me. but i can see how the sleep camp will be sad :cry:

1 Like

This topic is about hard drive spin down, not system sleep. Just saying :slight_smile:

Thanks for the license info though

No need to look at alternatives yet, they are still working on it.

But yes, it is a feature I really need, energy prices in the EU are no joke … and most of the time my spinning-rust drives are idle, frequently accessed stuff resides on a couple of SSDs.

3 Likes

Where are you seeing they are working on it?

The ticket still seems as dead as a door-nail

Can you please elaborate on your middleware hack where you add ‘-n standby’ to every smartctl call? Because just returning None in the mentioned disk_class.py function does not work for me, the disks are not staying in spin down.

It seems to me that IXsystems closed and shutdown the discussion about custom smart functionality and the ability to spin down your disks and it is more then likely that these features won’t come back. :frowning:

Eeeh … well …

It’s not closed yet? Does that count as “in progress”? :sweat_smile:

This thread is not a “Feature Request”. It will not be closed—but it will lead nowhere.

In this situation, it is not a feature request, but a bug issue.

Bug reports should be done through Jira. Again, a forum thread will lead nowhere—especially if this behaviour is actually a “feature” of iX policy.

1 Like

I was talking about the ticket … that exists but is not assigned, nor closed.

The current behavior is (seems to be) a bug, spin down works correctly, but the disks are woken by prodding of the temperature.

So I’m still hoping for a fix, or I’ll be on 25.04 for as long as that stays maintainable.

3 Likes

For those like me who finds TrueNAS the better choice, just wish it could do spindown properly for home usage, and are willing to tinker with it, here is a patch file of the changes I did to get spindown to work for me:

spindown.patch.txt (3.5 KB)

As with any such things, WARNING:

Doing this is of your own volition and
 not supported by IXsystems or me in any way.
You will likely be denied support if you
 submit a ticket with these changes applied.

Having said that, if you are familiar with Python, you will see the changes are pretty harmless.

To apply it, put it somewhere in your TN, remove the “.txt” extension, and do these commands in the shell:

cd /
sudo /usr/local/libexec/disable-rootfs-protection
sudo patch --verbose -N -p0 -i /path_to_file/spindown.patch

Must reboot afterwards.

This patch was made for 25.10.0.1

When updating your TN installation in the future, will need to reapply the patch after booting with the new TN version.

FYI, it is not just the temp monitoring that causes problems, there are other issues that either prevents the disks from spinning down, or keeps spinning it up on a frequent basis.

Keeping in mind that if the disks are not spinning for most of the time, the smart monitoring of TrueNAS may not catch any issues.

For me, in the worst case the smart alert check will run at least during the regular zfs scrubs, which is ok to me.

6 Likes

Thank you very much!

It seems to be working on my system, I will monitor it closely for the next couple of days.

My NAS

SYS: Truenas Scale 25.10.0.1
CASE: Inter-Tech 2U 2404S
UPS: CyberPower BR700ELCD
PSU: Chieftec CSN-450C 450W
MAINBOARD: ASUS PRIME Z890M-PLUS WIFI
CPU: Intel Core Ultra 5 235T
RAM: Patriot DIMM 64 GB DDR5-6400 @5600 (2x 32 GB)
NET: Intel x710 @ Pci3x4 (only one port in use)
GPU: none (Pci4x16 Slot still available)
FANS: be quiet! Pure Rock LP, 4x Fractal Design Silent Series R3 50mm

DISKS:

Truenas Boot:
Kioxia Exceria Plus G3 1 TB @ Pci4x4
SSD Mirror:
2x Kioxia Exceria Plus G3 2 TB @ Pci4x4
HDD Pool Z1:
3x Seagate Exos X18 Enterprise 16TB (with Spin-Down)
2x Samsung SSD 980 M.2 @ Pci3x1 - Mirror, Metadata Device
1x Samsung SAMSUNG 870 EVO 2 TB - L2ARC

POWER:

Idle / normal usage
(with apps running, access to files on the ssd mirror and spin-down):
~34W
Light usage with HDDs
(e.g. plex transcoding video):
45-60W
Max
(full system usage with HDDs):
~120W

Can you describe what your patch does ? I am not familiar with python, and I am not super fan of disabling ROOTFS security…

NOTE: The below information came from an AI. Use at your own risk.

@castler Please make it very clear that the data you are posting was generated from an AI. There is no issue in posting the information but if you do not know what is actually happening, then that adds a level of risk to others. AI generated code is allowed here however it must be clearly labeled as in the note above.

I’m not too familiar with python myself, so I asked qwen3 in my lmstudio to analyze the patches. This is what it came up with (there was more info I edited it to save space):

1. Changes in pool_/dataset_encryption_info.py

  • File Path: /usr/lib/python3/dist-packages/middlewared/plugins/pool_/dataset_encryption_info.py
  • Change: The @periodic(86400) decorator on the sync_db_keys method is commented out.
  • Implication:
    • The sync_db_keys method, which synchronizes encrypted pool dataset keys, was previously scheduled to run every 86,400 seconds (24 hours).
    • This change disables the periodic execution of this method.

2. Changes in utils/disks_/disk_class.py

  • File Path: /usr/lib/python3/dist-packages/middlewared/utils/disks_/disk_class.py

  • smartctl Command Update:

    • A new flag -n standby is added to the smartctl command
    • This instructs smartctl to use the “standby” mode for SMART queries, which may be more efficient or appropriate for certain disk states.
  • Temperature Monitoring Logic:

    • A new check is added to skip temperature readings if the disk is marked as standby

3. Changes in alert/source/smart.py

  • File Path: /usr/lib/python3/dist-packages/middlewared/alert/source/smart.py

  • Implication:

    • The SMART monitoring alert check now runs every 5 hours instead of every 90 minutes.

4. Changes in plugins/disk.py

  • File Path: /usr/lib/python3/dist-packages/middlewared/plugins/disk.py

  • Spindown Logic:

    • The power_management_impl method now updates a file (/var/run/middleware/standby_disks) to track which disks should be in standby mode.

That is pretty much it.

Regarding the sync_db_keys, that periodic is only needed if you do something manually outside the TN GUI, like export/import from the shell, in which case people should reload the keys manually anyway.

ZFS dataset encryption keys does not expires or unset by itself.

2 Likes

I have a script to mount an external USB encrypted pool on which I have to type the password each time.

This would not affect me then with your script.

I’ll keep an eye on your script if I have to update, but I hope iX is going to solve this problem…

Thank you so much! Works great for me! Shall we forward your patch to TN team?

If it was an intentional change by iX I doubt they care …

Clearly the change related to temperature monitoring wasn’t tested with disks set to spindown, even though it is clearly documented here Disks | TrueNAS Documentation Hub as a supported use case.

But if enough people speak about this problem, they may do something.

I get that enterprise users will be spinning their disks 24x7, but the Community Edition should support this properly for home users.

@kenator yes, sure, feel free to forward the patch.

3 Likes

Thank you!

I thought all them organizations and corporations wanted to virtue signal by at least pretending to truly save energy…

“just spend money on a more efficient CPU”, was not the right answer.

4 HDs at idle uses 25-30 watts minimum.

This will break after each TN update so we will need to stay on top of that…

Thanks again.