HowTo.Gumph.Org

Step by step solutions to IT problems

Poweroff an old PC in Debian

If you've just installed Debian onto an old PC, then you may notice that when you shutdown it doesn't actually turn the computer off. We try the options for getting it to poweroff properly.

In order for the computer to be able to poweroff completely, it needs a powersupply that can be told to turn off, such as an ATX power supply. Older computers (Pentium 1, 486 etc) had AT power supplies, which can't turn themselves off. So for this article we are looking at turning off Pentium II and newer computers.

There are two main standards for power management - APM and the newer ACPI, both off which support powering down the computer completely. Recent Debian Kernels have ACPI support compiled in, so should be able to shut down most modern computers without any extra help.

If the compiled in ACPI support is not turning off your computer, then check at ACPI is loading correctly.

debian:~# dmesg | grep ACPI
 BIOS-e820: 00000000040fd800 - 00000000040ff800 (ACPI data)
 BIOS-e820: 00000000040ff800 - 00000000040ffc00 (ACPI NVS)
ACPI disabled because your bios is from 1999 and too old
ACPI: Subsystem revision 20040326
ACPI: Interpreter disabled.
debian:~#

If ACPI is not starting, then try running APM instead. To install APM, from a root prompt type apt-get install apmd which should work as below

debian:~# apt-get install apmd
Reading Package Lists... Done
Building Dependency Tree... Done
Suggested packages:
  xapm
The following NEW packages will be installed:
  apmd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/57.1kB of archives.
After unpacking 279kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package apmd.
(Reading database ... 24042 files and directories currently installed.)
Unpacking apmd (from .../archives/apmd_3.2.2-3_i386.deb) ...
Setting up apmd (3.2.2-3) ...
Starting advanced power management daemon: apmd.

debian:~#

Now check that apm is installed and working by checking the apm module is loaded, and the apmd is running

debian:~# lsmod | grep apm
apm                     8428   1  (autoclean)
debian:~# ps ax | grep apmd
 1046 ?        S      0:00 [kapmd]
 1048 ?        Ss     0:00 /usr/sbin/apmd -P /etc/apm/apmd_proxy --proxy-timeout 30
debian:~#

Now when you issue a shutdown command ( either poweroff or shutdown -h now ) your computer should power off completely.

Of course it might not ...

These are the usual steps I take to get debian to power off an old PC, and I've only had them fail once. That was for a 500Mhz Pentium III. In that case, APM under debian wouldn't turn the box off (although APM under slackware would power it off completely ! ), so I had to investigate more.

It seems that ACPI will not load if it thinks the PC is too old to run ACPI, even if it has ACPI support. In this case, you need to force ACPI to load.

To do this you need to edit your /boot/grub/menu.lst file, and add acpi=force to the end of the kernel line

title           Debian GNU/Linux, kernel 2.4.27-2-386
root            (hd0,0)
kernel          /boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro acpi=force
initrd          /boot/initrd.img-2.4.27-2-386
savedefault
boot

and reboot

debian:~# dmesg | grep ACPI
 BIOS-e820: 00000000040fd800 - 00000000040ff800 (ACPI data)
 BIOS-e820: 00000000040ff800 - 00000000040ffc00 (ACPI NVS)
ACPI: RSDP (v000 PTLTD                                     ) @ 0x000f6b80
ACPI: RSDT (v001 PTLTD    RSDT   0x00000000 PTL  0x01000000) @ 0x040fdb3c
...
ACPI: Subsystem revision 20040326
ACPI: Interpreter enabled
...
ACPI: PCI Root Bridge [PCI0] (00:00)

You should see lots of ACPI lines, in which case ACPI is loading fine, so try powering off

debian:~# shutdown -h now

Broadcast message from root (pts/0):

The system is going down for system halt NOW! debian:~#

If your system powers off completely, the hoorah. Now remove the apmd package as you no longer need it

debian:~# apt-get remove apmd
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
  apmd
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 279kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 24062 files and directories currently installed.)
Removing apmd ...
debian:~#

Your old PC should now be powering off properly using either APM or ACPI.

Submit to     del.icio.us    digg    reddit    simpy