Unraid: Automating Server Sleep And Wake Functions

will unraid wake and sleep the server

Unraid server users can put their servers to sleep and wake them up when required. This can be done by setting up Sleep (S3) and Wake on Lan (WOL) on the Unraid server. Users can also install the S3 sleep plugin or the Dynamix Sleep plugin to automate the process. However, some users have reported issues with the server not waking up after going to sleep. To avoid this, users can enable Wake On Lan in the BIOS and use a separate device, such as a phone or a Raspberry Pi, to send a wake packet to the server when they want it to turn on.

shunsleep

The Dynamix Sleep plugin

To use the Dynamix Sleep plugin, your Unraid system must be running version 6.9 or later. The plugin is installed through the Community Applications manager, which is the easiest way to install plugins on Unraid.

Once installed, the plugin adds a "Monitor disks outside array" feature, which allows users to enter all the drives they want to monitor. It's important to note that the plugin does not recognise the array correctly, so users might need to adjust their settings to ensure the plugin functions as intended.

Additionally, the server will require a Wake-on-LAN (WoL) packet from an external device to wake up. This can be sent from a phone, a Raspberry Pi, or even a router. The server can be set up to sleep to an S3 state and then wake up to a Magic Packet.

Overall, the Dynamix Sleep plugin provides a convenient way for Unraid users to save power and reduce their server's idle time by automatically putting it to sleep when not in use and waking it up when activity resumes.

shunsleep

Wake on LAN

In computers capable of Wake-on-LAN, the NICs (Network Interface Controllers) listen for incoming packets even when the rest of the system is powered down. If a magic packet arrives and is addressed to the device's MAC address, the NIC signals the computer's power supply or motherboard to awaken. This has the same effect as pressing the power button.

shunsleep

BIOS settings

To set up an Unraid server to wake up from a shutdown or sleep state, you need to send a "magic packet" over the network. This magic packet is a unique data packet that includes the target computer's media access control (MAC) address and network broadcast address, as well as the WoL configurations. It can be sent from any computer on the same network or even from a smartphone with the appropriate software.

To set up Wake-on-LAN (WOL), you must ensure that your hardware and software meet certain requirements. Your network interface controller (NIC) must support WOL, and your chipset and BIOS must have a setting for WOL that is enabled. The BIOS option for WOL is typically found in the power management menu, but the specific location varies depending on the BIOS.

In the BIOS settings, you can review and adjust the allowable sleep states. For example, on a motherboard with an ACPI Suspend Type setting, you can choose between suspending to S1 or S3 sleep state. Additionally, you can enable Wake-on-LAN in the BIOS to ensure that the server wakes up when a magic packet is received.

  • Connect the Unraid server to a power outlet and your local area network (LAN) via a network cable.
  • Access the server using the Web terminal in the WebGUI or by SSHing into the server.
  • Identify the IP address and MAC address of the network interface card by typing "ifconfig".
  • Type "ethtool -s eth0 wol g" to enable Wake-on-LAN.
  • Trigger the sleep state by typing "echo -n mem > /sys/power/state".

You can then wake up the Unraid server by pressing a key on an attached keyboard, pressing the power button, or sending a magic packet to trigger Wake-on-LAN.

shunsleep

Wake-on-Magic Packet

Wake-on-LAN (WoL) is an Ethernet or Token Ring computer networking standard that allows a computer to be turned on or awakened from sleep mode by a network message. The message is usually sent to the target computer by a program executed on a device connected to the same local area network (LAN). It is based on AMD's Magic Packet Technology, which was co-developed by AMD and Hewlett-Packard and proposed as a standard in 1995.

A "magic packet" is a small amount of data specific to the MAC address of the network card. It contains FF FF FF FF FF FF (six instances of the largest possible byte value) followed by sixteen instances of the card's six-byte MAC address. The sequence can appear anywhere within the frame, so the packet can be sent over any higher-level protocol. Usually, UDP is used, but sometimes raw frames with EtherType 0x0842 are used. The magic packet is sent to all computers in a network, and the computer with the corresponding MAC address will turn on.

To enable Wake-on-Magic Packet for an Unraid server, you need to confirm that the setting for "Wake-on" includes a 'g' option, which stands for allowing Wake-on-Magic Packet. Additionally, you can generate a Wakeup.bat batch file or download one from the Unraid forums. You will need to enter the MAC address of your Unraid server and change the folder directory as necessary.

It is important to note that some users have reported issues with their systems misbehaving after the second or later sleep, so it is recommended to test the sleep and wake-up functions thoroughly.

shunsleep

Spin-down drives

Unraid server users have the option to set up their servers to sleep and wake up when required. This can be done by setting up Sleep (S3) and Wake on Lan (WOL). The process involves reviewing BIOS settings on the Unraid server for allowable sleep states, generating a Wakeup.bat batch file, and placing it on the desktop for easy access.

However, there are also considerations to keep in mind when spinning down drives. One user reported that they do not spin down their cache drive as it is useless. Additionally, some users have reported issues with their systems misbehaving after the second or later sleep, so it is important to test the sleep and wake-up functions to ensure they work correctly.

To set up spin-down drives for an Unraid server, users can follow the steps outlined in the Unraid forums. These steps include reviewing the BIOS settings, generating a batch file, and placing it in the appropriate folder directory. The drives line in the batch file needs to be edited to reflect the drives that the user wants to check for status (idle or spinning). Additionally, timeout and count timers can be set to delay the server sleep after the spin-down, with the default value set to five minutes.

Frequently asked questions

To set up sleep and wake on LAN for your Unraid server, you need to enable Wake on LAN in the BIOS settings. You can then use a Wakeup.bat batch file to wake up your server. Alternatively, you can use a smartphone, a Raspberry Pi, or your router to send a "magic packet" to wake up the server.

Yes, you can automate the sleep and wake schedule for your Unraid server by using a separate machine with tools like Home Assistant and Node-Red on a Raspberry Pi. You can also use the Dynamix Sleep plugin to schedule sleep and wake times.

Here are some tips for setting up sleep and wake on your Unraid server:

- Review the BIOS settings on your Unraid server for allowable sleep states.

- Ensure that your motherboard supports the sleep and wake functionality.

- Test the sleep and wake functions to ensure they work correctly.

- Consider the impact on hardware and power consumption when frequently shutting down and turning on your server.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment