How to control a SSD fan on iMac with Lubuntu 22.04?

Hi all,
My name is Jean-Marc, and I’m new on this forum.
By advance, I thanks all persons who will be able to help me, and sorry for my poor english.
I have a question to submit to the community.
I use Lubuntu 22.04 with an iMac 2011 in place of Mac High Sierra, who is not more supported in 2024.
(I also have other PC with Linux).
This iMac use a SSD Samsung EVO 1 to as master drive.
Of course, it’s not the original Apple drive.
The problem is that the temperature sensor for the drive was included into the original Apple drive.
That’s why when High Sierra was in use, I added a specific application (Fan control) to regulate the speed for the drive fan.
Now, Lubuntu is installed on 100 % of this SSD, and so, the fan speed can’t be anymore regulated.
I searched on the web how to control this speed but don’t found any positive option.
Please,do you have an idea how to control this speed ?
To compare, when I was on Mac OS, the basic speed (without any hard charge) was of +/- 1100 rpm.
Now, in the same conditions, it’s of +/- 2300 rpm.
So, the noice is not the same, and the mac is not so quiet as before.
A great thanks for your assistance, and have a nice day.
Regards.
Jmarc

The problem with fans seems to be that there is no consistency with them. Depending on the type of hardware one has, there are a variety of different packages one can use to control the fans. So if you have a Dell, you’ll need something different than someone with a ThinkPad, for example. Some, I think, probably have no support at all.

In any case, it looks like the options for controlling the fan are PWM (see below; this appears to be the most common approach), ACPI (you can manipulate files in /proc/acpi for this but if there’s not something specific to the fan, then that’s not an option), and apparently in rare cases, SMM. There also may be a way to control it in some boot firmwares.

The standard route to do things with PWM is pretty simple: if you install the lm-sensors package and run sudo sensors-detect, you should then be able to run sensors and, if there is a fan to control, you’ll get some input on its speed. Then install the fancontrol package and run sudo pwmconfig to get started configuring.

In my case, I had no such PWM-capable fans, neither for my CPU or GPU, let alone a drive. And I’m on a HP.

That said, there may be some options. There is a package called macfanctld that supposedly works for iMac users (I saw at least one such claim online) even though it’s supposed to be for MacBooks. However, it hasn’t been developed in 11 years. There’s another one, also supposedly for MacBooks, but that others have reported working for iMacs, called mbpfan that has apparently been working well for folks. It’s part of a Linux-On-Mac group on GitHub, which may be a good resource, in general. Here’s my source:

If you get it working, please let us know how you did.

3 Likes

Hi,
Thanks for your response, really appreciated.
I already added the lm-sensors package, but there is no sensor.
But, maybe, I’ve done something wrong nad i will try again.
I will also have a look on the other packages and in your source.
As I’m not with the iMac for now, I will do it this week-end, and will post the result.
Thanks for your assistance.
Regards.
Jmarc

1 Like

Hi,
just install mbpfan on your linux with apt install mbpfan and you are done.

hope this helps

1 Like

More information:

Hi all,
Thanks for your feedbacks
I installed mbpfan, but it seem that I do not have the permission to modify the fan values.
I’m on “read only”.
When I enter the command “su”, the identification failed !!!
When I enter the command “nano /etc/mbpfan.conf”, I do not have the visibility on the fans RPM definition, and of course the possibility to modify the values.
Thanks in advance for your feedback.
Regards.
Jmarc
:wink:

In Lubuntu the command to get root privileges is ‘sudo’ and not ‘su’, which has to be written before the usual command in the same line.

What command(s) did you use and what specific response did you get?

How have you determined that? You couldn’t have installed anything if you had been.

To be expected. See man su and man sudo_root. Just running su effectively tries to run as root, which requires the appropriate password, which is not the same as your own. However, if you look at the latter manpage, you’ll see that the password is locked, so it’s inconceivable to do this.

So instead of logging in as root, just preceed every command that needs escalated privledges with sudo. Case in point: you installed with sudo apt install mbpfan rather than first running su and then doing apt install mbpfan as root.

As above, sudo that.

If I read the file, it seems to suggest that what you need to do is run some commands to get some values and change these lines:

#min_fan1_speed = 2000	# put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
#max_fan1_speed = 6200	# put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"

First, remove the comment (#) at the beginning of the line. Next, run cat /sys/devices/platform/applesmc.768/fan1_min (note I changed the * to 1 because, reading the line above, it’s clear that the context here is “multiple fans” and so the * is supposed to indicate any appropriate number, depending on the number of fans you have and which one you want to control; you can ls /sys/devices/platform/applesmc.768/fan* to get a list of all the options but note if it needs to be something other than 1, you will also need to change min_fan1_speed at the beginning to match) and get the lowest value and then change the 2000 to that. Then repeat for the max values.

So let’s say that you figure out that your fan is actually enumerated with a 0 and the min and max values, respectively, are 3000 and 5000, then those two lines would look like this:

min_fan0_speed = 3000	# put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
max_fan0_speed = 5000	# put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"

Hi all,

Thanks for your comments.
I not an expert with Linux…
I will have a look this week because I do not the Mac with me.
I will post the results.
Have a nice day.
Regards.
JM
:wink:

HI all,
Sorry for this delay to reply.
I checked the settings with my poor knowledge, and found that the current parameters are not so bad.
I attached a screenshot of the fan definition, and sensors info.
I think that I will keep this configuration.
Thanks for all of your precious coments.
Regards.
Jmarc

:wink:

Meaning the default configuration works fine???

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.