Difference between revisions of "How to make APM work"

From ThinkWiki
Jump to: navigation, search
(Suspend to RAM (Sleep))
(using a hibernation partition)
Line 23: Line 23:
 
The partition to be used for hibernation must be a primary partition that is at least as big as your laptop's memory including its video ram. First set the partition type of this partition to a0 (IBM Thinkpad hibernation) with fdisk, and then use [[tphdisk]] to write a hibernation file directly to this partition.
 
The partition to be used for hibernation must be a primary partition that is at least as big as your laptop's memory including its video ram. First set the partition type of this partition to a0 (IBM Thinkpad hibernation) with fdisk, and then use [[tphdisk]] to write a hibernation file directly to this partition.
  
Only follow these instructions, if you understand them. You will overwrite a partition on your hard disk and might lose valuable data - consider yourself warned. For example, assume that /dev/hda2 is the partition that is to be converted to a hibernation partition. Become root and type {{cmdroot|/sbin/fdisk /dev/hda}}. At the fdisk prompt type '''t''' to change the partition type, then type '''2''' to indicate that you want to change the type of partition 2, and then enter the partition type: '''a0'''. Now type '''w''' to write the partition table back to disk and exit. After that use [[tphdisk]] to initialize the hibernation partition. First estimate the size of your laptop's memory (main and video). For the sake of this example, let us assume that the main memory is 1024 MB and the video card has 128 MB of memory. Then the command {{cmdroot|tphdisk 1152 > /dev/hda2}} will initialize the hibernation partition. Note that this will only work if the partition is big enough. After a reboot, Fn+F12 will work as expected.
+
Only follow these instructions, if you understand them. You will overwrite a partition on your hard disk and might lose valuable data - consider yourself warned. For example, assume that /dev/hda2 is the partition that is to be converted to a hibernation partition. Become root and type {{cmdroot|/sbin/fdisk /dev/hda}}. At the fdisk prompt type '''t''' to change the partition type, then type '''2''' to indicate that you want to change the type of partition 2, and then enter the partition type: '''a0'''. Now type '''w''' to write the partition table back to disk and exit. After that use [[tphdisk]] to initialize the hibernation partition. First estimate the size of your laptop's memory (main and video). For the sake of this example, let us assume that the main memory is 1024 MB and the video card has 128 MB of memory. Then the command {{cmdroot|tphdisk 1152 > /dev/hda2}} will initialize the hibernation partition. Note that this will only work if the partition is big enough. After a reboot, {{key|Fn}}{{key|F12}} will work as expected.
  
 
I have successfully used this method on a T41 (2373GEU) that runs Fedora Core 3.
 
I have successfully used this method on a T41 (2373GEU) that runs Fedora Core 3.

Revision as of 01:55, 2 May 2005

general

You need to enable the APM Power Management support in the kernel and install the apmd to handle the events triggered by the kernel driver. The configuration for what to do at the different events is done in the proxy script which is usually found in /etc/apmd_proxy. See {{{2}}} man apmd for further information on this.

If both ACPI and APM are enabled in your kernel, ACPI will override APM on boot if an ACPI capable BIOS is detected. To keep it from doing so add acpi=off to your kernel parameters.

Beware that different kernels and distributions will provide different results. Mandrake has been better than Redhat, Fedora, and Debian generally with e.g. T20, 600X and 240X in providing sleep but no blank or hibernation with 2.4 and 2.6 kernels. Debian Sarge with 2.4 kernels also. On a RH9 distribution you can be successful using a MDK kernel.

Screen blanking (Standby)

# apm -S will standby the machine. FnF3 should result in the same thing.

Suspend to RAM (Sleep)

# apm -s will suspend the machine. FnF4 should do the same thing.

Suspend to disk (Hibernate)

The Phoenix BIOS allows you three ways to hibernate with APM:

  • using a special partition
  • using a hibernation file on a dos type partition
  • using SoftwareSuspend2

using a hibernation partition

The partition to be used for hibernation must be a primary partition that is at least as big as your laptop's memory including its video ram. First set the partition type of this partition to a0 (IBM Thinkpad hibernation) with fdisk, and then use tphdisk to write a hibernation file directly to this partition.

Only follow these instructions, if you understand them. You will overwrite a partition on your hard disk and might lose valuable data - consider yourself warned. For example, assume that /dev/hda2 is the partition that is to be converted to a hibernation partition. Become root and type # /sbin/fdisk /dev/hda. At the fdisk prompt type t to change the partition type, then type 2 to indicate that you want to change the type of partition 2, and then enter the partition type: a0. Now type w to write the partition table back to disk and exit. After that use tphdisk to initialize the hibernation partition. First estimate the size of your laptop's memory (main and video). For the sake of this example, let us assume that the main memory is 1024 MB and the video card has 128 MB of memory. Then the command # tphdisk 1152 > /dev/hda2 will initialize the hibernation partition. Note that this will only work if the partition is big enough. After a reboot, FnF12 will work as expected.

I have successfully used this method on a T41 (2373GEU) that runs Fedora Core 3.

This bootable CD image can also be used to create the hibernation partition (in case you don't have a floppy drive).

using a hibernation file on a dos partition

The partition to put the file on must be a dos or vfat partition. Fat32 formatted partitions have been reported successful as well as Fat16 formatted ones. The file is either created with phdisk.exe, if you happen to have a floppy drive and a bootable dos floppy disk that you can start it from. Under Linux tphdisk will do this job for you.

If you have 512MB or more of RAM installed, you will need to use a FAT32 partition, due to file-size limits in FAT16.

There have been varying reports of success or lack thereof using tphdisk; see APM setup on a type 2379 Thinkpad T40 for workarounds and notes on required BIOS version, if tphdisk doesn't do the trick.

using SoftwareSuspend2

ToDo...