There are different ways to amend the idle3 state: Western Digital issued a statement, claiming that Linux is not optimized for low power storage devices and advising to reduce logging frequency. The factory default is aggressively set to 8 seconds, which can result in thousands of head load/unload cycles in a short period of time and eventually premature failure, not to mention the performance impact of the drive often having to wake-up before doing routine I/O. Western Digital Green hard drives have a special idle3 timer which controls how long the drive waits before positioning its heads in their park position and entering a low power consumption state. Power management for Western Digital Green drives The leading -i 0 parameter indicates that hd-idle is disabled on other drives. One need to edit /etc/conf.d/hd-idle and the HD_IDLE_OPTS value, then start and enable rvice.Įxample using a 10 min idle time for /dev/sda and a 1 min idle time for /dev/disk/by-uuid/01CF0AC9AA5EAF70: Such drives can be spun down using hd-idle AUR which ships with a systemd service. This was observed with a Toshiba P300 (model HDWD120) HDD. HDIO_DRIVE_CMD(setidle) failed: Invalid argumentįor some other drives, the hdparm command is acknowledged but the drive do not respect the parameters (either APM or spin down timer). A diagnostic error message similar to the following is a good indication this is the case: Some drives do not support spin down via hdparm. WantedBy=multi-user.target Working with unsupported hardware etc/systemd/system/rvice ĮxecStart=/usr/bin/hdparm -q -S 120 -y /dev/sdb In order to issue the command when the boot is completed, just create a systemd service and enable it: This does not work with the above udev rule because it happens too early. usr/lib/systemd/system-sleep/hdparm #!/bin/shĮsac Putting a drive to sleep directly after bootĪ device which is rarely needed can be put to sleep directly at the end of the boot process. Put a script into /usr/lib/systemd/system-sleep/ and make it executable: If the configuration is lost after system suspension/hibernation, it can be reapplied using systemd-sleep. etc/udev/rules.d/les ACTION="add|change", KERNEL="sd", ATTRS="1", RUN+="/usr/bin/hdparm -B 127 /dev/%k" Reapplying configuration after wakeup For example, to apply power-saving settings to all rotational drives (hard disk with rotational head, excluding in particular solid state drives), use the following rule: Systems with multiple hard drives can apply the rule in a flexible way according to some criteria. etc/udev/rules.d/les ACTION="add", SUBSYSTEM="block", KERNEL="sda", RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/sda"īecause a disk device can be assigned randomly to a changing /dev/sd X, the disk can also be identified by its serial as explained in Udev#Identifying a disk by its serial. To make the setting persistent across reboot, one can use a udev rule: # smartctl -i -n standby /dev/sda smartctl 6.5 r4318 (local build)Ĭopyright (C) 2002-16, Bruce Allen, Christian Franke, Device is in STANDBY mode, exit(2) In this case, consider smartctl provided by smartmontools to query the device which will not wake up a sleeping disk. Invoking hdparm with the query option is known to wake-up some drives. Tips and tricks Querying the status of the disk without waking it up The device, /dev/sd X in the example, is the one you want to power off.It is also advised to wait some time so that the drive will become idle. The data was actually written to the media.The possible value depends on the disk, some disks may not support this feature. Most modern hard disk drives have the ability to speed down the head movements to reduce their noise output. Set the Automatic Acoustic Management feature. The value of 0 disables spindown, the values from 1 to 240 specify multiples of 5 seconds and values from 241 to 251 specify multiples of 30 minutes. The timeout specifies how long to wait in idle (with no disk activity) before turning off the motor to save power. Set the standby (spindown) timeout for the drive. A value of 255 completely disables the feature. Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not. Possible values are between 1 and 255, low values mean more aggressive power management and higher values mean better performance. Set the Advanced Power Management feature. Warning: Overly aggressive power management can reduce the lifespan of hard drives due to frequent parking and spindowns.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |