How to disable ACPI on productive Linux servers
to decrease kernel panics and increase CPU fan lifespan
Why would anyone disable ACPI support on a server machine, well
simple ACPI loaded code is just another piece of code constantly
loaded in the memory on kernel boot up - that can produce a fatal
bug leading to a system crash (kernel panic).
Many computers ship with buggy or out of specifications ACPI
firmware which can cause a severe oddities on a brand new bought
piece of irons.
One such oddity that can be related to ACPI motherboard support
problems is if you notice your machine randomly powering off or
failing to boot with a brand new Linux installed on it.
Another reason is the ACPI code will let the kernel control the CPU
fan on a softwre level and on high CPU heat up it will instruct the
fan to rotate quickly and on low system loads it will bring back
the fan to loose speed.
If this switch of FAN from high speed to low speed has to be done
too frequently this increases the probability for a short fan
damage and possible system outage due to overheats.
Therefore I recommend the ACPI support is switched off completely
on all servers, where it no specifically needed for CPU heat
temperature tracking with
lm_sensors or any piece of hardwre
vendor specific software provided.
There are 3 ways to disable fully or partially ACPI support.
- One is to disable it straight for BIOS (best way IMHO)
- Disable via GRUB or LILO passing a kernel parameter
- Partial ACPI off-ing - /disabling the software that controls the
CPU fan/
1. Disable ACPI in BIOS level
Press
DEL, F1, F2, F10 or whatever the enter bios key
combination is go through all the different menus (depending on the
vios BENDOR) and make sure every occurance of ACPI is set to
off
/ disable whatever it is called.
Below is a screenshot of menus with ACPI stuff on a motherboard
equipped with
Phoenix AwardBIOS:
This is the best and safest way to disable ACPI power saving,
unfortunately some newer PCs lack the functionality to disable
ACPI; (probably due to the crazy "green" policy the whole world is
nowdays crazy about).
If that's the case with you, thanksfully there is a
"software
way" to disable ACPI via passing kernel options via
GRUB
and
LILO boot loaders.
2. Disabling ACPI support on kernel boot level through GRUB boot
loader config
There is a tiny difference command to pass for ACPI disabling
between GRUB ver. 1.x and GRUB 2.x.
a) In GRUB 0.99 (GRUB version 1)
Edit file
/etc/grub/menu.lst or
/etc/grub/grub.conf
(location differs across Linux distriubution), therein
append:
acpi=off
to the end of kernel command line.
Here is an example of a kernel command line with ACPI not disabled
(example taken from CentOS server grub.conf):
[root@centos ~]# grep -i title -A 4 /etc/grub/grub.conf
title Red Hat Enterprise Linux Server (2.6.18-36.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-36.el5 ro root=/dev/VolGroup00/LogVol00
console=ttyS0,115200n8
initrd /initrd-2.6.18-36.el5.img
The editted version of the file with
acpi=off included
should look like so:
title Red Hat Enterprise Linux Server (2.6.18-36.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-36.el5 ro root=/dev/VolGroup00/LogVol00
console=ttyS0,115200n8 acpi=off
initrd /initrd-2.6.18-36.el5.img
The
root=/dev/VolGroup00/LogVol00 means the the server is
configured to use LVM (Logical Volume Manager).
b) Disabling ACPI on GRUB version 1.99 +
This version is by default installed on newer Ubuntu and Debian
Linux.
In grub 1.99 on latest Debian Squeeze, the file to edit is located
in
/boot/grub/grub.cfgthe file is more messy than with its
predecessor
menu.lst (grub 0.99). Thanksfully there is no
need to directly edit the file (though this is possible), but on
newer Linuxes usually there is another simplied grub config file
/etc/grub/config
Hence to add the
acpi=off to 1.99 open
/etc/grub/config find the line reading:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
and append the "acpi=off" option, e.g. the line has to change
to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet
acpi=off"
On some servers it might be better to also disable APIC along with
ACPI:
Just in case you don't know what is the difference between
ACPI and
APIC, here is a short explanation:
ACPI = Advanced Configuration and Power
Interface
APIC = Advanced Programmable Interrupt
Controllers
ACPI is the system that controls your dynamic speed fans,
the power button behavior, sleep states, etc.
APIC is the replacement for the old PIC chip that used to
come imbedded on motherboards that allowed you to setup interrupts
for your soundcard, ide controllers, etc.
Hence on some machines experiencing still problems with even ACPI
switched off it might be a wise idea to disable the APIC support
too, by passing instead to the kernel:
acpi=off noapic noacpi
Anyways, while doing the changes, be very very cautious or you
might end up with unbootable server, don't blame me if this happens
:); Be sure you have a backup option if server doesn't boot.
I remember GRUB has ability to be configured to automatically load
up a second kernel if 1st one fails to boot so I guess this could
be a wise thing to investigate if you have to be 100% sure the
system will boot fine after grub changes.
To load up the kernel with the new setting, give it a
restart:
[root@centos ~]# shutdown -r now
....
3. Disable ACPI support on kernel boot time on Slackwares or
other Linuxes still booting with LILO
Still, some Linux distros like Slackware, decided to keep the old
way and use
LILO (Linux Loader) as a default boot
loader.
Disabling ACPI support in LILO is done through
/etc/lilo.conf
By default in
/etc/lilo.conf, there is a line:
append= acpi=on
it should be changed with:
append= acpi=off
Next to load up the new acpi disabled setting, lilo has to be
reloaded:
slackware:~# /sbin/lilo -c /etc/lilo.conf
....
br /> Finally a reboot is required (if you don't have a physical
access or someone near the server you better not
)
slackware:~# reboot
....
4. Disable ACPI fan control support on a running Linux server
without restart
This is the most secure work-around, to disabling the ACPI control
over the machine CPU fan, however it has a downside that still the
ACPI code will be loaded in the kernel and could cause kernel
issues possibly in the long run.
The acpid support on Linux is controlled by
acpid or
haldaemon (depending on the Linux distro), hence to disable
the fan control on servers this services has to be switched
off:
a) disabling ACPI on Debian and deb based Linuces As of time of
writting on Debian Linux servers
acpid (Advanced
Configuration and Power Interface event daemon) is there to control
how power management will be handled. To disable it stop it as a
service (if running):
debian:~# /etc/init.d/acpid stop
To permanently remove
acpid from boot up on system boot
disable it with
update-rc.d:
debian:~# update-rc.d acpid disable 2 3 4 5
update-rc.d: using dependency based boot sequencing
insserv: Script iptables is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if
empty.
insserv: warning: current start runlevel(s) (empty) of script
`acpid' overwrites defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (2 3 4 5) of script
`acpid' overwrites defaults (empty).
insserv: missing `Required-Start:' entry: please add even if
empty.
b) disabling ACPI on RHEL, Fedora and other Redhats
I'm not sure if this is safe,as many newer redhat servers might not
work properly with
haldaemon disabled.
Well anyways you can give it a try if when it is stopped there are
issues just bring it up.
[root@rhel ~]# /etc/init.d/haldaemon stop
If all is fine with the haldaemon switched off (hope so), you can
completely disable it to load on start up with:
[root@centos ~]# /sbin/chkconfig --level 2 3 4 5 haldaemon
off