linuxdmesg命令参数及用法详解(linux显示开机信息命令)

linuxdmesg命令参数及用法详解(linux显示开机信息命令)

2023年7月10日发(作者:)

linuxdmesg命令参数及⽤法详解(linux显⽰开机信息命令)功能说明:显⽰开机信息。语  法:d [-cn][-s <缓冲区⼤⼩>]补充说明:kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利⽤来查看。开机信息亦保存在/var/log⽬录中,名称为dmesg的⽂件⾥。参  数: -c  显⽰信息后,清除ring buffer中的内容。

 -s<缓冲区⼤⼩>  预设置为8196,刚好等于ring buffer的⼤⼩。

 -n  设置记录信息的层级。扩展阅读⼀:dmesg主要⽤途

主要应⽤:dmesg⽤来显⽰内核环缓冲区(kernel-ring buffer)内容,内核将各种消息存放在这⾥。在系统引导时,内核将与硬件和模块初始化相关的信息填到这个缓冲区中。内核环缓冲区中的消息对于诊断系统问题 通常⾮常有⽤。在运⾏dmesg时,它显⽰⼤量信息。通常通过或使⽤管道查看dmesg的输出,这样可以更容易找到待查信息。例如,如果发现硬盘性能低下,可以使⽤dmesg来检查它们是否运⾏在DMA模式:$dmesg | 0: BM-DMA at 0xf000-0xf007, BIOS tings: hda:DMA, hdb:DMAide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, 上⾯⼏⾏可以说明每个IDE设备正在什么模式下运⾏。如果以太⽹连接出现问题,那么可以在dmesg⽇志中搜索eth:$dmesg | grep ethforcedeth.c: Reverse Engineered nForceethernet driver. Version 0: forcedeth.c: bsystem: 0147b:1c00bound to 0000:00:04.0eth0: no IPv6 routers present如果⼀切正常,那么dmesg显⽰每个⽹卡的硬件配置信息。如果某项系统服务未能得到正确的配置,dmesg⽇志很快就填满错误消息,这是诊断故障的良好起点。还可以⽤来探测系统内核模块的加载情况,⽐如要检测ACPI的加载情况,使⽤dmesg | grep ai dmesg | -i ''(apm|acpi)''

Kernel command line: vga=274 quiet console=ttyS3,9600acpi=no-idleoot=/dev/hda3

ACPI: Core Subsystem version [20010208]

ACPI: Subsystem d

ACPI: System fiware supports: C2

ACPI: plvl2lat=99 plvl3lat=1001

ACPI: C2 enter=1417 C2 it=354

ACPI: C3 enter=-1 C3 exit=-1 ACPI: Not using ACPI idle

ACPI: System firmware supports: S0 S1 S4 S5扩展阅读⼆:dmesg命令使⽤⽰例

使⽤⽰例⽰例⼀ 将开机信息发邮件man dmesg 写道The program helps users to print out their bootup messages. Instead of copying the messages by hand, the user need only:

dmesg > es

and mail the es to ever can debug their problem.

[root@new55 ~]# dmesg >es[root@new55 ~]# -l es

-rw-r--r-- 1 root root 15838 12-09 12 begin_of_the_skype_highlighting 15838 12-09 12 免费 end_of_the_skype_highlighting:55 es[root@new55 ~]# mail -s "Boot Log of Linux Server" public@

[root@new55 ~]#⽰例⼆ 浏览dmesg输出的信息[root@new55 ~]# -aLinux new55 5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux[root@new55 ~]# dmesg | lessLinux version 5 (mockbuild@) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010BIOS-provided physical RAM map: BIOS-e820: 0000 - fc00 (usable) BIOS-e820: fc00 - a0000 (reserved) BIOS-e820: e0000 - 0000 (reserved) BIOS-e820: 0000 - 000000001f7d0000 (usable) BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved) BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS) BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved) BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved) BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved) BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved) BIOS-e820: 00000000fff00000 - 0000 (reserved)0MB HIGHMEM available.503MB LOWMEM for crash kernel (0x0 to 0x0) notwithin permissible rangedisabling kmpUsing x86 segment limits to approximate NX protectionOn node 0 totalpages: 128976 DMA zone: 4096 pages, LIFO batch:0 Normal zone: 124880 pages, LIFO batch:31DMI 2.3 APIC driver defaultACPI: RSDP (v000 HP ) @ 0x000fe270ACPI: RSDT (v001 HP 30C4 0x31100620 HP 0x00000001) @ 0x1f7efc84ACPI: FADT (v002 HP 30C4 0x00000002 HP 0x00000001) @ 0x1f7efc00ACPI: MADT (v001 HP 30C4 0x00000001 HP 0x00000001) @ 0x1f7efcb8ACPI: MCFG (v001 HP 30C4 0x00000001 HP 0x00000001) @ 0x1f7efd14ACPI: SSDT (v001 HP HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698ACPI: DSDT (v001 HP DAU00 0x00010000 MSFT 0x0100000e) @ 0x00000000ACPI: PM-Timer IO Port: 0x1008ACPI: Local APIC address 0xfec01000ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)Processor #0 6:13 APIC version 20ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23:

⽰例三 查看dmesg尾部的信息[root@new55 ~]# dmesg | tailBluetooth: L2CAP ver 2.8Bluetooth: L2CAP socket layer initializedBluetooth: RFCOMM socket layer initializedBluetooth: RFCOMM TTY layer initializedBluetooth: RFCOMM ver 1.8Bluetooth: HIDP (Human Interface Emulation) ver 1.1eth0: no IPv6 routers presentInstalling knfsd (copyright (C) 1996 okir@).NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 e recovery directoryNFSD: starting 90-second grace period[root@new55 ~]#

⽰例四 安装SS7卡驱动时的内核⽇志[root@localhost ss7dpkx]# SS7HD_DRIVER/[root@localhost SS7HD_DRIVER]# lsbbdddlnx_iss.h bbd_hbi.h bbd_ioc.c bbd_isr.c bbd_pci.c BSD_ GPL_V2-only_ install_

Makefile26bbd_def.h bbd_hs.c bbd_ioc.h bbd_lnx.c bbd_pro.h build_ i21555.h Makefile24[root@localhost SS7HD_DRIVER]# ./build_

make: Entering directory `/usr/src/kernels/-i686' CC [M] /root//ss7dpklnx/SS7HD_DRIVER/bbd_hs.o CC [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_ioc.o CC [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_isr.o CC [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_pci.o CC [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_lnx.o LD [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/ss7hddvr26.o Building modules, stage 2. MODPOST CC /root/setup/ss7dpklnx/SS7HD_DRIVER/.o LD [M] /root/setup/ss7dpklnx/SS7HD_DRIVER/: Leaving directory `/usr/src/kernels/-i686'/command/[root@localhost SS7HD_DRIVER]# ./install_

[root@localhost SS7HD_DRIVER]# | grep ss7ss7hddvr26 25808 0[root@localhost SS7HD_DRIVER]# dmesg | tailACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9BBD[0] 64bitSS7HD[0] - suspendDialogic SS7HD Device Driver V100.00 (Source V1.21)Copyright (C) Dialogic Corporation 2003-2010. All Rights ReservedUsing major device number : PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9BBD[0] 64bit[root@localhost SS7HD_DRIVER]# ./install_ remove[root@localhost SS7HD_DRIVER]# lsmod | grep ss7[root@localhost SS7HD_DRIVER]# dmesg | tailBBD[0] 64bitSS7HD[0] - suspendDialogic SS7HD Device Driver V100.00 (Source V1.21)Copyright (C) Dialogic Corporation 2003-2010. All Rights ReservedUsing major device number : PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9BBD[0] 64bitSS7HD[0] - suspend[root@localhost SS7HD_DRIVER]#

⽰例五 打印并清除内核环形缓冲区[root@new55 ~]# dmesg -cLinux version 5 (mockbuild@) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010BIOS-provided physical RAM map: BIOS-e820: 0000 - fc00 (usable) BIOS-e820: fc00 - a0000 (reserved) BIOS-e820: e0000 - 0000 (reserved) BIOS-e820: 0000 - 000000001f7d0000 (usable) BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved) BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS) BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved) BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved) BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved) BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved) BIOS-e820: 00000000fff00000 - 0000 (reserved)0MB HIGHMEM available.503MB LOWMEM for crash kernel (0x0 to 0x0) notwithin permissible rangedisabling kUsing x86 segment limits to approximate NX protectionOn node 0 totalpages: 128976 DMA zone: 4096 pages, LIFO batch:0 Normal zone: 124880 pages, LIFO batch:31DMI 2.3 present.省略输出Bluetooth: HIDP (Human Interface Emulation) ver 1.1eth0: no IPv6 routers presentInstalling knfsd (copyright (C) 1996 okir@).NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directoryNFSD: starting 90-second grace period[root@new55 ~]# dmesg[root@new55 ~]# less /var/log/dmesgLinux version 5 (mockbuild@) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010BIOS-provided physical RAM map: BIOS-e820: 0000 - fc00 (usable) BIOS-e820: fc00 - a0000 (reserved) BIOS-e820: e0000 - 0000 (reserved) BIOS-e820: 0000 - 000000001f7d0000 (usable) BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved) BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS) BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved) BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved) BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved) BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved) BIOS-e820: 00000000fff00000 - 0000 (reserved)0MB HIGHMEM available.503MB LOWMEM for crash kernel (0x0 to 0x0) notwithin permissible rangedisabling kdumpUsing x86 segment limits to approximate NX protectionOn node 0 totalpages: 128976 DMA zone: 4096 pages, LIFO batch:0 Normal zone: 124880 pages, LIFO batch:31DMI 2.3 APIC driver defaultACPI: RSDP (v000 HP ) @ 0x000fe270ACPI: RSDT (v001 HP 30C4 0x31100620 HP 0x00000001) @ 0x1f7efc84ACPI: FADT (v002 HP 30C4 0x00000002 HP 0x00000001) @ 0x1f7efc00ACPI: MADT (v001 HP 30C4 0x00000001 HP 0x00000001) @ 0x1f7efcb8ACPI: MCFG (v001 HP 30C4 0x00000001 HP 0x00000001) @ 0x1f7efd14ACPI: SSDT (v001 HP HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698ACPI: DSDT (v001 HP DAU00 0x00010000 MSFT 0x0100000e) @ 0x00000000ACPI: PM-Timer IO Port: 0x1008ACPI: Local APIC address 0xfec01000ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)Processor #0 6:13 APIC version 20ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23[root@new55 ~]#

发布者:admin,转转请注明出处:http://www.yc00.com/web/1688987858a192024.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信