具体原因在这篇文章有解释,大意是udev内置的规则冲突导致未识别到硬盘支持APM,就忽略了相关的设置。虽然不用这个文件自己写个自启动脚本直接执行hdparm也行,但是谁让强迫症又发作了呢
解决方式是新建/etc/udev/rules.d/61-persistent-storage-custom.rules文件填入以下内容
# Import the ata_id environment values for /dev/sdb regardless of the ID_SERIAL (needed by 85-hdparm.rules) KERNEL=="sdb", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
现在硬盘终于可以停转休眠了。/etc/hdparm.conf示例设置:
/dev/disk/by-id/ata-WUH721816ALE6L4_xxxxxxx { apm = 69 spindown_time = 180 }
摘录一段西数HC550手册对APM的描述:
12.47.4 Advanced Power Management When the value in the Feature register is 05h (=Enable Advanced Power Management), the Sector Count Register specifies the Advanced Power Management level. FFh ---Aborted C0 – FEh ---The deepest power saving mode is Idle mode (the same as Disable Advanced Power Management) 80 – BFh ---The deepest power saving mode is Low power Idle mode 01 – 7Fh ---The deepest power saving mode is Low RPM Idle mode 00h ---Aborted The idle time to Low power idle mode and Low RPM idle mode vary according to the value in Sector Count register as follows: When Low power idle mode is the deepest power saving mode, Y1=(x-80h) * 5+120 [sec] (120<= Y1<=435) Y2=N/A(the device does not go to Low RPM idle mode) When Low RPM idle mode is the deepest power saving mode and the value in Sector Count register is between 40h and 7Fh, 120<=Y1<=435 [sec] (default: 120 [sec]) Y2=(x-40h) * 60 + 600[sec] (600<=Y2<=4380) When Low RPM idle mode is the deepest power saving mode and the value in Sector Count register is between 01h and 3Fh, 120<=Y1<=435 [sec] (default: 120 [sec]) Y2=600 [sec] Where x is the value in Sector Count register, y1 is the idle time to Low Power Idle mode, and y2 is the idle time to Low RPM idle mode. If Low power idle mode has already been enabled (i.e., y1 has been set) before Low RPM idle mode is enabled, y1 is preserved. If Low power idle mode is disabled (i.e., y1 has not been set yet), y1 becomes 120[sec] when Low RPM idle mode is enabled. Enabled power saving mode and idle time (y1 and y2) are preserved until Advanced Power Management is disabled, the deepest power saving mode becomes Idle mode, or new time is set. They are initialized with a hard/soft reset unless Reverting to power on defaults is disabled and the device receives a soft reset.