<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yurigagarin</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yurigagarin"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Yurigagarin"/>
	<updated>2026-04-04T09:09:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Problem_with_APS_harddisk_parking&amp;diff=22052</id>
		<title>Problem with APS harddisk parking</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Problem_with_APS_harddisk_parking&amp;diff=22052"/>
		<updated>2006-05-02T12:39:56Z</updated>

		<summary type="html">&lt;p&gt;Yurigagarin: /* Solution for kernel 2.6.16 or later */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;&amp;quot; | __TOC__&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
When trying to enable APS functionality by installing &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt;, the following problems might occur.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Problem with unload capabilities check==&lt;br /&gt;
You may get the following kernel message when the disk is protected (e.g., via {{cmdroot|echo 1 &amp;gt; /sys/block/sda/queue/protect}}):&lt;br /&gt;
&lt;br /&gt;
 ata_scsi_issue_protect_fn(): unload support NOT reported..&lt;br /&gt;
 scsi_protect_queue(): head park not requested, used standby!..&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 idedisk_issue_protect_fn(): unload support NOT reported..&lt;br /&gt;
 ide_protect_queue(): head park not requested, used standby!..&lt;br /&gt;
&lt;br /&gt;
{{WARN|Using HDAPS in the above state may cause frequent drive spin downs, thereby wearing out your hard disk.}}&lt;br /&gt;
&lt;br /&gt;
If you see this, and you are sure that your drive actually does support unloading (all original drives sold with HDAPS-equipped ThinkPads do), one of the following solutions might help.&lt;br /&gt;
&lt;br /&gt;
=== Drives which have this problem ===&lt;br /&gt;
* Hitachi HTS726060M9AT00 (7K60) on ThinkPad {{T43}}&lt;br /&gt;
* Fujitsu MHT2040AH (846C) on ThinkPad {{T41}}&lt;br /&gt;
&lt;br /&gt;
=== Solution for kernel 2.6.16 or later ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt; patch for 2.6.16 now accepts the {{bootparm|protect_method|}} module parameter to override the &lt;br /&gt;
parking capability detection, which accepts the following numeric values:&lt;br /&gt;
*&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;: autodetect capability&lt;br /&gt;
*&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;: &amp;quot;unload the head even if the drive doesn't report it has this capability&amp;quot;&lt;br /&gt;
*&amp;lt;tt&amp;gt;2&amp;lt;/tt&amp;gt;: &amp;quot;standby even if unload is supported&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Hence, depending on your machine type, and whether the module is built into the kernel or not, you can use one of the following options:&lt;br /&gt;
&lt;br /&gt;
If disk driver is built into kernel, add the following to your kernel boot parameters (e.g. {{path|/boot/grub/menu.lst}}):&lt;br /&gt;
    libata.protect_method=1&lt;br /&gt;
    ide-disk.protect_method=1&lt;br /&gt;
&lt;br /&gt;
If disk driver is built as module, add the following to your modprobe configuration (e.g., {{path|/etc/modprobe.conf}}):&lt;br /&gt;
    options libata protect_method=1&lt;br /&gt;
    options ide-disk protect_method=1&lt;br /&gt;
&lt;br /&gt;
In both cases, if you know whether you use &amp;lt;tt&amp;gt;ide-disk&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;libata&amp;lt;/tt&amp;gt;, you can drop the other line.&lt;br /&gt;
&lt;br /&gt;
=== Solution for kernel 2.6.15 and older ===&lt;br /&gt;
The following patch overrides automatic protect capability detection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff -u linux-2.6.15.hdaps/drivers/ide/ide-disk.c linux-2.6.15.hdaps/drivers/ide/ide-disk.c&lt;br /&gt;
--- linux-2.6.15.hdaps/drivers/ide/ide-disk.c	2006-01-18 07:11:54.000000000 +0000&lt;br /&gt;
+++ linux-2.6.15.hdaps/drivers/ide/ide-disk.c	2006-01-18 07:11:54.000000000 +0000&lt;br /&gt;
@@ -869,7 +869,7 @@&lt;br /&gt;
 	else&lt;br /&gt;
 		printk(KERN_DEBUG &amp;quot;idedisk_issue_protect_fn(): unload support NOT reported..\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
-	return ide_protect_queue(q, (drive-&amp;gt;id-&amp;gt;cfsse &amp;amp; (1 &amp;lt;&amp;lt; 13)) ? 1: 0);&lt;br /&gt;
+	return ide_protect_queue(q, 1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int idedisk_issue_unprotect_fn(request_queue_t *q)&lt;br /&gt;
diff -u linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c&lt;br /&gt;
--- linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c	2006-01-18 07:15:31.000000000 +0000&lt;br /&gt;
+++ linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c	2006-01-18 07:15:31.000000000 +0000&lt;br /&gt;
@@ -661,7 +661,7 @@&lt;br /&gt;
 		printk(KERN_DEBUG &amp;quot;ata_scsi_issue_protect_fn(): unload support NOT reported..\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 	/* call scsi_protect_queue, requesting either unload or standby */&lt;br /&gt;
-	return scsi_protect_queue(q, ata_id_has_unload(dev-&amp;gt;id) ? 1 : 0);&lt;br /&gt;
+	return scsi_protect_queue(q, 1);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static int ata_scsi_issue_unprotect_fn(request_queue_t *q)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Problem with Hard Drive Firmware==&lt;br /&gt;
In case you see a message like below in {{cmdroot|dmesg}} output after you have started the hdaps daemon, &lt;br /&gt;
a firmware upgrade of your harddisk might solve your problem.&lt;br /&gt;
 &lt;br /&gt;
 ide_protect_queue(): head NOT parked!.. &lt;br /&gt;
 ide_unprotect_queue(): No pending I/O, re-enabling power management..&lt;br /&gt;
&lt;br /&gt;
Go to the [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-62282 IBM harddrive firmware update utility page] and check if a firmware upgrade is available for your harddisk. IBM/Lenovo provides a bootdisk for easy firmware upgrade (~17MB download). &lt;br /&gt;
&lt;br /&gt;
===supported/unsupported harddrive firmwares===&lt;br /&gt;
Use {{cmdroot| hdparm -i /dev/hda}} to get your harddisk model name and firmware version (replace &amp;lt;tt&amp;gt;/dev/hda&amp;lt;/tt&amp;gt; with the actual device for your hard drive).&lt;br /&gt;
&lt;br /&gt;
The following line is the important one in the output: &lt;br /&gt;
&lt;br /&gt;
 Model=HTS726060M9AT00, FwRev=MH4O'''A6GA''', SerialNo=MRHXXXXXXXXX&lt;br /&gt;
&lt;br /&gt;
The last four characters of the '''FwRev''' actually marks the firmware version.&lt;br /&gt;
 &lt;br /&gt;
The table lists known working / not working firmware versions with [[HDAPS]] &lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- style=&amp;quot;text-align:left;&amp;quot;&lt;br /&gt;
!Drive!!firmware!!park command output&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| IC25N040ATCS04-0 || CA40'''A71A''' || not parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| IC25N040ATMR04-0 || MO2O'''AD4A''' || not parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| IC25N040ATMR04-0 || MO2O'''ADEA''' || not parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTC426040G9AT00 || 00P4'''A0B4''' || parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTS548040M9AT00 || MG20'''A5BA''' || not parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTS548040M9AT00 || MG20'''A5HA''' || parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTS548080M9AT00 || (TBA) || parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTS541060G9AT00 || MB3I'''A60A''' || parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| HTS726060M9AT00 || MH4O'''A6GA''' || parked&lt;br /&gt;
|- style=&amp;quot;text-align:left;vertical-align:top;&amp;quot;&lt;br /&gt;
| Fujitsu MHT2040AH || 846C || parked&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Yurigagarin</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=How_to_protect_the_harddisk_through_APS&amp;diff=21970</id>
		<title>How to protect the harddisk through APS</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=How_to_protect_the_harddisk_through_APS&amp;diff=21970"/>
		<updated>2006-04-28T12:57:24Z</updated>

		<summary type="html">&lt;p&gt;Yurigagarin: /* Gentoo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;&amp;quot; | __TOC__&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
This page tells you how to make the [[Active Protection System]] work under Linux to protect your harddrive from damage in case of a notebook drop or other kind of impact while it is running.&lt;br /&gt;
&lt;br /&gt;
Specific instructions for {{Fedora}} can be found [[Installing_Fedora_Core_5_on_a_ThinkPad_X41_Tablet#Harddrive_Active_Protection_System_.28HDAPS.29|here]].&lt;br /&gt;
&lt;br /&gt;
== How APS works in Linux ==&lt;br /&gt;
APS in Linux consists of four components on the software side:&lt;br /&gt;
* The [[HDAPS]] driver (included in recent kernels). It exports a sysfs interface providing the acceleration values.&lt;br /&gt;
* The [http://www.dresco.co.uk/hdaps/ &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt;] disk protection kernel patch, which exports a sysfs interface that enables an ide or sata disk to be protected by a userspace process.&lt;br /&gt;
* The [http://www.dresco.co.uk/hdaps/ &amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt;] disk protection userspace daemon. It monitors the acceleration values through the HDAPS interface and automatically initiates disk protection through the hdaps_protect interface - given that the movement exceeds a user specified threshold.&lt;br /&gt;
* Optional: the [http://www.oakcourt.dyndns.org/projects/khdapsmon/ &amp;lt;tt&amp;gt;khdapsmon&amp;lt;/tt&amp;gt; KDE System Tray applet] or the [http://www.dresco.co.uk/hdaps/ &amp;lt;tt&amp;gt;gnome-hdaps-applet&amp;lt;/tt&amp;gt;]. These applets provide a visual indication of the disk protection status and also a graphical interface for adjusting configuration options for &amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
As mentioned above, the hdaps kernel driver found in recent kernels is only responsible for reading the accelerometer data and exporting it through the sysfs interface. &lt;br /&gt;
&lt;br /&gt;
In order to use this information to protect the disk, some additional steps are required.&lt;br /&gt;
&lt;br /&gt;
* Download and build the latest hdaps_protect disk protection kernel patches.&lt;br /&gt;
* Enable the drivers in the kernel (requires kernel rebuild).&lt;br /&gt;
* Download, build and configure the hdapsd userspace daemon.&lt;br /&gt;
* Download and build one of the applets to get a real-time representation of the disk protection status.&lt;br /&gt;
&lt;br /&gt;
===Getting the files===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
! Latest Sources&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;gnome-hdaps-applet&amp;lt;/tt&amp;gt;: http://www.dresco.co.uk/hdaps&lt;br /&gt;
*&amp;lt;tt&amp;gt;khdapsmon&amp;lt;/tt&amp;gt;: http://www.oakcourt.dyndns.org/projects/khdapsmon/&lt;br /&gt;
|-&lt;br /&gt;
! {{Debian}}&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;khdapsmon&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;gnome-hdaps-applet&amp;lt;/tt&amp;gt;:&lt;br /&gt;
:{{cmdroot|deb http://www.oakcourt.dyndns.org/debian/ ./}}&lt;br /&gt;
:{{cmdroot|deb-src http://www.oakcourt.dyndns.org/debian/ ./}}&lt;br /&gt;
|-&lt;br /&gt;
! {{Fedora}}&lt;br /&gt;
| see instructions [[Installing_Fedora_Core_5_on_a_ThinkPad_X41_Tablet#Harddrive_Active_Protection_System_.28HDAPS.29|here]]&lt;br /&gt;
*kernel RPM packages including &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt;: http://www.dresco.co.uk/hdaps/ &lt;br /&gt;
*kernel RPM packages including &amp;lt;tt&amp;gt;hdaps_protect&amp;lt;/tt&amp;gt; and [[Software Suspend 2]]: http://mhensler.de/swsusp/download/yum/development/fc5/ (build 2084_2 and up)&lt;br /&gt;
|-&lt;br /&gt;
! {{Gentoo}}&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt; ebuild: http://bugs.gentoo.org/show_bug.cgi?id=119845&lt;br /&gt;
*&amp;lt;tt&amp;gt;khdapsmon&amp;lt;/tt&amp;gt; ebuild: http://bugs.gentoo.org/show_bug.cgi?id=124175&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Adding kernel support ===&lt;br /&gt;
A kernel patch is required for disk head parking and queue freezing.&lt;br /&gt;
&lt;br /&gt;
==== Manually patching and compiling a kernel ====&lt;br /&gt;
As root, do:&lt;br /&gt;
:{{cmdroot|cd /usr/src/linux}}&lt;br /&gt;
:{{cmdroot|patch -p1 &amp;lt; ~/hdaps_protect.20060409.patch}}&lt;br /&gt;
:{{cmdroot|make clean}}&lt;br /&gt;
:{{cmdroot|make}}&lt;br /&gt;
:{{cmdroot|make modules_install}}&lt;br /&gt;
&lt;br /&gt;
=== Installing hdapsd ===&lt;br /&gt;
==== Manual compilation from source ====&lt;br /&gt;
* Download the &amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt; sources (see above)&lt;br /&gt;
* Compile using {{cmdroot|gcc -o hdapsd hdapsd-*.c}}&lt;br /&gt;
* Run {{cmdroot|./hdapsd -d sda -s 12 -a}} (replace &amp;lt;tt&amp;gt;sda&amp;lt;/tt&amp;gt; with your hard disk device; run {{cmdroot|./hdapsd}} without arguments for help)&lt;br /&gt;
&lt;br /&gt;
==== Gentoo ====&lt;br /&gt;
{{Gentoo}} users can try the ebuild attached to [http://bugs.gentoo.org/show_bug.cgi?id=119845 gentoo bug 119845].&lt;br /&gt;
&lt;br /&gt;
*Add hdapsd support in your kernel: device drivers -&amp;gt; hardware monitoring -&amp;gt; ... (you need it as modul if you want to use tp_smapi and hdaps, see tp_smapi topic)&lt;br /&gt;
*Download the ebuild, use same ebuild date as the kernel-patch.&lt;br /&gt;
*Make known the portage an extern ebuild path and add the following line to {{path|/etc/make.conf}}:&lt;br /&gt;
 PORTDIR_OVERLAY=&amp;quot;/usr/local/portage/&amp;quot; (or any other location)&lt;br /&gt;
*Create directory {{path|/usr/local/portage}} and {{path|/usr/local/portage/app-laptop/}}&lt;br /&gt;
*Copy the downloaded ebuild to {{path|/usr/local/portage/app-laptop}} ({{path|/usr/local/portage/app-laptop/hdapsd}} should now exists)&lt;br /&gt;
*Make portage known the new ebuild and creat digist with:&lt;br /&gt;
:{{cmdroot|ebuild /usr/local/portage/app-laptop/hdapsd/hdapsd-20060326.ebuild digest}}&lt;br /&gt;
*Optional: Copy source file to portage distfiles (if no internet connection is available): &lt;br /&gt;
:{{cmdroot|cp hdapsd-20060326.c /usr/portage/distfiles}}&lt;br /&gt;
*Accept the x86 keyword for this package: {{cmdroot|echo &amp;quot;app-laptop/hdapsd ~x86&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.keywords}}&lt;br /&gt;
*Install hdapsd with: {{cmdroot|emerge hdapsd}}.&lt;br /&gt;
*Edit {{path|/etc/conf.d/hdapsd}} (change your harddrive if neccessary: mine is sda, and change the value from 5, 5 is to sensitive, 12 is a good value in my opinion).&lt;br /&gt;
*start deamon with: {{cmdroot|/etc/init.d/hdapsd start}}&lt;br /&gt;
*Optional: add to default runlevel: {{cmdroot|rc-update add hdapsd default, rc-update add hdapsd battery}}&lt;br /&gt;
Write an eMail to abartel[Ã¤d]htwm.de, if you want to get my hdapsd-20060326.ebuild and please upload it.&lt;br /&gt;
&lt;br /&gt;
=== Building an applet ===&lt;br /&gt;
====hdaps-gl====&lt;br /&gt;
*Make sure you have installed hdaps [and loaded] and ?opengl?&lt;br /&gt;
*Download &amp;lt;tt&amp;gt;hdaps-gl-0.0.5&amp;lt;/tt&amp;gt; from the web.&lt;br /&gt;
*Extract files to {{path|/opt/hdaps-gl}}.&lt;br /&gt;
*{{cmdroot|make}}&lt;br /&gt;
*Start the applet: {{cmdroot|./hdaps-gl}}&lt;br /&gt;
&lt;br /&gt;
====khdapsmon====&lt;br /&gt;
This application uses GNU autotools, so building it is the same as any other autotooled program:&lt;br /&gt;
*extract the source somewhere and change to that directory,&lt;br /&gt;
*run {{cmdroot|./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install}}.&lt;br /&gt;
See [[#Getting the files|above]] for Debian packages and a Gentoo ebuild.&lt;br /&gt;
&lt;br /&gt;
====gnome-hdaps-applet====&lt;br /&gt;
=====Debian/Ubuntu=====&lt;br /&gt;
Packages available at site listed above (with source packages that can do the building for you)&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
See the [[Problem with APS harddisk parking]] page for troubleshooting APS issues.&lt;br /&gt;
{{NOTE|1=If you use [[tp_smapi]], remember to include the option &amp;lt;tt&amp;gt;HDAPS=1&amp;lt;/tt&amp;gt; when [[Tp_smapi#Installation|installing tp_smapi]]. Also, you might need to build the hdaps driver as module.}}&lt;br /&gt;
&lt;br /&gt;
==Further Information==&lt;br /&gt;
*Additonal information and support is available through the [[Mailinglists#HDAPS Developers Mailinglist|hdaps-devel]] mailinglist and its archive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:R50]] [[Category:R50p]] [[Category:R51]] [[Category:R52]] [[Category:T41]] [[Category:T41p]] [[Category:T42]] [[Category:T42p]] [[Category:T43]] [[Category:T43p]] [[Category:T60]] [[Category:X40]] [[Category:X41]] [[Category:X41 Tablet]] [[Category:X60]] [[Category:X60s]] [[Category:Z60m]] [[Category:Z60t]]&lt;/div&gt;</summary>
		<author><name>Yurigagarin</name></author>
		
	</entry>
</feed>