What is the use of dmesg file, and how is it different from messages log file ?
Today we will understand what is the difference between messages and dmesg log file.
dmesg command is used to review boot messages of the system.
dmesg is a cyclic buffer that contains log messages of the current system boot.
The contents of dmesg file old contents gets overwritten once this cyclic buffer gets filled.
However messages file contents does not overwritten and it stays there for future troubleshooting.
1. dmesg file
[ngelinux01 ]# cd /var/log/ [ngelinux01 log ]# ls -l dmesg -rw-r--r--. 1 root root 32853 Jul 2 17:06 dmesg [ngelinux01 log]# date Fri 2 Jul 17:07:49 BST 2021
2. Check contents of dmesg file.
[ngelinux01 log]# cat 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-514.10.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1SMP Fri Mar 3 00:04:05 UTC 2017 [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-514.10.2.el7.x86_64 root=/dev/mapper/centos_lvm-root ro rd.lvm.lv=centos_lvm/root vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=uk rhgb quiet LANG=en_GB.UTF-8 [ 0.000000] e820: BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000001ffdbfff] usable [ 0.000000] BIOS-e820: [mem 0x000000001ffdc000-0x000000001fffffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved [ 0.000000] NX (Execute Disable) protection: active [ 0.000000] SMBIOS 2.8 present. [ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-1.fc25 04/01/2014 [ 0.000000] Hypervisor detected: KVM [ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved [ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable [ 0.000000] e820: last_pfn = 0x1ffdc max_arch_pfn = 0x400000000 [ 0.000000] MTRR default type: write-back [ 0.000000] MTRR fixed ranges enabled: [ 0.000000] 00000-9FFFF write-back [ 0.000000] A0000-BFFFF uncachable [ 0.000000] C0000-FFFFF write-protect [ 0.000000] MTRR variable ranges enabled: [ 0.000000] 0 base 0080000000 mask FF80000000 uncachable [ 0.000000] 1 disabled [ 0.000000] 2 disabled [ 0.000000] 3 disabled [ 0.000000] 4 disabled [ 0.000000] 5 disabled [ 0.000000] 6 disabled [ 0.000000] 7 disabled [ 0.000000] PAT not supported by CPU. [ 0.000000] found SMP MP-table at [mem 0x000f6b90-0x000f6b9f] mapped at [ffff8800000f6b90] [ 0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576 [ 0.000000] BRK [0x01f9e000, 0x01f9efff] PGTABLE [ 0.000000] BRK [0x01f9f000, 0x01f9ffff] PGTABLE [ 0.000000] BRK [0x01fa0000, 0x01fa0fff] PGTABLE [ 0.000000] BRK [0x01fa1000, 0x01fa1fff] PGTABLE [ 0.000000] RAMDISK: [mem 0x1db4e000-0x1f8c7fff] [ 0.000000] ACPI: RSDP 00000000000f69c0 00014 (v00 BOCHS ) [ 0.000000] ACPI: RSDT 000000001ffe18dc 00030 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001) [ 0.000000] ACPI: FACP 000000001ffe17b8 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001) [ 0.000000] ACPI: DSDT 000000001ffe0040 01778 (v01 BOCHS BXPCDSDT 00000001 BXPC 00000001) [ 0.000000] ACPI: FACS 000000001ffe0000 00040 [ 0.000000] ACPI: APIC 000000001ffe182c 00078 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001) [ 0.000000] ACPI: HPET 000000001ffe18a4 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001) [ 0.000000] ACPI: Local APIC address 0xfee00000 [ 0.000000] No NUMA configuration found [ 0.000000] Faking a node at [mem 0x0000000000000000-0x000000001ffdbfff] [ 0.000000] Initmem setup node 0 [mem 0x00000000-0x1ffdbfff] [ 0.000000] NODE_DATA [mem 0x1ffb5000-0x1ffdbfff] [ 0.000000] kexec: crashkernel=auto resulted in zero bytes of reserved memory. [ 0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00 [ 0.000000] kvm-clock: cpu 0, msr 0:1ff65001, primary cpu clock [ 0.000000] kvm-clock: using sched offset of 844562806 cycles [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x00001000-0x00ffffff] [ 0.000000] DMA32 [mem 0x01000000-0xffffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00001000-0x0009efff] [ 0.000000] node 0: [mem 0x00100000-0x1ffdbfff] [ 0.000000] On node 0 totalpages: 130938 [ 0.000000] DMA zone: 64 pages used for memmap [ 0.000000] DMA zone: 21 pages reserved [ 0.000000] DMA zone: 3998 pages, LIFO batch:0 [ 0.000000] DMA32 zone: 1984 pages used for memmap [ 0.000000] DMA32 zone: 126940 pages, LIFO batch:31 [ 0.000000] ACPI: PM-Timer IO Port: 0x608 [ 0.000000] ACPI: Local APIC address 0xfee00000 [ 0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1]) [ 0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) [ 0.000000] ACPI: IRQ0 used by override. [ 0.000000] ACPI: IRQ5 used by override. [ 0.000000] ACPI: IRQ9 used by override. [ 0.000000] ACPI: IRQ10 used by override. [ 0.000000] ACPI: IRQ11 used by override. [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000 [ 0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs [ 0.000000] PM: Registered nosave memory: [mem 0x0009f000-0x0009ffff] [ 0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000effff] [ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-514.10.2.el7.x86_64 root=/dev/mapper/centos_lvm-root ro rd.lvm.lv=centos_lvm/root vconsole.font=latarcyrheb-sun16 crashkernel=auto vconsole.keymap=uk rhgb quiet LANG=en_GB.UTF-8 [ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes) [ 0.000000] Memory: 468428k/524144k available (6765k kernel code, 392k absent, 55324k reserved, 4432k data, 1680k init) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ [ 0.043557] tlb_flushall_shift: 6 [ 0.057030] Freeing SMP alternatives: 28k freed [ 0.061383] ACPI: Core revision 20130517 [ 0.062155] ACPI: All ACPI Tables successfully acquired [ 0.062192] ftrace: allocating 25810 entries in 101 pages [ 0.095846] smpboot: APIC(0) Converting physical 0 to logical package 0 [ 0.095848] smpboot: Max logical packages: 1 [ 0.096043] Enabling x2apic [ 0.096050] Enabled x2apic [ 0.096278] Switched APIC routing to physical x2apic. [ 0.097328] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1 [ 0.208359] ACPI: (supports S0 S3 S4 S5) [ 0.208360] ACPI: Using IOAPIC for interrupt routing [ 0.208371] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug [ 0.210590] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff]) [ 0.210594] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI] [ 0.210599] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM [ 0.211133] acpiphp: Slot [18] registered [ 0.211152] acpiphp: Slot [19] registered [ 0.211170] acpiphp: Slot [20] registered [ 0.211188] acpiphp: Slot [21] registered [ 0.211207] acpiphp: Slot [22] registered [ 0.211226] acpiphp: Slot [23] registered [ 0.211244] acpiphp: Slot [24] registered [ 0.211262] acpiphp: Slot [25] registered [ 0.211279] acpiphp: Slot [26] registered [ 0.211297] acpiphp: Slot [27] registered [ 0.211319] acpiphp: Slot [28] registered [ 0.211339] acpiphp: Slot [29] registered [ 0.211358] acpiphp: Slot [30] registered [ 0.211376] acpiphp: Slot [31] registered [ 0.211390] PCI host bridge to bus 0000:00 [ 0.211393] pci_bus 0000:00: root bus resource [bus 00-ff] [ 0.211395] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window] [ 0.211397] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window] [ 0.211399] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window] [ 0.211401] pci_bus 0000:00: root bus resource [mem 0x20000000-0xfebfffff window] [ 0.211440] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 [ 0.211812] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100 [ 0.212388] pci 0000:00:01.1: [8086:7010] type 00 class 0x010180 [ 0.217806] pci 0000:00:01.1: reg 0x20: [io 0xc0a0-0xc0af] [ 0.219435] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7] [ 0.219437] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6] [ 0.219439] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177] [ 0.219440] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376] [ 0.219580] pci 0000:00:01.2: [8086:7020] type 00 class 0x0c0300 [ 0.225402] pci 0000:00:01.2: reg 0x20: [io 0xc080-0xc09f] [ 0.228999] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000 [ 0.229426] pci 0000:00:01.3: quirk: [io 0x0600-0x063f] claimed by PIIX4 ACPI [ 0.229438] pci 0000:00:01.3: quirk: [io 0x0700-0x070f] claimed by PIIX4 SMB [ 0.229661] pci 0000:00:02.0: [1234:1111] type 00 class 0x030000 [ 0.231567] pci 0000:00:02.0: reg 0x10: [mem 0xfd000000-0xfdffffff pref] [ 0.235236] pci 0000:00:02.0: reg 0x18: [mem 0xfebf0000-0xfebf0fff] [ 0.244134] pci 0000:00:02.0: reg 0x30: [mem 0xfebe0000-0xfebeffff pref] [ 0.244327] pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 [ 0.245942] pci 0000:00:03.0: reg 0x10: [mem 0xfebc0000-0xfebdffff] [ 0.247652] pci 0000:00:03.0: reg 0x14: [io 0xc000-0xc03f] [ 0.257325] pci 0000:00:03.0: reg 0x30: [mem 0xfeb80000-0xfebbffff pref] [ 0.257567] pci 0000:00:04.0: [1af4:1004] type 00 class 0x010000 [ 0.260061] pci 0000:00:04.0: reg 0x10: [io 0xc040-0xc07f] [ 0.262594] pci 0000:00:04.0: reg 0x14: [mem 0xfebf1000-0xfebf1fff] [ 0.270888] pci 0000:00:04.0: reg 0x20: [mem 0xfe000000-0xfe7fffff 64bit pref] [ 0.274389] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11) [ 0.274504] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11) [ 0.274599] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11) [ 0.274691] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11) [ 0.274742] ACPI: PCI Interrupt Link [LNKS] (IRQs *9) [ 0.274901] ACPI: Enabled 3 GPEs in block 00 to 0F [ 0.275038] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none [ 0.275040] vgaarb: loaded [ 0.275041] vgaarb: bridge control possible 0000:00:02.0 [ 0.275124] SCSI subsystem initialized [ 0.275151] ACPI: bus type USB registered [ 0.275167] usbcore: registered new interface driver usbfs [ 0.275175] usbcore: registered new interface driver hub [ 0.275188] usbcore: registered new device driver usb [ 0.275268] PCI: Using ACPI for IRQ routing [ 0.275269] PCI: pci_cache_line_size set to 64 bytes [ 0.275419] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff] [ 0.275422] e820: reserve RAM buffer [mem 0x1ffdc000-0x1fffffff] [ 0.275525] NetLabel: Initializing [ 0.275526] NetLabel: domain hash size = 128 [ 0.275527] NetLabel: protocols = UNLABELED CIPSOv4 [ 0.275547] NetLabel: unlabeled traffic allowed by default [ 0.276554] HPET: 3 timers in total, 0 timers will be used for per-cpu timer [ 0.276573] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 [ 0.276577] hpet0: 3 comparators, 64-bit 100.000000 MHz counter [ 0.280762] Switched to clocksource kvm-clock [ 0.285990] pnp: PnP ACPI init [ 0.286000] ACPI: bus type PNP registered [ 0.286066] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active) [ 0.286116] pnp 00:01: Plug and Play ACPI device, IDs PNP0303 (active) [ 0.286156] pnp 00:02: Plug and Play ACPI device, IDs PNP0f13 (active) [ 0.286180] pnp 00:03: [dma 2] [ 0.286191] pnp 00:03: Plug and Play ACPI device, IDs PNP0700 (active) [ 0.286268] pnp 00:04: Plug and Play ACPI device, IDs PNP0400 (active) [ 0.286330] pnp 00:05: Plug and Play ACPI device, IDs PNP0501 (active) [ 0.286536] pnp: PnP ACPI: found 6 devices [ 0.286537] ACPI: bus type PNP unregistered [ 0.292279] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window] [ 0.292281] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window] [ 0.292283] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window] [ 0.292285] pci_bus 0000:00: resource 7 [mem 0x20000000-0xfebfffff window] [ 0.292312] NET: Registered protocol family 2 [ 0.292470] TCP established hash table entries: 4096 (order: 3, 32768 bytes) [ 0.292481] TCP bind hash table entries: 4096 (order: 4, 65536 bytes) [ 0.292489] TCP: Hash tables configured (established 4096 bind 4096) [ 0.292500] TCP: reno registered [ 0.292503] UDP hash table entries: 256 (order: 1, 8192 bytes) [ 0.292510] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) [ 0.292546] NET: Registered protocol family 1 [ 0.292558] pci 0000:00:00.0: Limiting direct PCI/PCI transfers [ 0.292578] pci 0000:00:01.0: PIIX3: Enabling Passive Release [ 0.292599] pci 0000:00:01.0: Activating ISA DMA hang workarounds [ 0.316664] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11 [ 0.341069] pci 0000:00:02.0: Boot video device [ 0.341101] PCI: CLS 0 bytes, default 64 [ 0.341142] Unpacking initramfs... [ 0.815014] Freeing initrd memory: 30184k freed [ 0.824177] sha1_ssse3: Neither AVX nor AVX2 nor SSSE3/SHA-NI is available/usable. [ 0.824183] sha256_ssse3: Neither AVX nor SSSE3/SHA-NI is available/usable. [ 0.824346] futex hash table entries: 256 (order: 2, 16384 bytes) [ 0.824359] Initialise system trusted keyring [ 0.824385] audit: initializing netlink socket (disabled) [ 0.824407] type=2000 audit(1625242005.725:1): initialized [ 0.849466] HugeTLB registered 2 MB page size, pre-allocated 0 pages [ 0.850441] zpool: loaded [ 0.850445] zbud: loaded [ 0.850652] VFS: Disk quotas dquot_6.5.2 [ 0.850681] Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.850837] msgmni has been set to 973 [ 0.850885] Key type big_key registered [ 0.850888] SELinux: Registering netfilter hooks [ 0.851407] NET: Registered protocol family 38 [ 0.851415] Key type asymmetric registered [ 0.851418] Asymmetric key parser 'x509' registered [ 0.851445] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251) [ 0.851470] io scheduler noop registered [ 0.851473] io scheduler deadline registered (default) [ 0.851493] io scheduler cfq registered [ 0.851594] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 [ 0.851600] pciehp: PCI Express Hot Plug Controller Driver version: 0.4 [ 0.851670] intel_idle: does not run on family 6 model 6 [ 0.851730] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0 [ 0.851734] ACPI: Power Button [PWRF] [ 0.851875] GHES: HEST is not enabled! [ 0.851957] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.901733] uhci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 1 [ 0.901758] uhci_hcd 0000:00:01.2: detected 2 ports [ 0.901871] uhci_hcd 0000:00:01.2: irq 11, io base 0x0000c080 [ 0.901975] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 [ 0.901977] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.901979] usb usb1: Product: UHCI Host Controller [ 0.901981] usb usb1: Manufacturer: Linux 3.10.0-514.10.2.el7.x86_64 uhci_hcd [ 0.901982] usb usb1: SerialNumber: 0000:00:01.2 [ 0.902067] hub 1-0:1.0: USB hub found [ 0.902074] hub 1-0:1.0: 2 ports detected [ 0.902209] usbcore: registered new interface driver usbserial [ 0.902215] usbcore: registered new interface driver usbserial_generic [ 0.902221] usbserial: USB Serial support registered for generic [ 0.902251] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12 [ 0.903032] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 0.903038] serio: i8042 AUX port at 0x60,0x64 irq 12 [ 0.903108] mousedev: PS/2 mouse device common for all mice [ 0.903389] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1 [ 0.904055] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input2 [ 0.904299] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3 [ 0.904445] rtc_cmos 00:00: RTC can wake from S4 [ 0.904741] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0 [ 0.904926] rtc_cmos 00:00: alarms up to one day, y3k, 114 bytes nvram, hpet irqs [ 0.904978] cpuidle: using governor menu [ 0.905038] hidraw: raw HID events driver (C) Jiri Kosina [ 0.905136] usbcore: registered new interface driver usbhid [ 0.905137] usbhid: USB HID core driver [ 0.905170] drop_monitor: Initializing network drop monitor service [ 0.905241] TCP: cubic registered [ 0.905244] Initializing XFRM netlink socket [ 0.905335] NET: Registered protocol family 10 [ 0.905516] NET: Registered protocol family 17 [ 0.905656] microcode: CPU0 sig=0x663, pf=0x1, revision=0x1 [ 0.905697] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba [ 0.905795] Loading compiled-in X.509 certificates [ 0.905818] Loaded X.509 cert 'CentOS Linux kpatch signing key: ea0413152cde1d98ebdca3fe6f0230904c9ef717' [ 0.905830] Loaded X.509 cert 'CentOS Linux Driver update signing key: 7f421ee0ab69461574bb358861dbe77762a4201b' [ 0.906379] Loaded X.509 cert 'CentOS Linux kernel signing key: 27f20485ebeb3b2d54add61e57b308fae070f41f' [ 0.906400] registered taskstats version 1 [ 0.908469] Key type trusted registered [ 0.910259] Key type encrypted registered [ 0.911972] IMA: No TPM chip found, activating TPM-bypass! [ 0.912342] rtc_cmos 00:00: setting system clock to 2021-07-02 16:06:45 UTC (1625242005) [ 0.913078] Freeing unused kernel memory: 1680k freed [ 0.917150] systemd[1]: systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN) [ 0.917171] systemd[1]: Detected virtualization kvm. [ 0.917175] systemd[1]: Detected architecture x86-64. [ 0.917178] systemd[1]: Running in initial RAM disk. [ 0.917206] systemd[1]: Set hostname to . [ 0.948554] systemd[1]: Created slice Root Slice. [ 0.948566] systemd[1]: Starting Root Slice. [ 0.948578] systemd[1]: Reached target Timers. [ 0.948585] systemd[1]: Starting Timers. [ 0.948596] systemd[1]: Reached target Local File Systems. [ 0.948603] systemd[1]: Starting Local File Systems. [ 0.948674] systemd[1]: Created slice System Slice. [ 0.948684] systemd[1]: Starting System Slice. [ 3.144348] sr 0:0:2:0: [sr0] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.144350] sr 0:0:2:0: [sr0] Sense Key : Illegal Request [current] [ 3.144355] sr 0:0:2:0: [sr0] Add. Sense: Logical block address out of range [ 3.144357] sr 0:0:2:0: [sr0] CDB: Read(10) 28 00 00 00 00 01 00 00 01 00 [ 3.144359] blk_update_request: critical target error, dev sr0, sector 4 [ 3.144396] Buffer I/O error on dev sr0, logical block 1, async page read [ 3.174913] sr 0:0:2:0: [sr0] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.174917] sr 0:0:2:0: [sr0] Sense Key : Aborted Command [current] [ 3.174919] sr 0:0:2:0: [sr0] Add. Sense: I/O process terminated [ 3.174921] sr 0:0:2:0: [sr0] CDB: Read(10) 28 00 00 00 00 00 00 00 01 00 [ 3.174923] blk_update_request: I/O error, dev sr0, sector 0 [ 3.174952] Buffer I/O error on dev sr0, logical block 0, async page read [ 3.184379] Adding 2103484k swap on /dev/sdb1. Priority:-1 extents:1 across:2103484k FS [ 3.259254] XFS (sda1): Mounting V4 Filesystem [ 3.304213] XFS (sda1): Starting recovery (logdev: internal) [ 3.306266] XFS (sda1): Ending recovery (logdev: internal) [ 3.411539] type=1305 audit(1625242007.998:4): audit_pid=571 old=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1 [ngelinux01 log]#
3. Check messages file now
[root@host-1-129]# ls -ltr /var/log/messages -rw-------. 1 root root 2918099 Jul 5 13:32 messages [root@host-1-129 log]# [root@host-1-129 log]# tail messages Jul 5 13:32:33 host-1-129 systemd: Created slice user-0.slice. Jul 5 13:32:33 host-1-129 systemd: Starting user-0.slice. Jul 5 13:32:33 host-1-129 systemd: Started Session 1 of user root. Jul 5 13:32:33 host-1-129 systemd-logind: New session 1 of user root. Jul 5 13:32:33 host-1-129 systemd: Starting Session 1 of user root. Jul 5 13:32:33 host-1-129 dbus[601]: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jul 5 13:32:33 host-1-129 dbus-daemon: dbus[601]: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jul 5 13:32:33 host-1-129 dbus[601]: [system] Successfully activated service 'org.freedesktop.problems' Jul 5 13:32:33 host-1-129 dbus-daemon: dbus[601]: [system] Successfully activated service 'org.freedesktop.problems' Jul 5 13:32:51 host-1-129 fprintd: ** Message: No devices in use, exit [root@host-1-129 log]#
As we can observe the filesize of messages file is much more than of a dmesg file and does not act as buffer to store data like dmesg.
Hence dmesg file only contains few logs of current boot, and is usually not much helpful except sometimes when messages file is not written properly.
However the most useful file is /var/log/messages and other system log files that retains the old logs and after system boot logs as well.