UNRAID 休眠硬盘#
目前使用的休眠脚本:
#!/bin/bash
# 该脚本用于在指定时间休眠硬盘
# 使用date命令获取当前时间,格式为"HH:MM"
current_time=$(date "+%H:%M")
# 设置要执行休眠硬盘的时间
sleep_time="23:05"
# 检查当前时间是否等于预设的休眠时间
if [ "$current_time" == "$sleep_time" ]; then
# 如果当前时间等于预设时间,执行休眠硬盘命令
# 使用hdparm命令将所有磁盘设置为休眠状态
# -y参数表示将磁盘设置为休眠状态
for disk in /dev/sd?; do
/usr/local/sbin/rc.unassigned spindown $disk
done
# 输出日志,表示磁盘已休眠
echo "硬盘已休眠,时间:$current_time"
else
# 如果当前时间不等于预设时间,输出日志并退出
echo "当前时间:$current_time,未到休眠时间:$sleep_time"
fi
ps. UNRAID
网页 unassigned
插件管理未分配设备:
/usr/local/sbin/rc.unassigned spindown devX
UNRAID 开机挂载驱动#
目前执行的开机命令:
#!/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'
相关注意事项:
主界面→Flash→Unraid OS启动项
中增加acpi_enforce_resources=lax
(第一次增加后重启就没再加过 不确定是否必须)UNRAID
使用畅网N5105
主板需加载风扇驱动modprobe it87 force_id=0x8628
- 加载驱动后需要激活一下
Dynamix Auto Fan Control
插件(配合Dynamix System Temperature
插件实现PWM controller
)/usr/local/emhttp/plugins/dynamix.system.autofan/scripts/rc.autofan 'start'
UNRAID 定时关机#
#!/bin/bash
# 这是一个bash脚本,用于关闭Unraid服务器
# 使用shutdown命令关闭服务器。
# -h 参数表示在系统关闭后关闭电源(halt)。
# + 参数后的数字表示在多少分钟后执行该命令。在这里,我们设置为0,这样命令就会立即执行。
shutdown -h +0
UNRAI 定时开机#
#!/bin/bash
# 通过路由器网络唤醒 UNRAID
# 启动 Unraid
/usr/bin/etherwake -D -i "br-lan" "MAC 地址"
UNRAID 命令#
- 开启虚拟机
virsh start DS920+