| 1 |
`hdapsd` - Hard Drive Active Protection System Daemon |
| 2 |
=================================================== |
| 3 |
|
| 4 |
This is a disk protection user-space daemon. It monitors the acceleration |
| 5 |
values through the various motion interfaces and automatically initiates |
| 6 |
disk head parking if a fall or sliding of the laptop is detected. |
| 7 |
|
| 8 |
Currently, the following motion interfaces are supported: |
| 9 |
* HDAPS on IBM/Lenovo ThinkPads |
| 10 |
* AMS on Apple iBooks and PowerBooks (G4) |
| 11 |
* FREEFALL on Hewlett-Packard and DELL laptops |
| 12 |
* HP3D on Hewlett-Packard laptops |
| 13 |
* APPLESMC on Apple MacBooks and MacBooks Pro (Intel) (UNTESTED!) |
| 14 |
* Toshiba HAPS and Toshiba ACPI on Toshiba laptops (UNTESTED!) |
| 15 |
* Generic input/joystick on ACER laptops (UNTESTED!) |
| 16 |
|
| 17 |
Compilation |
| 18 |
----------- |
| 19 |
|
| 20 |
./configure |
| 21 |
make |
| 22 |
make install |
| 23 |
|
| 24 |
### Configure parameters |
| 25 |
|
| 26 |
The following parameters to `./configure` are probably interesting: |
| 27 |
|
| 28 |
* `--with-systemdsystemunitdir` lets you specify the directory for |
| 29 |
systemd unit files. It defaults to the output of |
| 30 |
`pkg-config --variable=systemdsystemunitdir systemd`. |
| 31 |
* `--with-udevdir` lets you specify the directory for udev rules files. |
| 32 |
It defaults to the output of `pkg-config --variable=udevdir udev`. |
| 33 |
|
| 34 |
Packages |
| 35 |
-------- |
| 36 |
* [Arch](https://www.archlinux.org/packages/hdapsd) and [AUR](https://aur.archlinux.org/packages/hdapsd-git/) |
| 37 |
* [Debian](http://packages.debian.org/hdapsd) |
| 38 |
* [Gentoo](https://packages.gentoo.org/package/app-laptop/hdapsd) |
| 39 |
* [Slackbuilds](http://slackbuilds.org/result/?search=hdapsd) |
| 40 |
* [Ubuntu](http://packages.ubuntu.com/hdapsd) |
| 41 |
|
| 42 |
Usage |
| 43 |
----- |
| 44 |
|
| 45 |
In most cases, just running `hdapsd` as root should be enough, as it will |
| 46 |
try to autodetect everything itself. |
| 47 |
|
| 48 |
If you want to adjust stuff, these are the most commonly used options: |
| 49 |
|
| 50 |
* `--cfgfile` which allows to load a configuration from a file. |
| 51 |
* `--device` which device to protect, e.g. `--device=sda`. Defaults to |
| 52 |
autodetection of all rotating devices. |
| 53 |
* `--sensitivity` adjusts the sensitivity of the algorithmus. Defaults to 15. |
| 54 |
* `--adaptive` enables adaptive mode, where `hdapsd` adjusts the sensitity |
| 55 |
while the mouse and keyboard are used. |
| 56 |
* `--background` sends `hdapsd` into the background as a daemon. |
| 57 |
|
| 58 |
For more options, please read `man hdapsd`. |
| 59 |
|
| 60 |
systemd and udev integration |
| 61 |
---------------------------- |
| 62 |
|
| 63 |
`hdapsd` comes with `systemd` and `udev` integration. This means when those two |
| 64 |
are found on your system, `misc/[email protected]` and `misc/hdapsd.rules` are |
| 65 |
installed and used. `udev` will start one `hdapsd` instance for each |
| 66 |
rotational, non-removable disk it finds. |
| 67 |
|
| 68 |
If you want to disable this automation for a certain disk, you can mask |
| 69 |
the `systemd` unit by calling: |
| 70 |
|
| 71 |
systemctl mask hdapsd@sdX |
| 72 |
|
| 73 |
If you want to disable this automation at all, you can create an empty |
| 74 |
`/etc/udev/rules.d/hdapsd.rules`, which will override the system-installed |
| 75 |
udev rule. You can still enable `hdapsd` for certain devices by creating |
| 76 |
`[email protected]` symlinks in `/etc/systemd/system/multi-user.target.wants/` |
| 77 |
|
| 78 |
If you want to customize the parameters `hdapsd` is using, you can edit |
| 79 |
`/etc/hdapsd.conf` (preferred) or by customizing `[email protected]` in |
| 80 |
`/etc/systemd/system/`. |
| 81 |
|
| 82 |
As an alternative, you could also use `misc/hdapsd.service`, which you'd |
| 83 |
have to install yourself. This unit will just start `hdapsd` the same way |
| 84 |
good old `sysvinit` would do. |
| 85 |
|
| 86 |
Compatibility |
| 87 |
------------- |
| 88 |
Since kernel 2.6.28 you don't need to patch your kernel, as support for |
| 89 |
IDLE_IMMEDIATE is present in mainline. |
| 90 |
|
| 91 |
**NOTE**: The new interface only allows IDLE_IMMEDIATE for drives that |
| 92 |
announce to be ATA-7 conform. But threre are also drives that support ATA-6 |
| 93 |
only but do IDLE_IMMEDIATE fine. For those you need to force the interface |
| 94 |
with: `echo -1 > /sys/block/$DISK/device/unload_heads`. |
| 95 |
Or you can call `hdapsd` like this: `hdapsd -f -d $DISK`, to achieve the same |
| 96 |
result. |
| 97 |
|
| 98 |
For kernels <2.6.28, please have a look at |
| 99 |
http://www.thinkwiki.org/wiki/HDAPS#Kernel_patch |
| 100 |
and patch your kernel with the appropriate patch before using `hdapsd`. |
| 101 |
|
| 102 |
mainline hdaps module vs tp_smapi (ThinkPad only) |
| 103 |
------------------------------------------------- |
| 104 |
The mainline hdaps module present in Linux kernels does not support all |
| 105 |
hdaps-enabled ThinkPads, thus it is recommended to use the one provided |
| 106 |
by tp_smapi. |
| 107 |
Additionally the tp_smapi version provides an input interface to the data, |
| 108 |
which stops `hdapsd` from polling the data itself all the time, saving your |
| 109 |
battery. |