[LinuxFocus-icon]
LinuxFocus article number 359
http://linuxfocus.org

[Photo of the Author]
by Jan Alonzo (homepage)

About the author:

Jan runs Debian Linux on his IBM T20

Fn-F12: Hibernate an IBM Thinkpad T20 laptop

t20

Abstract:

This article explains how to make Hibernate (suspend-to-disk) work on a IBM Thinkpad T20 with no windows installed. The solution presented here may also work for other Thinkpads with a Phoenix BIOS but I have tested it only on a T20.

_________________ _________________ _________________

 

Software Requirements

You need the following programs installed for hibernate to work:

fdisk usually comes with your default Linux install. cfdisk usually comes with a Debian default install. tphdisk was written by Andrew Tridgell for his Thinkpad T20.

 

Creating the DOS Partition

First you have to make sure that you have a spare PRIMARY block in your device. This is important as Thinkpads only hibernate on PRIMARY partitions, not on extended partitions. Been there, done that.

The rule of thumb is: "size of RAM + size of graphic adapter's RAM + extra MBs for safety". If you are planning to upgrade your RAM soon, make sure you take into consideration the size of your future RAM, or else you have to recreate the partition again.

Once you have created the partition, set it to type "Hidden Win95 (FAT16) LBA". The partition code is "1E".

RAM:     128 MB
VGA RAM:   8 MB

Hibernation partion: 150 MB (for safety)

It is up to you how much extra you want to put in the partition. If you're having problems, kindly refer to the Troubleshooting section.

Now Reboot your laptop.

 

Formatting the partition

mkdosfs is part of the dosfstools package.

As root:

$ mkdosfs /dev/hdaX

... where hdaX is the partition you just created above (Creating the DOS Partition section).

Now mount the partition:

$ mount /dev/hdaX /mnt/hibernate
 

Creating the hibernation file

  1. Get tphdisk at http://samba.org/ftp/unpacked/junkcode/tphdisk.c or local copy: tphdisk.tar.gz
  2. Compile tphdisk.
  3. Create the file "save2dsk.bin". save2dsk.bin is the filename of the hibernation file. No, it's not an optional filename.
$ gcc -o tphdisk tphdisk.c
$ ./tphdisk N > /mnt/hibernate/save2dsk.bin

... where:

N = size of the file. See rule of thumb above.

Reboot your laptop.

 

Sound

It is a known problem that the cs46xx sound card driver of the T20 does not re-initialize the hardware registers after a suspend or hibernate operation. In other words Linux will be fully operational but you will not hear any sound after a suspend to ram or suspend to disk. A work around is to run manually "/etc/init.d/alsasound restart" if you care about sound.
See also http://panopticon.csustan.edu/thood/tp600lnx.htm#secsnd for more suggestions on how to solve this "sound silent problem".  

Testing

Your screen should blank and after a couple of seconds, the Phoenix BIOS hibernate utility should come up and start dumping the contents of your RAM to your newly created hibernation file:

Phoenix BIOS hibernate


 

Troubleshooting

  1. While creating the hibernation file, I received an error says "Write Failed"!
  1. When I tried to hibernate, the system just hangs!
  1. "System is invalid"!


Webpages maintained by the LinuxFocus Editor team
© Jan Alonzo
"some rights reserved" see linuxfocus.org/license/
http://www.LinuxFocus.org
Translation information:
en --> -- : Jan Alonzo (homepage)

2005-01-15, generated by lfparser_pdf version 2.51