LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Where is dmesgoutput stored? (https://www.linuxquestions.org/questions/linux-software-2/where-is-dmesgoutput-stored-831186/)

abhijit_here 09-09-2010 09:07 AM

Where is dmesgoutput stored?
 
Hi,

I have enabled usb storage debug prints for the debugging of my driver in kernel 2.6.24.4 of Fedora 8. When I type dmesg and press enter I see many prints on the screen.

There are however lot many prints and I want all those prints from the beginning. However it seems that the older prints are overwritten with newer prints. SO if just redirect the dmesg output to some file, I get only newest prints but older are lost.

Surprisingly /var/log/messages doesn't contain those prints! Also I see there is a file named /var/log/dmesg , but that files never gets updated with the prints I see on the screen.

So, my question is can I get all those dmesg prints right from the beginning in a file somewhere?

Regards,
Abhijit

Guttorm 09-09-2010 10:47 AM

The dmesg log is a ring buffer for the kernel in memory. When it's full, the oldest lines are removed. The kernel can then log things before any disks are mounted, when disks are full and so on. You can increase the size of it, or make a script that writes it to file every now and then, with for example this line in cron "dmesg -c >>/var/log/dmesg".

See "man dmesg" for details.


All times are GMT -5. The time now is 06:16 AM.