UNRAID Hibernate Hard Drive#
Current hibernation script in use:
#!/bin/bash
# This script is used to hibernate hard drives at a specified time
# Use the date command to get the current time in "HH:MM" format
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 hard drive command
# Use the hdparm command to set all disks to sleep mode
# The -y parameter indicates setting the disk to sleep 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
webpage unassigned
plugin manages unassigned devices:
/usr/local/sbin/rc.unassigned spindown devX
UNRAID Mounting Drivers on Startup#
Current startup commands being executed:
#!/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'
Relevant Notes:
- Add
acpi_enforce_resources=lax
inMain→Flash→Unraid OS Boot
(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, activate the
Dynamix Auto Fan Control
plugin (works with theDynamix 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 to execute the command. Here, we set it to 0 so that the command is 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+