当dmesg
显示硬件故障时,可以按照以下步骤进行排查和解决:
dmesg | less
或dmesg | more
来分页查看详细的错误日志。dmesg
输出中的设备名称(如sda
, eth0
等)定位到具体的硬件组件。lsblk
或lshw
命令进一步确认设备的状态和配置。apt
, yum
, dnf
等包管理器来更新驱动。dmesg
,还可以查看/var/log/syslog
, /var/log/messages
等系统日志文件,获取更多线索。假设dmesg
显示如下错误:
[ 0.000000] Memory: 8175M/16384M available (8192K kernel code, 1316K rwdata, 4588K rodata, 1748K init, 947M bss, 2678M reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Size=1.00MB, MinObjects=16, CPUs=8, Nodes=1, Order=0, MinPartitions=0, Relaxed=0, Swappiness=30, NumaStat=0, DCacheLines=64, HardwareCorrupted=0, LargeSystem=1, BadCPU=0, NonLinear=0, Softlockup=0, Stats=0/0, HWCacheAlign=64, Addressing=64bit, Harderr=0, Bigalloc=0, NOSMT=0, StrictSizeFit=0, NonNominalStore=0, RDMA=0, ADR=0, SMT=0, RCU=0, HardwareRetry=0, LargePages=0, Writeback=0, Context=0, PAE=1, NUMA=1
[ 0.000000] NUMA: Node 0 (0x0000000000000000) detected: 16GB
[ 0.000000] NUMA: Node 0 CPUS: 0-7
[ 0.000000] NUMA: Node 0 size: 16384MB
[ 0.000000] NUMA: Node 0 Free memory: 8175MB
[ 0.000000] NUMA: Topology node 0 has 1 socket(s), 8 core(s) per socket, and 2 thread(s) per core.
[ 0.000000] NUMA: Node 0's CPUs: 0-7
[ 0.000000] NUMA: Node 0's memory: 0-16383MB
[ 0.000000] smpboot: CPU0: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (family: 0x6, model: 0x9e, stepping: 0x9)
[ 0.000000] Performance Events: PEBS fmt3+, Intel PMU driver.
[ 0.000000] rcu: Hierarchical SRCU implementation.
[ 0.000000] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[ 0.000000] clocksource: tsc: Fast TSC calibration using PIT
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] Performance Events: PEBS fmt3+, Intel PMU driver.
[ 0.000000] rcu: Hierarchical SRCU implementation.
[ 0.000000] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[ 0.000000] clocksource: tsc: Fast TSC calibration using PIT
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[3]: 896, xstate_sizes[3]: 384
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[4]: 1280, xstate_sizes[4]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[5]: 1920, xstate_sizes[5]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[6]: 2560, xstate_sizes[6]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[7]: 3200, xstate_sizes[7]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[8]: 3840, xstate_sizes[8]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[9]: 4480, xstate_sizes[9]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[10]: 5120, xstate_sizes[10]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[11]: 5760, xstate_sizes[11]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[12]: 6400, xstate_sizes[12]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[13]: 7040, xstate_sizes[13]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[14]: 7680, xstate_sizes[14]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[15]: 8320, xstate_sizes[15]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[16]: 8960, xstate_sizes[16]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[17]: 9600, xstate_sizes[17]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[18]: 10240, xstate_sizes[18]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[19]: 10880, xstate_sizes[19]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[20]: 11520, xstate_sizes[20]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[21]: 12160, xstate_sizes[21]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[22]: 12800, xstate_sizes[22]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[23]: 13440, xstate_sizes[23]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[24]: 14080, xstate_sizes[24]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[25]: 14720, xstate_sizes[25]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[26]: 15360, xstate_sizes[26]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[27]: 16000, xstate_sizes[27]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[28]: 16640, xstate_sizes[28]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[29]: 17280, xstate_sizes[29]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[30]: 17920, xstate_sizes[30]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[31]: 18560, xstate_sizes[31]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] x86/fpu: xstate_offset[32]: 19200, xstate_sizes[32]: 640
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.00