1820261 Members
3147 Online
109622 Solutions
New Discussion юеВ

what does dmesg contain

 
SOLVED
Go to solution
skt_skt
Honored Contributor

what does dmesg contain

Red Hat Enterprise Linux Server release 5.1 (Tikanga)

2.6.18-53.1.14.el5 #1 SMP Tue Feb 19 07:18:46 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

dmesg has the logs from the last system reboot. it does not have any info prior to the last reboot. am i right? where does demsg picks the logs from ? (Is there a file equivalent to that at OS level?
3 REPLIES 3
Heironimus
Honored Contributor
Solution

Re: what does dmesg contain

dmesg returns the contents of the kernel's internal logging, which is a ring buffer. It's held in kernel memory so the oldest entry it can contain is the current boot. If enough stuff goes in to the kernel's message log old entries will roll off the top, too. I think it can also be cleared with dmesg, though the only reason I can think of to do that would be to get a "clean" dmesg output while testing kernel modules.

Most of what you see in dmesg can be copied to syslog if you configure it (I don't remember what Red Hat's typical settings are). I think their init scripts also save the contents of dmesg to /var/log/dmesg during the boot process, which gives you the boot messages that show up before sysklogd starts.
mohamed.bouraoui
Frequent Advisor

Re: what does dmesg contain

Hi friend,
if you want to reteive most logs about the kernel logd, you ca nfind them in /var/log/messages , /var/log/boot and /var/log/dmesg
Nuwan Alwis
Valued Contributor

Re: what does dmesg contain

Hi Kumar,
you got most correct and relevant answer from the very first reply.
messages log only contain the run-time logs. This is why we do tail -f on messages when debugging live systems.

But you cannot do the same thing with dmesg.
its a log file created from initial kernel on the ram till it hand over the system control to disks. once this hand over is done messages file used for further logging and what ever collected during the start-up dumps to the dmesg file for refer if needed Eg: To check if system identified newly attached hardware.

demsg is a textfile so you can read it any way you like such as more,cat,vi,less. the command demsg also does is reads this file and dump the output to console.

this file will get over written @ the next boot.
hope you got me clear,
Good Luck...!