UNRAID Hibernate Hard Drive#
Currently used hibernation script:
#!/bin/bash
# This script is used to hibernate hard drives at a specified time
# Use the date command to get the current time in the format "HH:MM"
current_time=$(date "+%H:%M")
# Set the time to hibernate the hard drives
sleep_time="23:05"
# Check if the current time is equal to the preset sleep time
if [ "$current_time" == "$sleep_time" ]; then
# If the current time is equal to the preset time, execute the hibernate command for the hard drives
# Use the hdparm command to set all disks to hibernate mode
# The -y parameter indicates hibernation mode
for disk in /dev/sd?; do
/usr/local/sbin/rc.unassigned spindown $disk
done
# Output a log indicating that the hard drives have hibernated
echo "Hard drives have hibernated, time: $current_time"
else
# If the current time is not equal to the preset time, output a log and exit
echo "Current time: $current_time, not yet time to hibernate: $sleep_time"
fi
ps. UNRAID
web page unassigned
plugin manages unassigned devices:
/usr/local/sbin/rc.unassigned spindown devX
UNRAID Mounting Drivers on Startup#
Currently executed startup commands:
#!/bin/bash
#fans
sleep 15s
modprobe it87 force_id=0x8628
#docker
sleep 1m
docker start frpc
#auto fan
sleep 15s
/usr/local/emhttp/plugins/dynamix.system.autofan/scripts/rc.autofan 'start'
Related Notes:
- In
Main→Flash→Unraid OS Boot
addacpi_enforce_resources=lax
(Added once and not sure if it is necessary) UNRAID
uses theN5105
motherboard and needs to load the fan drivermodprobe it87 force_id=0x8628
- After loading the driver, the
Dynamix Auto Fan Control
plugin needs to be activated (works withDynamix System Temperature
plugin to implementPWM controller
)/usr/local/emhttp/plugins/dynamix.system.autofan/scripts/rc.autofan 'start'
UNRAID Scheduled Shutdown#
#!/bin/bash
# This is a bash script to shut down the Unraid server
# Use the shutdown command to shut down the server.
# The -h parameter indicates to halt the power after the system shuts down.
# The number after the + sign indicates the number of minutes after which the command will be executed. Here, we set it to 0 so that the command will be executed immediately.
shutdown -h +0
UNRAID Scheduled Startup#
#!/bin/bash
# Wake up UNRAID through router network
# Start Unraid
/usr/bin/etherwake -D -i "br-lan" "MAC address"
UNRAID Commands#
- Start virtual machine
virsh start DS920+