1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

お題は不問!Qiita Engineer Festa 2023で記事投稿!

Linux化したMacbookでファンを操作する

Last updated at Posted at 2023-06-17

背景

  • 化石MacbookにUbuntuを入れた
  • Ubuntuをインストールする前からファンが正常に回らなく熱くなり爆発寸前だった
  • 熱くならないようにファンを回して、古いMacを使いたい

環境

  • MacBook Pro (Retina, 13-inch, Early 2013)
    • Model Identifier: MacBookPro10,2
  • OS
    • Ubuntu 22.04.2 LTS

手順

各リポジトリのReadmeをメインに参考手順を参照する。

ファンをコントロールする: mbpfan

CPU温度やファン回転数を確認する: lm-sensors

  • 参考手順
  • lm-sensorsで確認できる情報をもとにファンの動作を微調整すると作業を進めやすい

実施内容

lsmod | grep -e applesmc -e coretemp

sudo apt-get install mbpfan

#不要だったかもしれない
sudo systemctl enable mbpfan.service
sudo systemctl daemon-reload
sudo systemctl start mbpfan.service

sudo systemctl status mbpfan
# =>Active: active (running) since Sat 2023-06-17 14:13:12 JST; 56min ago
# =>起動されていてActiveになっていることを確認

cat /sys/devices/platform/applesmc.768/fan*_min
# =>最大値を/etc/mbpfan.confのmin_fan1_speedに設定

cat /sys/devices/platform/applesmc.768/fan*_max
# =>最大値を/etc/mbpfan.confのmax_fan1_speedに設定

cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max
# =>最大値を1000で割り/etc/mbpfan.confのmax_tempに設定

sudo vi /etc/mbpfan.conf
# =>上記のcatした値を参考に各値を設定
# =>CPU?の温度がlow_temp→higt_temp→max_tempの流れで各設定値に達するごとにファンの回転数が上がる(調べきれていないので正確ではないかも)
# =>CPU?の温度がmax_tempを超えるとファンの回転数が最大になる

#設定を反映
sudo systemctl restart mbpfan

sesnors
# =>温度やファン回転数を見て設定を微調整

すぐに熱くなって爆発寸前なので、ファンが壊れても良い前提の私の設定

cat /etc/mbpfan.conf
[general]
# see https://ineed.coffee/3838/a-beginners-tutorial-for-mbpfan-under-ubuntu for the values
# 
# mbpfan will load the max / min speed of from the files produced by the applesmc driver. If these files are not found it will set all fans to the default of min_speed = 2000 and max_speed = 6200
# by setting the values for the speeds in this config it will override whatever it finds in:
# /sys/devices/platform/applesmc.768/fan*_min
# /sys/devices/platform/applesmc.768/fan*_max
# or the defaults.
#
# multiple fans can be configured by using the config key of min_fan*_speed and max_fan*_speed
# the number used will correlate to the file number of the fan in the applesmc driver that are used to control the fan speed.
#
min_fan1_speed = 3000	# put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min" => 2000だったけどすぐ熱くなるので高めにした
max_fan1_speed = 8208  # put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"
low_temp = 50			# try ranges 55-63, default is 63
high_temp = 60 			# try ranges 58-66, default is 66
max_temp = 70 			# take highest number returned by "cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max", divide by 1000 => 85だったけど早めにMAXで回ってほしいから低めにした
polling_interval = 1	# default is 1 seconds
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?