Wednesday, April 17, 2019

Difference between /var/log/messages and /var/log/dmesg log files

/var/log/messages – This file contains global system messages, including the messages that are logged during system startup. There are several things that are logged in /var/log/messages including mail, cron, daemon, kern, auth, etc.

[root@localhost ~]# cat /var/log/messages
Apr 17 20:30:03 localhost rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-34.el7" x-pid="9423" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Apr 17 20:40:02 localhost systemd: Started Session 9 of user root.
Apr 17 20:40:32 localhost dhclient[9217]: DHCPREQUEST on ens33 to 192.168.189.254 port 67 (xid=0xde4e9a7)
Apr 17 20:40:32 localhost dhclient[9217]: DHCPACK from 192.168.189.254 (xid=0xde4e9a7)
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8097] dhcp4 (ens33):   address 192.168.189.128
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8107] dhcp4 (ens33):   plen 24 (255.255.255.0)
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8107] dhcp4 (ens33):   gateway 192.168.189.2
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8107] dhcp4 (ens33):   lease time 1800
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8107] dhcp4 (ens33):   nameserver '192.168.189.2'
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8107] dhcp4 (ens33):   domain name 'localdomain'
Apr 17 20:40:32 localhost NetworkManager[8908]: <info>  [1555513832.8108] dhcp4 (ens33): state changed bound -> bound
Apr 17 20:40:32 localhost dbus[8773]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Apr 17 20:40:32 localhost dhclient[9217]: bound to 192.168.189.128 -- renewal in 735 seconds.
Apr 17 20:40:32 localhost systemd: Starting Network Manager Script Dispatcher Service...
.
.
.


/var/log/dmesg – This file contains kernel ring buffer information. When the system boots up, it prints number of messages on the screen that displays information about the hardware devices that the kernel detects during boot process. These messages are available in kernel ring buffer and whenever the new message comes the old message gets overwritten. You can also view the content of this file using the dmesg command.

[root@localhost ~]# cat /var/log/dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-957.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_IN.UTF-8
[    0.000000] Disabled fast string operations
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ebff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009ec00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000dc000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bfecffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000bfed0000-0x00000000bfefefff] ACPI data
[    0.000000] BIOS-e820: [mem 0x00000000bfeff000-0x00000000bfefffff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000bff00000-0x00000000bfffffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000f0000000-0x00000000f7ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec0ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffe0000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000013fffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.7 present.
[    0.000000] DMI: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/13/2018
[    0.000000] Hypervisor detected: VMware
[    0.000000] vmware: TSC freq read from hypervisor : 2903.999 MHz
[    0.000000] vmware: Host bus clock speed read from hypervisor : 66000000 Hz
[    0.000000] vmware: using sched offset of 9162497474 ns
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] e820: last_pfn = 0x140000 max_arch_pfn = 0x400000000
[    0.000000] MTRR default type: uncachable
[    0.000000] MTRR fixed ranges enabled:
.
.
.

No comments:

Post a Comment