1. PVE硬盘休眠
1.1 pvestatd
停止pvestatd硬盘守护进程(停止会导致web仪表盘失去实时统计信息,同时无法新建虚拟机)
1.2 跳过检查
/etc/lvm/lvm.conf
devices{
global_filter[]
}
# 修改为
global_filter = [ "r|/dev/sda.*|","r|/dev/sdb.*|"]
1.2 hdparm配置
vim /etc/hdparm.conf
/dev/disk/by-id/ata-ST2000DM001-1ER164_W4Z2NXZX {
apm=1
spindown_time=60
write_cache=on
}
/dev/disk/by-id/ata-WDC_WD5000LPVX-22V0TT0_WD-WX41A84H2R0D {
apm=1
spindown_time=60
write_cache=on
}
常用命令
- 查看硬盘是否休眠
smartctl -i -n standby /dev/sda |grep "mode"|awk '{print $4}'
- 查看硬盘是否支持写入缓存
sudo hdparm -I /dev/sda | grep 'Write cache'
- 让硬盘进入待机
hdparm -y /dev/sda
- 让硬盘进入睡眠
hdparm -Y /dev/sda
- 让硬盘定时休眠
# 参数为秒数
hdparm -S 60 /dev/sda
- 设置硬盘APM参数
# 设置 APM(Advanced Power Management) 参数
# 1-127允许磁盘休眠,128-254不允许,255会完全关闭电源管理功能
# 但是太激进(数值太小)也可能会容易使硬盘损坏
hdparm -B 127 /dev/sda