This blog post provides a step-by-step guide on how to control fan speed on Linux.
https://greenwebpage.com/community/how-to-control-cpu-fan-speed-on-linux/
1 of 8
Download to read offline
More Related Content
How to Control CPU Fan Speed on Linux In 5 Steps.pdf
1. 1/8
November 10, 2024
How to Control CPU Fan Speed on Linux: In 5 Steps
greenwebpage.com/community/how-to-control-cpu-fan-speed-on-linux/
Tutorials
by Karim Buzdar
November 10, 2024
Linux offers a variety of tools and commands that allow users to monitor and control the
hardware aspects of their systems. One such aspect is the fan speed, which is crucial for
maintaining an optimal temperature for your computers components, thus ensuring
performance and longevity.
Linux, known for its stability and flexibility, also provides various methods for users to control
the fan speed of their systems. This capability is crucial for maintaining an optimal
temperature for your hardware. Here, we explore the different methods available for
controlling fan speed on Linux.
This blog post provides a step-by-step guide on how to control fan speed on Linux.
How to Control Fan Speed on Linux
2. 2/8
One of the most common tools for monitoring and controlling fan speed on Linux is lm-
sensors. Its a powerful suite that can read temperature, voltage, and fan speed sensors.
For the configuration of the lm-sensors, the fancontrol script is utilized for adjusting the fan
speed based on the temperatures reported through lm-sensors.
Lets install and configure the fan speed on linux via lm-sensors on the Linux system:
Step 1: Installing lm-sensors
The first step in controlling fan speed is to install lm-sensors, a tool that allows you to monitor
hardware sensors, including temperature and fan speed.
For Debian-based systems:
sudo apt update
sudo apt install lm-sensors
For RHEL-based systems like CentOS:
sudo dnf -y install lm_sensors
Step 2: Detecting Sensors
After installation, you need to detect the available sensors on your system and determine the
necessary kernel modules to load. Use the following command:
sudo sensors-detect
3. 3/8
You will be prompted to answer a series of questions to identify the sensors:
Its generally safe to accept the default answers unless you have specific requirements:
4. 4/8
It moves further to asking to scan:
Note: Always remember to proceed with caution, as incorrect settings can potentially harm
your system. Remember, keeping your system cool is not just about comfort, but also about
ensuring the longevity and reliability of your hardware.
Step 3: Checking Sensor Output
To confirm that the sensors are working correctly, use the sensors command:
5. 5/8
sensors
This displays the current readings of all detected sensors, including temperatures and fan
speeds.
Step 4: Configuring fancontrol
fancontrol is a utility that works alongside lm-sensors to regulate fan speed based on system
temperature. This pwmconfig tool is often used to control PWM (Pulse-Width Modulation)
fans. It requires root privileges and can be used to set fan speeds based on specific PWM
values.
For configuration, users need to run the below command:
sudo pwmconfig
This script guides you through a series of prompts to configure the fan speed control.
Note: fancontroll is another command-line tool that provides a more user-friendly interface
for controlling fan speeds. It can be used to set fan speeds based on temperature thresholds.
Youll specify which sensors to use and set the desired fan speed for different temperature
thresholds. If not work, users can install fancontroll package as below:
6. 6/8
sudo apt install fancontrol
Step 5: Fine-Tuning and Starting fancontrol
Once youve configured fancontrol, you may need to fine-tune the settings in the
/etc/fancontrol file. After making adjustments, apply your changes by restarting the
fancontrol service:
sudo service fancontrol restart
By following these steps, you can effectively control the fan speed on your Linux system,
ensuring that your hardware runs at optimal temperatures and performs efficiently.
Bonus Tip: Control Fan Speed Using BIOS
Another method to control fan speed is through the systems BIOS or UEFI settings. Many
modern motherboards provide options to set up fan profiles that regulate the fan speed
based on CPU or system temperatures.
Accessing BIOS/UEFI:
7. 7/8
Reboot your system and press the key indicated on the screen (often F2, Del, or Esc) to
enter the BIOS/UEFI.
Then, move to the Hardware Monitor section and check the CPU Fan Speed. For
instance, it is 468 RPM.
Finally, Adjust the Fan Control as needed, being careful not to disable critical safety
features:
That is all from the guide.
Conclusion
Controlling fan speed on Linux requires a bit of setup, but it offers the flexibility to optimize
your systems cooling as per your needs. Whether you prefer a GUI tool or the command
line, Linux provides you with the options to keep your system cool and quiet. First, install lm-
sensors using the package manager of your distribution. For Debian-based systems, use
sudo apt install lm-sensors, and for RHEL-based systems, sudo dnf install lm_sensors.
Then, find the systems sensors via sudo sensors-detect. After that, confirm sensor
operation with the sensors command. Finally, use pwmconfig to create a fancontrol
configuration file.
Frequently Asked Questions
8. 8/8
Can I control the CPU fan speed on Linux?
Yes, you can control the CPU fan speed on Linux, but it depends on your hardware and the
support provided by your system's sensors and fan control modules. You typically need to
interact with the hardware through software tools, often requiring root privileges. Some
systems might have built-in support for fan control via BIOS/UEFI or specific kernel modules.
What tools are available for controlling fan speed on Linux?
There are several tools available to control and monitor fan speeds on Linux, including lm-
sensors, fancontrol, pwmconfig etc.
How do I configure lm-sensors to detect my hardware?
After installation of the tool, run the following command to detect available sensors on your
system: sudo sensors-detect
What if my system doesnt support PWM fan control?
If your system doesnt support PWM fan control, it may only have basic fan speed
adjustment options, or the fan may be running at a fixed speed. In this case, software
solutions like fancontrol or pwmconfig wont be effective. You may need to check your
BIOS/UEFI settings for any fan control options, or consider using external hardware to
control the fan speed.
Can I control CPU fan speed on a laptop?
Yes, controlling fan speed is possible on many laptops, though its often more limited
compared to desktops. Tools like thinkfan for ThinkPad laptops or i8kutils for Dell laptops can
be used to adjust fan speeds.