APM and Hibernation on battery power ( was: Hibarnation / lphdisk / Destroyed MBR (solved))
Here are some additions about APM.
Linux apm - functions seem (correctly) not to depend on the BIOS setting,
e.g. if BIOS hibernation is 'disabled' the linux apm does still relesase it.
apm -s puts the machine into suspend-to-Ram; FN-suspend also.
apm -S puts the machine into real standby;
also closing the lid. Opening resumes anything alright, e.g. cardmgr.
Shutdown linux (from kdm or 'halt' command) powers off correctly.
I am trying to find out, if hib could be used to prevent filesystem confusion
through battery powerfail.
It was not possible yet, because there seem to be a BIOS 'power emergency
shutdown' which doesn't regard any settings. It seems only to depend on
It's causing serious problems here, when i let an empty battery ( sorry, Joe
) inserted and reboot with line power. Though on line power, BIOS Apm
suddenly terminates the process, shutting power off.
It's disastrous while it interrupting the running filesystem check running
after the previous 'crash' .... have to fix much more inodes with fsck
manually after that. My only idea about this is:
Powering on line starts uploading the battery. Then it reaches the 'critical
point' - but from the other direction !
Nevertheless BIOS shuts off. I suppose it's a kind of bug.
One has first to recharge, or eject the battery to avoid this.
How to adjust timeouts correctly ?
Is there a tool for gnome 2 ?
================ Appendix: Testing log
I tried only with kde 2.2, but settings there are in remaining minutes,
where the panel gives percent.
KDE setting was ( in minutes ):
The events measured on the Gnome Panel battery-meter were:
15 % .... First warning
10 % .... The Laptop showed a red warn light + repeated beep every 4 seconds.
(wow this makes up an athmosphere like in a thriller ;-)
As i understood later, that was probably from BIOS, not from apm invoked.
3 % suspend-to-disk was released, but a few seconds too late:
System powered off before it was finished !
What a thrill :<
Who told it to hibernate ?
There was no option, in KDE and BIOS i could find hibernation settings only
for idle time. But it wasn't idle that long, AFAICR.
Next try. I log with 'cat /proc/apm' now.
I was on textconsole, unfortunateley no warnings when power shut off.
It powered off at 17 % (34 minutes) read from /proc/apm.
So i recognize two problems:
1) Battery status read from apm shows up values that are not reliable.
At least, there's some other mechanism shutting the lap off much earlier, as
one would suppose.
2) apm -s only does suspend to Ram. How to invoke hibernation by apm ?
To make use of it in a powerfail-script ( or from KDE / Gnome session ).
Anyone else interested in that ?