Do, or Do Not. There Is No “Try”.

本文回忆了作者在美国求学准备个人陈述时的经历。一位国际教师严厉指出了使用我会尽力这一表达的不当之处,并强调了积极肯定态度的重要性。文章通过这个小故事传达了一个明确的信息:要么去做,要么不做,但不要说尝试。

March 22, 2012 ·from www.yingyingz.com

I came across an article called “3 Words That Guarantee Failure“,and can’t agree with it more.

“I will try…”

It made me think of my old days of preparing applications to schools in United States. I was working hard to get my personal statement done at that time, and asked help from Steve, one of the international teachers in my college. I grabbed him minutes before his class togo over my draft, and after scanning he simply said: “You need to rework.” butdid not gave me much indication on how to make it better.

“Send email to me as soon as you’re done with rework.”He said.

“Ah.. ” I said. “I will try my best.”

“What?” He looked angry. “You should NEVER EVER saythat.” At the moment, the class bell rang. Floods of students passed the building entrance, right where we stood. I felt every single person passed by staring at me, and the old angry man who was shouting in English. My face felt like burning.

“If you say you try something, you’ll NEVER get itdone. Do you know that?” He pointed to my draft. “And I’m not interested inspending my time on it.”

“I will make it!” I said loudly. “I will make it!”

His face lit up a bit. ”That will work. Send email tome then.” Before then turning around to the direction of his class, he added,”Remember that.”

I remembered. And here I am in United States.

It’s true. And I recall it every time when I want tosay “I will try”. Do, or do not. There is no “try” if you want to get thingsdone.

Share with Your Friends:)

root@zhouzhun-virtual-machine:~# sudo apt install lm-sensors Reading package lists... Done Building dependency tree... Done Reading state information... Done lm-sensors is already the newest version (1:3.6.0-7ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. root@zhouzhun-virtual-machine:~# sudo sensors-detect # sensors-detect version 3.6.0 # System: VMware, Inc. VMware Virtual Platform [None] # Board: Intel Corporation 440BX Desktop Reference Platform # Kernel: 6.8.0-85-generic x86_64 # Processor: Intel(R) Core(TM) Ultra 7 155H (6/170/4) This program will help you determine which kernel modules you need to load to use lm_sensors most effectively. It is generally safe and recommended to accept the default answers to all questions, unless you know what you're doing. Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): Y Module cpuid loaded successfully. Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... No AMD Family 11h thermal sensors... No AMD Family 12h and 14h thermal sensors... No AMD Family 15h thermal sensors... No AMD Family 16h thermal sensors... No AMD Family 17h thermal sensors... No AMD Family 15h power sensors... No AMD Family 16h power sensors... No Hygon Family 18h thermal sensors... No Intel digital thermal sensor... No Intel AMB FB-DIMM thermal sensor... No Intel 5500/5520/X58 thermal sensor... No VIA C7 thermal sensor... No VIA Nano thermal sensor... No Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): Y Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor/ITE'... Yes Found unknown chip with ID 0x0200 Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor/ITE'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No Some systems (mainly servers) implement IPMI, a set of common interfaces through which system health data may be retrieved, amongst other things. We first try to get the information from SMBIOS. If we don't find it there, we have to read from arbitrary I/O ports to probe for such interfaces. This is normally safe. Do you want to scan for IPMI interfaces? (YES/no): Y Probing for `IPMI BMC KCS' at 0xca0... No Probing for `IPMI BMC SMIC' at 0xca8... No Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (YES/no): Y Probing for `National Semiconductor LM78' at 0x290... No Probing for `National Semiconductor LM79' at 0x290... No Probing for `Winbond W83781D' at 0x290... No Probing for `Winbond W83782D' at 0x290... No Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): Y Using driver `i2c-piix4' for device 0000:00:07.3: Intel 82371AB PIIX4 ACPI Sorry, no sensors were detected. Either your system has no sensors, or they are not supported, or they are connected to an I2C or SMBus adapter that is not supported. If you find out what chips are on your board, check https://hwmon.wiki.kernel.org/device_support_status for driver status.
10-07
<think>我们面对的问题是:在安装lm-sensors并执行sensors-detect后仍未检测到传感器,导致缺失CPU温度文件。这通常表明系统无法识别硬件传感器。以下是逐步的解决方案: ### 1. **验证驱动加载情况** 首先检查必要的内核驱动(如Intel的`coretemp`或AMD的`k10temp`)是否已加载: ```bash lsmod | grep -E 'coretemp|k10temp|acpitz' ``` - 若无输出,手动加载驱动: ```bash # Intel CPU sudo modprobe coretemp # AMD CPU sudo modprobe k10temp ``` - 若提示`modprobe: FATAL: Module coretemp not found`,可能是内核未包含该驱动。需检查内核配置或更新内核。 ### 2. **扩展传感器检测范围** 部分硬件可能使用非常规路径,尝试全局搜索温度文件: ```bash find /sys -name '*temp*' 2>/dev/null | grep input ``` 重点关注以下路径: ``` /sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input /sys/class/hwmon/hwmon*/temp*_input ``` ### 3. **检查硬件兼容性** - **虚拟机环境**: 虚拟机(如VMware/VirtualBox)默认可能不暴露温度传感器。需启用虚拟化扩展: - VMware:在`.vmx`文件中添加`vhv.enable = "TRUE"` - 加载虚拟机专用驱动: ```bash sudo modprobe vmw_temp # VMware sudo modprobe virtio_thermal # KVM/QEMU ``` - **老旧硬件**: 2007年前的Intel CPU或部分嵌入式设备可能无传感器支持[^1]。可尝试替代监控方案(如IPMI)。 ### 4. **手动配置lm-sensors** 若`sensors-detect`未生成配置文件,可手动创建`/etc/sensors.d/local.conf`: ```conf # 示例:强制加载coretemp驱动 chip "coretemp-*" label temp1 "CPU Package" compute temp1 @+10, @-10 # 可选:校准偏移值 ``` 重启服务生效: ```bash sudo systemctl restart lm-sensors ``` ### 5. **替代监控方案** - **IPMI(服务器专用)**: 若为主板自带传感器,安装`ipmitool`读取: ```bash sudo apt install ipmitool sudo ipmitool sdr | grep -i temp ``` - **ACPI接口**: 部分设备通过ACPI暴露温度: ```bash cat /sys/class/thermal/thermal_zone*/temp ``` ### 6. **内核级诊断** 若上述步骤均失败,检查内核日志确认硬件识别状态: ```bash dmesg | grep -i -E 'thermal|temp|sensor' ``` 典型错误案例: - `ACPI: Thermal Zone [THM0] (48 C) failed to register` → ACPI配置错误 - `coretemp: CPU does not support thermal sensors` → 硬件不支持 ### 📊 故障解决流程图 ```mermaid graph TD A[sensors无输出] --> B{驱动加载?} B -->|否| C[加载 coretemp/k10temp] B -->|是| D{硬件兼容?} D -->|虚拟机| E[启用虚拟化驱动] D -->|物理机| F[检查内核日志] F -->|识别错误| G[更新内核/BIOS] F -->|无错误| H[手动配置lm-sensors] H --> I[成功?] I -->|否| J[使用IPMI/ACPI] ``` §§ 相关问题 §§ 1. 如何更新Linux内核以支持新的硬件传感器? 2. VMware虚拟机中如何启用CPU温度监控? 3. 服务器主板温度如何通过IPMI工具获取? 4. 如何校准lm-sensors检测到的温度值? 5. 哪些硬件型号已知不支持Linux温度监控? 引用说明: 本文部分方案参考lm-sensors官方文档的硬件兼容性说明[^1][^2][^4]。 </think>### 解决 lm-sensors 未检测到传感器的问题 以下是针对安装 lm-sensors 后仍未检测到传感器的系统级解决方案(按优先级排序): #### 🔧 1. **强制加载内核驱动(关键步骤)** ```bash # Intel CPU(大多数现代设备) sudo modprobe coretemp # AMD CPU(Ryzen/EPYC 等) sudo modprobe k10temp # 老旧 AMD CPU sudo modprobe k8temp # 虚拟机专用驱动 sudo modprobe vmw_temp # VMware sudo modprobe virtio_thermal # KVM/QEMU ``` - 验证加载:`lsmod | grep -E 'coretemp|k10|k8|virtio'` - 永久生效:`echo "coretemp" | sudo tee /etc/modules-load.d/coretemp.conf` #### ️ 2. **硬件兼容性深度检测** ```bash # 检查内核是否识别到温度传感器 sudo dmesg | grep -i -E 'thermal|temp|sensor' # 检测 ACPI 接口 sudo acpi -V # 扫描 PCI 设备中的传感器控制器 lspci -v | grep -i 'sensor\|thermal' ``` - 若输出包含 `No thermal zones found` 或类似信息,表明硬件可能不支持[^1] #### ️ 3. **手动配置传感器参数** 创建自定义配置文件: ```bash sudo nano /etc/sensors.d/custom.conf ``` 添加以下内容(根据 CPU 类型选择): ```conf # Intel 示例 chip "coretemp-*" label temp1 "CPU Package" ignore temp2 ignore temp3 # AMD 示例 chip "k10temp-*" label temp1 "CPU Core" compute temp1 @+10, @-10 # 校准偏移值 ``` 重启服务:`sudo systemctl restart lm-sensors` #### 📡 4. **启用隐藏传感器接口** 某些主板需要解锁隐藏寄存器: ```bash # 尝试解锁硬件监控(危险操作!) sudo setpci -s 0:14.3 0x88.L=0x0100 # 检查寄存器状态 sudo sensors-detect --show-regs ``` > ⚠️ 此操作可能导致系统不稳定,仅建议在服务器/专用设备尝试 #### 🔄 5. **内核参数调整** 编辑 GRUB 配置: ```bash sudo nano /etc/default/grub ``` 在 `GRUB_CMDLINE_LINUX` 行追加: ```conf acpi_enforce_resources=lax thermal.off=1 pci=noacpi ``` 更新并重启: ```bash sudo update-grub sudo reboot ``` #### 💻 6. **替代数据获取方案** 当标准接口不可用时: ```bash # 尝试直接读取 ACPI 数据 cat /sys/class/thermal/thermal_zone*/temp # 检查 IPMI 接口(服务器专用) sudo ipmitool sdr | grep -i temp # 提取 SMBIOS 数据 sudo dmidecode -t 29 ``` ### 📊 硬件兼容性参考表 | 硬件类型 | 支持情况 | 备用方案 | |-----------------|-----------------------------------|------------------------| | Intel CPU < 2008| ❌ 无内核驱动支持 | 硬件升级 | | AMD Bulldozer | ️ 需手动加载 `k10temp` | 配置自定义模块参数 | | 虚拟机 | ✅ 需加载 `vmw_temp`/`virtio` | 启用虚拟化扩展 | | 嵌入式设备 | ⚠️ 需定制内核 | 联系硬件厂商提供驱动 | ### ⚠️ 终极建议 若上述方案均无效,可能是硬件限制: 1. 老旧 CPU(如 Intel Core 2 Duo 之前)无温度传感器 2. 定制化/工控主板未实现标准接口 3. 虚拟机未正确配置硬件模拟 此时建议: ```bash # 硬件信息摘要 sudo lshw -class processor -class memory sudo inxi -Fxz ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值