Debian系統中,dmesg
日志里常見的啟動問題及對應排查方向如下:
-
硬件相關問題
- 設備未識別:如“USB device not responding”,可能是驅動未正確安裝或硬件連接異常。
- 驅動加載失敗:提示“module not found”或“failed to load”,需檢查驅動是否兼容當前內核,或重新安裝驅動。
- 硬件沖突:如“interrupt conflict”(中斷沖突),需排查設備中斷配置是否重復。
-
文件系統問題
- 文件系統損壞:出現“EXT4-fs error”或“filesystem has unsupported feature(s)”,需用
fsck
修復。
- 掛載失敗:如“mount point does not exist”,檢查
/etc/fstab
配置或設備路徑是否正確。
-
內存問題
- 內存不足(OOM):日志中顯示“Out of memory”或進程被終止,需增加物理內存或調整
vm.overcommit_memory
參數。
- 內存泄漏:通過
dmesg | grep -i memory
定位泄漏進程,優化程序或重啟服務。
-
網絡問題
- 網卡未激活:如“eth0: link down”,檢查物理連接、網卡驅動或配置文件(如
/etc/network/interfaces
)。
- IP沖突:提示“IP address conflict”,排查網絡中重復IP地址。
-
內核與系統問題
- 內核崩潰(Kernel panic):日志中包含“Kernel panic - not syncing”,需檢查硬件兼容性或回滾內核版本。
- 服務啟動失敗:如“failed to start service”,查看對應服務的日志(如
journalctl -u service_name
)。
-
權限與配置問題
- 權限不足:普通用戶運行
dmesg
報錯“Operation not permitted”,需使用sudo
。
- 配置文件錯誤:如
/etc/modprobe.d/*.conf
中參數錯誤,導致模塊加載異常。
可通過dmesg | grep -i error
快速定位關鍵錯誤,結合硬件狀態、驅動版本及系統日志綜合分析。