LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-07-2020, 05:19 AM   #1
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Centos 8: Replacement for /var/log/dmesg?


Centos/RHEL 7 saves the kernel message buffer to /var/log/dmesg at the end of system startup. This is done using a systemd service named rhel-dmesg. It's a simple but useful feature; it makes sense to keep startup messages. I don't know how long they are kept in /var/log/messages or the systemd journal.

Centos 8 doesn't seem to have /var/log/dmesg or this service. Or perhaps I am wrong? It's not hard to craft such a service myself, but it would be better to know if there is anything equivalent in 8. Does anybody know?
 
Old 02-08-2020, 05:00 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Not using CentOS, but on my system
Code:
systemctl|grep dmesg
returns nothing. And there's no /var/log/dmesg.
 
Old 02-08-2020, 05:58 AM   #3
Dennis99
LQ Newbie
 
Registered: Dec 2006
Location: Gorleston, Norfolk, UK
Distribution: Debian, Manjaro, Raspian
Posts: 18

Rep: Reputation: 10
I use journalctl? in Manjaro & Debian.
 
Old 02-08-2020, 06:46 AM   #4
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by berndbausch View Post
it makes sense to keep startup messages. I don't know how long they are kept in /var/log/messages or the systemd journal.
Unless some script (or service in systemd) saves them (early) they're not kept anywhere, except in the kernel's diagnostic buffer (dmesg stands for Diagnostic MESsaGes):
Quote:
dmesg - print or control the kernel ring buffer

dmesg is used to examine or control the kernel ring buffer.
(from the man page of the "dmesg" command).

In Slackware (what I'm using) the buffer is saved into a file early during the multi-user startup:
Code:
/bin/dmesg -s 65536 > /var/log/dmesg
but never afterwards anymore.

According to the man page for dmesg, this kernel ring buffer is by default 16KB (although newer kernels may have increased this):
Quote:
-s, --buffer-size size
Use a buffer of size to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default then this option can be used to view the entire buffer.
so the command allows for a buffersize up to 64 KB.
 
  


Reply

Tags
centos, dmesg, rhel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
where are /var/log/dmesg and /var/log/messages sryzdn Linux - Newbie 4 02-09-2015 09:35 PM
Difference between ouput of dmesg and content of /var/log/dmesg Sayan Acharjee Linux - General 1 09-21-2011 10:42 AM
dmesg vs /var/log/dmesg drManhattan Linux - Newbie 2 08-07-2011 05:28 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
dmesg (command) and /var/log/dmesg are different? Oxagast Linux - Software 2 07-10-2006 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration