不休眠的原因是,pve一直在监控硬盘运行情况。
第一步:找到硬盘UUID,不建议使用sda这种,容易乱
root@pve:~# ls -l /dev/disk/by-uuid #或者lsblk -f更好 total 0 lrwxrwxrwx 1 root root 10 Apr 10 23:21 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -> ../../dm-4 lrwxrwxrwx 1 root root 10 Apr 10 23:21 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -> ../../dm-5 lrwxrwxrwx 1 root root 10 Apr 10 23:21 xxxxxxxx55340510876 -> ../../sdb3
第二步:关闭监控
nano /etc/lvm/lvm.conf
增加 “r|/dev/sdd.*|” 到 global_filter
格式为:”r|/dev/disk/by-id/ata-WDC_WD40EZAZ-00SF3B0_WD-WX32DA0HYCR7.*|”
多个硬盘实际案例
多个硬盘实际案例 devices { # added by pve-manager to avoid scanning ZFS zvols global_filter = ["r|/dev/disk/by-id/ata-ST1000LM035-1RK172_WC01X4Z4.*|","r|/dev/disk/by-id/dev/disk/by-id/ata-ST1000LM035-1RK172_WC01X4Z4.*|"] } global_filter = ["r|/dev/disk/by-id/ata-ST1000LM035-1RK172_WC01X4Z4.*|","r|/dev/disk/by-id/dev/disk/by-id/ata-ST1000LM035-1RK172_WC01X4Z4.*|"]devices { # added by pve-manager to avoid scanning ZFS zvols global_filter=["r|/dev/zd.*|"] }
update-initramfs -u #应用系统改变并重启
第三步,要处理休眠时间,设定硬盘在多久进入休眠状态。
nano /etc/hdparam.conf
spindown_time是多少分钟后休眠 实际案例: /dev/disk/by-id/ata-ST1000LM035-1RK172_WC01X4Z4 { apm = 127 acoustic_management = 127 spindown_time = 20 } /dev/disk/by-id/ata-ST2000DM006-2DM164_Z4ZABNR8 { apm = 127 acoustic_management = 127 spindown_time = 45 }