HP EliteBook 2540p Ubuntu16.04风扇转速设置求助
Hey there, sorry to hear you're stuck fighting with uncooperative fan controls on your HP EliteBook 2540p under Ubuntu 16.04—those HP-specific fan restrictions are notoriously frustrating, especially when you know it works smoothly in Windows with HWinfo32. Let's walk through targeted fixes to get manual fan control working:
1. First, Check Your BIOS Settings
This is the most common culprit for HP laptops. Reboot your machine and enter the BIOS (usually by pressing F10 during startup). Look for options like:
- Fan Control Mode (under Power or Hardware sections)
- OS Controlled Fan or similar
Set this to allow the operating system to manage fan speeds instead of leaving it fully in BIOS control. Save changes and boot back into Ubuntu—this unlocks the ability for tools like lm-sensors to interact with the fan.
2. Verify Sensor & Fan Node Detection
Let's make sure Ubuntu can see your fan and PWM controls:
- Reinstall and reconfigure
lm-sensorsto ensure all hardware is detected:
Follow the prompts to scan for sensors (answer "yes" to most questions).sudo apt-get update && sudo apt-get install lm-sensors sudo sensors-detect - Run
sensorsto check if fan speeds (fan*_input) and CPU temperatures are displayed. If fans aren't showing up, find the correct hardware node:
For eachls /sys/class/hwmon/hwmonXdirectory (e.g.,hwmon0), check the device name:
Look for entries related to your fan controller (not justcat /sys/class/hwmon/hwmon0/namecoretempwhich is CPU temp). Inside that directory, look forpwm*files (PWM control channels) andfan*_input(fan speed readings). - Test manual PWM control directly:
This sets the fan to roughly 50% speed (PWM values range from 0-255). If the fan responds, you've found the right channel—skip to step 4 to set up# Replace X and Y with your hwmon number and PWM channel sudo chmod 666 /sys/class/hwmon/hwmonX/pwmY echo 128 > /sys/class/hwmon/hwmonX/pwmYfancontrol. If not, move to the next fix.
3. Load Required Kernel Modules
HP laptops often need specific kernel modules to expose fan controls. Try loading the hp-wmi module:
sudo modprobe hp-wmi
After loading, re-run sensors and check if fan nodes appear. If they do, re-run sudo pwmconfig to generate a fancontrol configuration file.
4. Fix pwmconfig Not Working
If pwmconfig still fails to detect PWM devices, try upgrading your kernel—Ubuntu 16.04's default kernel might lack proper support for older HP models. Install the Hardware Enablement (HWE) kernel:
sudo apt-get install linux-generic-hwe-16.04
Reboot your system, then re-run sensors-detect and pwmconfig. This often resolves compatibility issues with older hardware.
5. Alternative: Control CPU Frequency to Reduce Heat
If you still can't get direct fan control, reducing CPU load can lower temperatures and indirectly calm the fan. Install cpufrequtils:
sudo apt-get install cpufrequtils
Set your CPU to power-saving mode to limit clock speeds:
sudo cpufreq-set -g powersave
This won't give you manual fan control, but it can reduce heat output enough to make the fan more manageable without a cooling pad.
内容的提问来源于stack exchange,提问作者Nilkamal Gotarne

