显示开机信息-dmesg

kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息亦保存在/var/log目录中,名称为dmesg的文件里。

dmesg用来显示内核环缓冲区(kernel-ring buffer)内容,内核将各种消息存放在这里。在系统引导时,内核将与硬件和模块初始化相关的信息填到这个缓冲区中。内核环缓冲区中的消息对于诊断系统问题 通常非常有用。在运行dmesg时,它显示大量信息。通常通过less或grep使用管道查看dmesg的输出,这样可以更容易找到待查信息。

例如,如果发现硬盘性能低下,可以使用dmesg来检查它们是否运行在DMA模式:

$dmesg | grep DMA
...
ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
...

上面几行可以说明每个IDE设备正在什么模式下运行。

如果以太网连接出现问题,那么可以在dmesg日志中搜索eth:

$dmesg | grep eth
forcedeth.c: Reverse Engineered nForce
ethernet driver. Version 0.49.
eth0: forcedeth.c: subsystem: 0147b:1c00
bound to 0000:00:04.0
eth0: no IPv6 routers present

如果一切正常,那么dmesg显示每个网卡的硬件配置信息。如果某项系统服务未能得到正确的配置,dmesg日志很快就填满错误消息,这是诊断故障的良好起点。

还可以用来探测系统内核模块的加载情况,比如要检测ACPI的加载情况,使用dmesg | grep acpi

dmesg |egrep -i ''(apm|acpi)''

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

ACPI: Core Subsystem version [20010208]

ACPI: Subsystem enabled

ACPI: System firmware supports: C2

ACPI: plvl2lat=99 plvl3lat=1001

ACPI: C2 enter=1417 C2 exit=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 > boot.messages
and mail the boot.messages file to whoever can debug their problem.

[root@new55 ~]# dmesg >boot.messages

[root@new55 ~]# ls -l boot.messages 
-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 boot.messages

[root@new55 ~]# mail -s "Boot Log of Linux Server" public@web3q.net <boot.messages          需要先用配置系统默认mail服务实现邮件发送
[root@new55 ~]#

浏览dmesg输出的信息

[root@new55 ~]# uname -a
Linux new55 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux

[root@new55 ~]# dmesg | less ---------------------------------分屏显示全部信息
Linux version 2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 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 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.
Using APIC driver default
ACPI: RSDP (v000 HP                                    ) @ 0x000fe270
ACPI: RSDT (v001 HP     30C4     0x31100620 HP   0x00000001) @ 0x1f7efc84
ACPI: FADT (v002 HP     30C4     0x00000002 HP   0x00000001) @ 0x1f7efc00
ACPI: MADT (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efcb8
ACPI: MCFG (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efd14
ACPI: SSDT (v001 HP       HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698
ACPI: DSDT (v001 HP       DAU00  0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfec01000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 6:13 APIC version 20
ACPI: 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 | tail
Bluetooth: L2CAP ver 2.8
Bluetooth: L2CAP socket layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.8
Bluetooth: HIDP (Human Interface Emulation) ver 1.1
eth0: no IPv6 routers present
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: starting 90-second grace period
[root@new55 ~]#

安装SS7卡驱动时的内核日志

[root@localhost ss7dpklnx]# cd SS7HD_DRIVER/
[root@localhost SS7HD_DRIVER]# ls
bbdddlnx_iss.h  bbd_hbi.h  bbd_ioc.c  bbd_isr.c  bbd_pci.c  BSD_license.txt  GPL_V2-only_license.txt  install_ss7hd.sh  Makefile26
bbd_def.h       bbd_hs.c   bbd_ioc.h  bbd_lnx.c  bbd_pro.h  build_ss7hd.sh   i21555.h                 Makefile24
[root@localhost SS7HD_DRIVER]# ./build_ss7hd.sh 
make: Entering directory `/usr/src/kernels/2.6.9-22.EL-i686'
  CC [M]  /root/setup/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/ss7hddvr26.mod.o
  LD [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/ss7hddvr26.ko
make: Leaving directory `/usr/src/kernels/2.6.9-22.EL-i686'http://www.linuxso.com/command/dmesg.html

[root@localhost SS7HD_DRIVER]# ./install_ss7hd.sh 
[root@localhost SS7HD_DRIVER]# lsmod | grep ss7
ss7hddvr26             25808  0
[root@localhost SS7HD_DRIVER]# dmesg | tail
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
SS7HD[0] - suspend

Dialogic SS7HD Device Driver V100.00 (Source V1.21)
Copyright (C) Dialogic Corporation 2003-2010.  All Rights Reserved
Using major device number 251.
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
[root@localhost SS7HD_DRIVER]# ./install_ss7hd.sh remove
[root@localhost SS7HD_DRIVER]# lsmod | grep ss7
[root@localhost SS7HD_DRIVER]# dmesg | tail
BBD[0] 64bit
SS7HD[0] - suspend

Dialogic SS7HD Device Driver V100.00 (Source V1.21)
Copyright (C) Dialogic Corporation 2003-2010.  All Rights Reserved
Using major device number 251.
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
SS7HD[0] - suspend
[root@localhost SS7HD_DRIVER]#

 打印并清除内核环形缓冲区

[root@new55 ~]# dmesg -c
Linux version 2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 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 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.

省略输出

Bluetooth: HIDP (Human Interface Emulation) ver 1.1
eth0: no IPv6 routers present
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: starting 90-second grace period
[root@new55 ~]# dmesg

[root@new55 ~]# less /var/log/dmesg
Linux version 2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 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 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.
Using APIC driver default
ACPI: RSDP (v000 HP                                    ) @ 0x000fe270
ACPI: RSDT (v001 HP     30C4     0x31100620 HP   0x00000001) @ 0x1f7efc84
ACPI: FADT (v002 HP     30C4     0x00000002 HP   0x00000001) @ 0x1f7efc00
ACPI: MADT (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efcb8
ACPI: MCFG (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efd14
ACPI: SSDT (v001 HP       HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698
ACPI: DSDT (v001 HP       DAU00  0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfec01000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 6:13 APIC version 20
ACPI: 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 ~]#

显示开机信息-dmesg的更多相关文章

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

    linux dmesg命令参数及用法详解(linux显示开机信息命令) http://blog.csdn.net/zhongyhc/article/details/8909905 功能说明:显示开机信 ...

  2. 【linux】dmesg命令显示开机信息和设备加载情况

    Linux命令dmesg用来显示开机信息,kernel会将开机信息存储在ring buffer中.您若是开机时来不及查看信息,可利用dmesg来查看.开机信息亦保存在/var/log目录中,名称为dm ...

  3. [ARM-Linux开发]linux dmesg命令参数及用法详解(linux显示开机信息命令)

    功能说明:显示开机信息.语 法:dmesg [-cn][-s <缓冲区大小>]补充说明:kernel会将开机信息存储在ring buffer中.您若是开机时来不及查看信息,可利用dmesg ...

  4. dmesg 显示开机信息。

    功能说明:显示开机信息. 语 法:dmesg [-cn][-s <缓冲区大小>] 补充说明:kernel会将开机信息存储在ring buffer中.您若是开机时来不及查看信息,可利用dme ...

  5. Centos-显示开机信息-dmesg

    dmesg 显示开机信息,开机时内核将开机信息存储在系统缓冲区(ring buffer)中,存储在 /var/log/dmesg文件中

  6. 查看系统启动内核检測硬件信息dmesg

    dmesg用来显示开机信息.kernel会将开机信息存储在ring buffer中.您若是开机时来不及查看信息,可利用dmesg来查看.开机信息亦保存在/var/log文件夹中.名称为dmesg的文件 ...

  7. PHP通过ini_set()来设置显示错误信息和执行时间

    PHP的 ini_set函数是设置选项中的值,在执行函数后生效,脚本结束的时候,这个设置也失效.不是所有的选项都能被改函数设置的.具体那些值能够设置,可以查看手册中的列表. 就是能够设置php.ini ...

  8. [WPF]TextTrimming截断后,ToolTip显示完整信息

    文本过长被截断后,用ToolTip显示完整信息. 文本未被截断,则不显示ToolTip. 值转换器: public class TrimmedTextBlockVisibilityConverter ...

  9. net发布的dll方法和类显示注释信息(字段说明信息)[图解]

    自己发布的dll添加的另一个项目中突然没有字段说明信息了,给使用带来了很多的不便,原因是为了跨项目引用,所以导致不显示注释信息的,一下是解决这个问题的方法. 在要发布(被引用)的项目上右键 => ...

随机推荐

  1. Springboot 使用过滤器进行加密解密(二)

    之前写过一篇关于过滤器实现加密解密功能的文章,但是在实际开发业务中发现,还是有一些问题的,在此特地说明. 第一:过滤器走两遍的问题: 1.过滤器上,添加了两个注解 第一个:@Compent   将此F ...

  2. 我的代码-test models

    # coding: utf-8 # In[2]: import pandas as pdimport numpy as npfrom sklearn.preprocessing import bina ...

  3. [经验分享] MySQL Innodb表导致死锁日志情况分析与归纳【转,纯学习】

    在定时脚本运行过程中,发现当备份表格的sql语句与删除该表部分数据的sql语句同时运行时,mysql会检测出死锁,并打印出日志. 两个sql语句如下: (1)insert into backup_ta ...

  4. 如何将本地git仓库中的代码上传到github

    1,  在github上新建一个仓库,比如为:CSS3Test,仓库地址为:https://github.com/hyuanyuanlisiwei/CSS3Test 2,本地git仓库中的文件项目为C ...

  5. maya模板lock工具

    #lockTemple import  maya.cmds  as  mcimport stringif  mc.window('LockWin',ex=1)==1:    mc.deleteUI(' ...

  6. Game Development Patterns and Best Practices (John P. Doran / Matt Casanova 著)

    https://github.com/PacktPublishing/Game-Development-Patterns-and-Best-Practices https://github.com/m ...

  7. vue 项目 使用sass,node-sass 安装方法及cnpm下如何安装node sass

    内容为转载,方便用时查阅,原文地址: https://www.cnblogs.com/crazycode2/p/6535105.html 1,使用save会在package.json中自动添加. 1 ...

  8. zabbix3.4使用外部邮件报警

    打开web页面,找到 管理--报警媒介类型 打开 Email 填写外部邮箱信息 点击更新,这样发件人和邮箱服务器信息定义完成. 添加收件人信息: 接下来创建动作,配置---动作---选触发器 ok 过 ...

  9. Ubuntu下查看SD卡设备名的几个方法

    Ubuntu下使用SD卡查询SD卡的设备文件名:sudo fdisk -leg:Disk /dev/sdb:14.9 GiB,15931539456 字节,31116288 个扇区单元:扇区 / 1 ...

  10. H3C IRF MAD检测原理及相关问题验证

    一.IRF简介 IRF(Intelligent Resilient Framework,智能弹性架构)是H3C自主研发的软件虚拟化技术.它的核心思想是将多台设备通过IRF物理端口连接在一起,进行必要的 ...