我正在使用 hdparm 在 5 分钟后自动关闭硬盘。我使用这个配置:
# cat /etc/hdparm.conf
quiet
/dev/disk/by-id/ata-WDC_WD10EADS-00L5B1_WD-WCAU46879161 {
spindown_time = 60
write_cache = off
}
/dev/disk/by-id/ata-WDC_WD10EADS-00L5B1_WD-WCAU4D923086 {
spindown_time = 60
write_cache = off
}
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF604MR2A0PYP {
spindown_time = 60
write_cache = off
}
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF604MR2BDA3P {
spindown_time = 60
write_cache = off
}
第一个是系统驱动器,它永远不会进入睡眠状态,这没关系。
两个 Hitachi 硬盘将按预期进入睡眠状态,但第二个 WD 硬盘永远不会自动进入睡眠状态:
# hddtemp /dev/sd[abcd]
/dev/sda: WDC WD10EADS-00L5B1: 37°C
/dev/sdb: WDC WD10EADS-00L5B1: 32°C
/dev/sdc: Hitachi HDT721010SLA360: drive is sleeping
/dev/sdd: Hitachi HDT721010SLA360: drive is sleeping
但我可以手动强制进入睡眠模式:
# hdparm -Y /dev/sdb
/dev/sdb:
issuing sleep command
# hddtemp /dev/sd[abcd]
/dev/sda: WDC WD10EADS-00L5B1: 37°C
/dev/sdb: WDC WD10EADS-00L5B1: drive is sleeping
/dev/sdc: Hitachi HDT721010SLA360: drive is sleeping
/dev/sdd: Hitachi HDT721010SLA360: drive is sleeping
它出什么问题了?如何让自动睡眠工作?
答案1
WD Green HDD 似乎有问题。我找到了 hdparm 的替代方案:高清空闲
在 /etc/default/hd-idle 中我设置了这些参数:
START_HD_IDLE=true
HD_IDLE_OPTS="-a /dev/disk/by-id/ata-WDC_WD10EADS-00L5B1_WD-WCAU4D923086 -i 180 -a /dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF604MR2A0PYP -i 180 -a /dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF604MR2BDA3P -i 180 -l /var/log/hd-idle.log"
现在,除系统驱动器之外的所有驱动器都将正确睡眠。