User:Aexoxea/HPfall and freefall

From ArchWiki

This expands upon the content under HP ENVY TouchSmart 17-j113tx#Mass Storage.

Unit not tested

Quite simply, being my primary device I have no desire to drop it, or even simulate dropping it, to test if my HDDs will be protected or not ;-).

Only one device

Hpfall only accepts one device through its configuration file (/etc/conf.d/hpfall). Thus, if you have more than one HDD, you need to choose which one to protect.

freefallAUR defines a template service file (freefall@.service) which takes an escaped device path as its argument (e.g. systemctl enable freefall@-dev-sda.service). While this theoretically allows more than one device, the first instance to start opens the hard-coded path /dev/freefall, causing any subsequent instances to fail ("Device or resource busy").

Device name can change

Asynchronous loading creates race conditions for device names (e.g. /dev/sda) at boot time. This can lead to several difficulties:

  • The device being protected silently changing between reboots.
  • Protection failing because the device doesn't support protection (i.e. doesn't expose /sys/block/<device_name>/device/unload_heads). This might happen if there is an external drive connected at boot time.

This should be solvable using Persistent block device naming, though which methods are appropriate depend on which ones will expose a consistent path under /sys/block/ (not just under /dev/disk/), since that is what either package currently expects.