List of content you will read in this article:
Warning: Avoid stopping fans on high system loads because it may damage your hardware permanently.
Fan Speed Control via Command Line in Linux
Command lines are powerful and convenient tools for managing your system's cooling. It allows users to manually adjust the speed of their fans to match their needs, whether for maximum cooling or minimal noise. And it’s happening by using the lm-sensors utility, which reads the system's temperature and adjusts the fan speed accordingly.
Fancontrol is a feature of the lm-sensors package that allows for the automatic control of computer fans. It works by monitoring the temperatures of various components in the system and adjusting the fan speeds accordingly. Check the items below to see how it works:
To get started, run the following command:
This command detects all of your sensors present and uses them for fancontrol. Now run the command below to see if the sensors are detected correctly.
Note: In case of not displaying an RPM value for your CPU fan, increase your fan divisor for sensors.
after configuring sensors, you must use the following command to test and configure fan speed control.
This command creates “etc/fancontrol” a customized configuration file. Enter ‘Y’ for yes and ‘N’ for no.
Note: you may experience issues running /sys/class/hwmon/ paths for your configuration file. Hwmon class devices are used to group all hwmon sensors into one directory. And rebooting may change the order of hwmon devices and cause fancontrol to stop working.
To run fancontrol, use the command below:
Shortly after running this command, you should hear fans starting.
Note: Unfortunately, fancontrol won’t work after suspending, so you must restart your device to use it again.
- Changing the fan speed can help improve the cooling performance of your computer and lower noise levels from your fan.
- The command line tools to change the fan speed will vary depending on your Linux distribution but are usually easy to find with a quick online search.
- When changing the fan speed, you should be mindful of staying within the recommended speed range for your device to avoid any potential damage.
People also read: