Debian系统中dmesg日志记录的启动信息涵盖系统从内核初始化到硬件、驱动及服务启动的全流程关键事件,主要包括以下类别:
记录内核版本、编译配置及启动参数等核心信息,是判断系统内核状态的基础。例如:
Linux version 5.4.0-42-generic (buildd@lgw01-amd64-039) (gcc version 9.3.0 (Debian 9.3.0-10)) #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020;BOOT_IMAGE=/boot/vmlinuz-5.4.0-42-generic root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro quiet splash vt.handoff=7;Initializing cgroup subsys cpuset、Initializing cgroup subsys cpu。记录BIOS提供的物理内存映射、CPU型号、内存大小及硬盘等硬件设备的识别过程。例如:
BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable;x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers';ata1.00: ATA-8: ST1000DM010-2EP102, CC45, max UDMA/133。记录内核模块(驱动程序)的加载、卸载过程及版本信息,是排查驱动兼容性问题的关键。例如:
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX;usb 1-1: USB disconnect, device number 2;nouveau 0000:01:00.0: DRM: nouveau 1.3.1 initialized。记录启动各阶段的开始与结束时间,帮助分析启动耗时(如内核初始化、用户空间服务启动)。例如:
Freeing unused kernel memory: 1236K;systemd[1]: Starting System Logging Service...;systemd[1]: Started Network Manager。记录设备连接、断开或状态变更事件(如USB插入、硬盘热插拔)。例如:
usb 2-1: new high-speed USB device number 3 using ehci-pci;sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00;pci 0000:00:1f.2: PCI INT A -> GSI 19 (level, low) -> IRQ 19。记录启动过程中遇到的关键错误(如硬件故障、驱动加载失败),是诊断启动问题的核心线索。例如:
ata1.00: ATA command failed: error=0x01 count=0x02 status=0x50(硬盘ATA命令失败);Failed to load module nouveau (module does not exist);EDAC MC0: CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x1234 offset:0x5678 grain:32 syndrome:0x0)。记录安全机制的初始化及策略变更,如SELinux、AppArmor的状态。例如:
SELinux: Initializing.;apparmor module is loaded;avc: denied { read } for pid=1234 comm="apache2" name="config.xml" dev="sda1" ino=5678 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:default_t:s0 tclass=file。记录CPU、内存、磁盘等系统资源的初始化状态及配置。例如:
CPU0: Thermal monitoring enabled (TM1);Memory: 7987520K/8388608K available (12345K kernel code, 2345K rwdata, 3456K rodata, 4567K init, 5678K bss, 67890K reserved, 0K cma-reserved);Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors。