<?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=Dkowis</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=Dkowis"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Dkowis"/>
	<updated>2026-05-23T01:52:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=How_to_protect_the_harddisk_through_APS&amp;diff=43706</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=43706"/>
		<updated>2009-07-23T18:54:58Z</updated>

		<summary type="html">&lt;p&gt;Dkowis: Updated source urls a bit&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;
For {{Debian}} (Etch) have a look at [[Installing_Debian_Etch_on_a_ThinkPad_Z60m#Active_Protection_System|this]].&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 &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. You should get the patch appropriate to your kernel version from [http://news.gmane.org/group/gmane.linux.drivers.hdaps.devel/last=/force_load=t gmane.linux.drivers.hdaps.devel].&lt;br /&gt;
** '''NOTE''': Starting with kernel 2.6.28 a generic disc protection feature is built into the libata driver&lt;br /&gt;
* The [http://sourceforge.net/projects/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://roy.marples.name/projects/khdaps/wiki &amp;lt;tt&amp;gt;khdapsmonitor KDE System Tray applet&amp;lt;/tt&amp;gt;] 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;
See [[HDAPS#Disk_head_parking|HDAPS - Disk head parking]]&lt;br /&gt;
|-&lt;br /&gt;
! {{Slackware}}&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt; SlackBuild: http://slackbuilds.org/repository/12.2/system/hdapsd/&lt;br /&gt;
|-&lt;br /&gt;
! {{Debian}}&lt;br /&gt;
|&lt;br /&gt;
*&amp;lt;tt&amp;gt;hdapsd&amp;lt;/tt&amp;gt; package: http://packages.debian.org/unstable/misc/hdapsd&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;: [http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd available]&lt;br /&gt;
*&amp;lt;tt&amp;gt;khdapsmonitor&amp;lt;/tt&amp;gt;: [http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/khdapsmonitor available]&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;
==== Zen-Sources patched kernel ====&lt;br /&gt;
Another way to achieve this is using zen-sources kernel. &lt;br /&gt;
It has hdaps patches applied. Additional it supports many other IBM futures like tp_smapi and newest thinkpad_acpi.&lt;br /&gt;
&lt;br /&gt;
Download page for this kind of kernel is http://zen-sources.org/&lt;br /&gt;
&lt;br /&gt;
After downloading a kernel image unpack it to ''/usr/src/linux'' with&lt;br /&gt;
:{{cmdroot|tar jxf zen-sources-2.6-version-zen0.tar.bz2 }}&lt;br /&gt;
&lt;br /&gt;
Installation is similar to previous one.&lt;br /&gt;
&lt;br /&gt;
As root, do:&lt;br /&gt;
:{{cmdroot|make oldconfig}}&lt;br /&gt;
:{{cmdroot|make clean}}&lt;br /&gt;
:{{cmdroot|make}}&lt;br /&gt;
:{{cmdroot|make modules_install}}&lt;br /&gt;
&lt;br /&gt;
'''make oldconfig''' command will ask you for some information. It's required to tap '''m''' or '''y''' on &amp;quot;HDAPS&amp;quot; functionality, and on some other things connected with Thinkpad.&lt;br /&gt;
&lt;br /&gt;
=== Installing hdapsd ===&lt;br /&gt;
==== Manual compilation from source ====&lt;br /&gt;
{{NOTE|1=There has been a new release of hdapsd which doesn't use sysfs anymore and therefore reduces timer interrupts. You need tp_smapi 0.32 for this. See also: http://article.gmane.org/gmane.linux.drivers.hdaps.devel/1040 .}}&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;
{{NOTE|1=hdapsd was added to the official portage tree on the 26th June 2006. However the version in portage is to be considered outdated. (20060409)}}&lt;br /&gt;
{{Gentoo}} users can try the ebuild attached to [http://bugs.gentoo.org/show_bug.cgi?id=166166 gentoo bug 166166].&lt;br /&gt;
*Add hdapsd support in your kernel: device drivers -&amp;gt; hardware monitoring -&amp;gt; ... (you need it as a module if you want to use tp_smapi and hdaps, see [[Tp_smapi]])&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;
==== Ubuntu ====&lt;br /&gt;
hdapsd is available via synaptic for Hardy Heron.&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 [https://sourceforge.net/project/showfiles.php?group_id=138242 hdaps-gl-0.0.5] 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;
==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:T60p]] [[Category:T61]] [[Category:X40]] [[Category:X41]] [[Category:X41 Tablet]] [[Category:X60]] [[Category:X60s]] [[Category:Z60m]] [[Category:Z60t]] [[Category:Z61m]] [[Category:Z61e]] [[Category:Z61m]]&lt;/div&gt;</summary>
		<author><name>Dkowis</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=BIOS_update_without_optical_disk&amp;diff=43315</id>
		<title>BIOS update without optical disk</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=BIOS_update_without_optical_disk&amp;diff=43315"/>
		<updated>2009-05-29T00:43:45Z</updated>

		<summary type="html">&lt;p&gt;Dkowis: Added an issue that I encountered whilst trying to do this.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For recent models, such as Thinkpad {{X200}}, Lenovo provides both win32 ''&amp;quot;BIOS update utility&amp;quot;'' and iso-image of ''&amp;quot;BIOS Update (Bootable CD)&amp;quot;''. If you don't have Windows installed, the first option is obviously unavailable for you. If you have an optical drive of some kind (internal, or built into the docking station, or an external USB drive) you can burn the iso-image and proceed with the BIOS update. In case if you don't have any optical drive things get a little tricky.&lt;br /&gt;
&lt;br /&gt;
A quick look at the ''BIOS Update (Bootable CD)'' iso-image shows that its &amp;lt;tt&amp;gt;iso9660&amp;lt;/tt&amp;gt; filesystem is empty and its bootimage is of &amp;lt;tt&amp;gt;BootMediaType=4&amp;lt;/tt&amp;gt;, i.e. it is a [http://www.phoenix.com/NR/rdonlyres/98D3219C-9CC9-4DF5-B496-A286D893E36A/0/specscdrom.pdf harddisk emulation]. Therefore non of the methods discussed in [[BIOS_Upgrade/X_Series]] would work. There are many Linux tools which extract bootimages from iso-images, but after a search over the net, I didn't any which works correctly with &amp;lt;tt&amp;gt;BootMediaType=4&amp;lt;/tt&amp;gt; (e.g. &amp;lt;tt&amp;gt;geteltorito&amp;lt;/tt&amp;gt; form '''genisoimage''' package messes things up). I found, however, a free open-source DOS utility '''isobar''' from [http://shsucdx.adoxa.cjb.net/ shsucd] package. So, I just [http://colimit.googlepages.com/isobar.c ported] it to linux.&lt;br /&gt;
&lt;br /&gt;
Now, to update the BIOS,&lt;br /&gt;
&lt;br /&gt;
* make sure that you have '''syslinux''' installed (we will need &amp;lt;tt&amp;gt;memdisk&amp;lt;/tt&amp;gt; from this package)&lt;br /&gt;
&lt;br /&gt;
 apt-get install syslinux&lt;br /&gt;
&lt;br /&gt;
* compile the [http://colimit.googlepages.com/isobar.c isobar] utility&lt;br /&gt;
&lt;br /&gt;
 gcc isobar.c -o isobar&lt;br /&gt;
&lt;br /&gt;
* extract the bootimage from the ''BIOS Update (Bootable CD)'' iso-image and copy it to the boot partition&lt;br /&gt;
&lt;br /&gt;
 ./isobar 6duj08uc.iso -o bios.img&lt;br /&gt;
 cp bios.img /boot/bios.img&lt;br /&gt;
&lt;br /&gt;
* copy &amp;lt;tt&amp;gt;memdisk&amp;lt;/tt&amp;gt; loader to the boot partition&lt;br /&gt;
&lt;br /&gt;
 cp /usr/lib/syslinux/memdisk /boot/memdisk&lt;br /&gt;
&lt;br /&gt;
* append the following lines to /boot/grub/menu.lst&lt;br /&gt;
&lt;br /&gt;
 title           BIOS update&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /memdisk&lt;br /&gt;
 initrd          /bios.img&lt;br /&gt;
&lt;br /&gt;
* reboot, and in the grub menu choose the &amp;lt;tt&amp;gt;BIOS update&amp;lt;/tt&amp;gt; option&lt;br /&gt;
&lt;br /&gt;
==Hard drive firmware update utility==&lt;br /&gt;
&lt;br /&gt;
Besides BIOS updates, Lenovo also provides [[Hard drive firmware update]] utility in the form of a bootable iso-image. Quick check shows that in some cases it has the same structure as above, i.e. empty &amp;lt;tt&amp;gt;iso9660&amp;lt;/tt&amp;gt; filesystem and bootimage of &amp;lt;tt&amp;gt;BootMediaType=4&amp;lt;/tt&amp;gt;. So, naturally, one would think that we can boot it in the same way as above, via &amp;lt;tt&amp;gt;grub&amp;lt;/tt&amp;gt; &amp;amp; &amp;lt;tt&amp;gt;memdisk&amp;lt;/tt&amp;gt;. However, common sense tells that it is not a good idea to read the firmware from the same very harddrive whose firmware we are updating. But looking further into the structure of the bootimage we see that first it creates a &amp;lt;tt&amp;gt;RAMDRIVE&amp;lt;/tt&amp;gt;, copies the update utility there, and launches it from the &amp;lt;tt&amp;gt;RAMDRIVE&amp;lt;/tt&amp;gt;. So, it is actually OK to use &amp;lt;tt&amp;gt;grub&amp;lt;/tt&amp;gt;. Tested on my {{X200}}.&lt;br /&gt;
&lt;br /&gt;
==Related links==&lt;br /&gt;
Here is a [http://colimit.googlepages.com/geteltorito.diff patch] to &amp;lt;tt&amp;gt;geteltorito&amp;lt;/tt&amp;gt; script to make it work correctly with &amp;lt;tt&amp;gt;BootMediaType=4&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Works with==&lt;br /&gt;
{{T400}}, {{R400}}, {{T500}}, {{R500}}, {{X200}}, {{x200s}}, {{X200_Tablet}}, {{X301}}, {{W500}}, {{W700}}, [[Hard drive firmware update]]&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
For me the attempt to boot results in: Error 28: Selected item cannot fit into memory.&lt;br /&gt;
I've got 4gb of ram, so I doubt that's the problem. the bios img is: [Linux-initrd @ 0xbbc91000, 0x1700000 bytes]&lt;br /&gt;
&lt;br /&gt;
ls -l /boot&lt;br /&gt;
 -rw-r--r-- 1 root root  24117248 May 28 19:25 bios.img&lt;br /&gt;
The thing is about 24mb, should have no problems being an initrd.&lt;br /&gt;
--dkowis&lt;/div&gt;</summary>
		<author><name>Dkowis</name></author>
		
	</entry>
</feed>