본문으로 건너뛰기
개발 뉴스로
기타dev.to··원문 약 4

Ubuntu 24.04를 사용하여 Mac mini 5,2에서 CPU 팬 속도 제어

Controlling CPU Fan Speed on Mac mini 5,2 with Ubuntu 24.04

Ubuntu 24.04를 실행하는 Mac mini 5,2(Mid 2011)가 있는 경우 applesmc + mbpfan을 사용하는 것이 편리한 설정입니다.

핵심 요약

자동 요약
  1. 1Ubuntu 24.04를 실행하는 Mac mini 5,2(Mid 2011)가 있는 경우 applesmc + mbpfan을 사용하는 것이 편리한 설정입니다.
  2. 2mbpfan 2.4.0은 Ubuntu 24.04(Noble)에도 표준 패키지로 포함되어 있습니다.
  3. 3Ubuntu 패키지 Linux applesmc 드라이버는 sysfs를 통해 Intel Mac 온도 센서와 팬 제어 기능을 제공합니다.

원문 본문

출처 · dev.to

If you have a Mac mini 5,2 (Mid 2011) running Ubuntu 24.04, a convenient setup is to use applesmc + mbpfan. mbpfan 2.4.0 is also included as a standard package in Ubuntu 24.04 (Noble). Ubuntu Packages

The Linux applesmc driver provides Intel Mac temperature sensors and fan control via sysfs. GitHub

1. First, check applesmc

sudo modprobe applesmc sudo modprobe coretemp lsmod | grep -E 'applesmc|coretemp' 

Next, check the fan interface.

SMC=$(find /sys/devices/platform -maxdepth 1 -type d -name 'applesmc.*' -print -quit) echo "$SMC" ls -l "$SMC"/fan* 

For example, if you see something like this, you can control it.

fan1_input fan1_manual fan1_max fan1_min fan1_output 

Be sure to check fan1_min and fan1_max.

cat "$SMC/fan1_min" cat "$SMC/fan1_max" cat "$SMC/fan1_input" 

The values will vary depending on the Mac, so it is safer not to assume values like 1800-5500 RPM.


2. Manually change the rotation speed

You can first test it temporarily at, for example, 3000 RPM.

echo 1 | sudo tee "$SMC/fan1_manual" echo 3000 | sudo tee "$SMC/fan1_output" 

Current actual rotation speed:

cat "$SMC/fan1_input" 

After a few seconds, it should be around 3000 RPM.

On Intel Macs in Linux, the method of setting fan1_manual=1 and then writing the target RPM to fan1_output is used. Ask Ubuntu

Return to automatic control

This is important.

echo 0 | sudo tee "$SMC/fan1_manual" 

If you leave it in manual mode and fix it at a low rotation speed, the rotation speed will not increase even when the CPU/GPU load increases.


3. Recommended: Use mbpfan to link to temperature

On Ubuntu 24.04,

sudo apt update sudo apt install mbpfan lm-sensors 

Enable:

sudo systemctl enable --now mbpfan 

Check status:

systemctl status mbpfan 

mbpfan reads the CPU temperature from coretemp and changes the fan speed via applesmc. GitHub

Configuration:

sudo nano /etc/mbpfan.conf 

For example, for Mac mini 5,2, I would first try the following as a gentle setting.

[general] low_temp = 55 high_temp = 65 max_temp = 80 polling_interval = 1 

For the fan's min/max, mbpfan can use the values reported by applesmc. If you want to specify it explicitly,

cat "$SMC/fan1_min" cat "$SMC/fan1_max" 

and then

min_fan1_speed = 2000 max_fan1_speed = 5500 

Set it using the actual values of your machine. mbpfan's default setting also specifies that it refers to /sys/devices/platform/applesmc.768/fan*_min and fan*_max. GitHub

After changing:

sudo systemctl restart mbpfan 

4. Monitor temperature and RPM in real time

sensors 

Or,

watch -n 1 sensors 

If you want to see the fan RPM directly:

watch -n 1 "cat $SMC/fan1_input; sensors" 

macmini5,2 ubuntu24.04でcpuファンスピードをコントロールしたい

Macmini5,2(Mid 2011)+ Ubuntu 24.04 なら、applesmc + mbpfan が扱いやすい構成です。Ubuntu 24.04(Noble)にも mbpfan 2.4.0 が標準パッケージとしてあります。(Ubuntu Packages)

Linux の applesmc ドライバは Intel Mac の温度センサーとファン制御を sysfs 経由で提供しています。(GitHub)

1. まず applesmc を確認

sudo modprobe applesmc sudo modprobe coretemp lsmod | grep -E 'applesmc|coretemp' 

次にファンのインターフェースを確認します。

SMC=$(find /sys/devices/platform -maxdepth 1 -type d -name 'applesmc.*' -print -quit) echo "$SMC" ls -l "$SMC"/fan* 

例えば、以下のようなものが出れば制御できます。

fan1_input fan1_manual fan1_max fan1_min fan1_output 

fan1_minfan1_max を必ず確認してください。

cat "$SMC/fan1_min" cat "$SMC/fan1_max" cat "$SMC/fan1_input" 

Mac によって値は違うので、1800~5500 RPM などと決め打ちしない方が安全です。


2. 手動で回転数を変更する

まず一時的に 3000 RPM などでテストできます。

echo 1 | sudo tee "$SMC/fan1_manual" echo 3000 | sudo tee "$SMC/fan1_output" 

現在の実回転数:

cat "$SMC/fan1_input" 

数秒すると 3000 RPM 前後になっているはずです。

Linux 上の Intel Mac では、fan1_manual=1 にしてから fan1_output に目標RPMを書く方法が使われています。(Ask Ubuntu)

自動制御に戻す

これは重要です。

echo 0 | sudo tee "$SMC/fan1_manual" 

手動モードのまま低回転に固定すると、CPU/GPU負荷が上がっても回転数が上がらなくなります。


3. おすすめ:mbpfan で温度連動

Ubuntu 24.04 なら、

sudo apt update sudo apt install mbpfan lm-sensors 

有効化:

sudo systemctl enable --now mbpfan 

状態確認:

systemctl status mbpfan 

mbpfancoretemp からCPU温度を読み、applesmc 経由でファン速度を変更します。(GitHub)

設定は:

sudo nano /etc/mbpfan.conf 

例えば私は Macmini5,2 なら、まず穏当な設定として次のあたりから試します。

[general] low_temp = 55 high_temp = 65 max_temp = 80 polling_interval = 1 

ファンの min/max は applesmc が報告する値を mbpfan が利用できます。明示的に設定したい場合は、

cat "$SMC/fan1_min" cat "$SMC/fan1_max" 

を確認してから、

min_fan1_speed = 2000 max_fan1_speed = 5500 

のように実機の値を使って設定します。mbpfan の標準設定も /sys/devices/platform/applesmc.768/fan*_minfan*_max を参照する仕様です。(GitHub)

変更後:

sudo systemctl restart mbpfan 

4. 温度とRPMをリアルタイム監視

sensors 

または、

watch -n 1 sensors 

ファンRPMも直接見たいなら:

watch -n 1 "cat $SMC/fan1_input; sensors" 

Macmini5,2 なら私ならこうします

常用は mbpfan、手動の fan1_output は動作確認用にします。

最初に、次の結果を貼ってもらえれば、Macmini5,2 の実機値に合わせて /etc/mbpfan.conf を具体的に作れます。

uname -r lsmod | grep -E 'applesmc|coretemp' SMC=$(find /sys/devices/platform -maxdepth 1 -type d -name 'applesmc.*' -print -quit) echo "$SMC" for f in "$SMC"/fan*; do echo -n "$f = "; cat "$f"; done sensors 

特に fan1_min / fan1_max とアイドル時・負荷時CPU温度が分かれば、「静音寄り」「冷却寄り」のファンカーブを決められます。

For further actions, you may consider blocking this person and/or reporting abuse

이 글은 dev.to 의 원문을 정제해 보여드립니다. 저작권은 원저작자에게 있습니다.

#hardware#linux#tutorial

전체 내용이 궁금하다면

dev.to 원문에서 이어 읽기

원문 보기

비슷한 글

5유사도 추천