[排错] Linux 解决日志里报错 “kernel: [829455.595333][ C10] critical target error, dev sda, sector 104056241 op 0x3:(DISCARD) ……”

报错代码:

kernel: [829455.595333][ C10] critical target error, dev sda, sector 104056241 op 0x3:(DISCARD) ......

分析:

如果是在 VMware 上运行的虚拟机在日志里出现 critical target error 此类报错,尤其是涉及到 DISCARD 操作的错误,通常是由 VMware 进行硬盘垃圾空间回收或者进行硬盘优化造成的。

解决方法:

VMware 的控制平台上,检查宿主机的硬盘是否正常。若不正常则修复或者更换硬盘。

Several situations of Linux automatically reboot without reboot logs in the /var/log/messages

Situation One

This Linux server is a virtual server. If we reboot it though its virtual software, there is no relevant logs in the /var/log/messages.

Situation Two

This Linux server is a member of a pacemaker cluster. If the pacemaker cluster software fences this server for protecting the whole cluster, there is no relate logs in the /var/log/messages.

Situation Three

This Linux server has critical problems in its system or hardware. Core panic of Linux and hardware problem both can reboot the system automatically without any reboot logs in the /var/log/messages.

[内容] Linux 是 BIOS 启动模式还是 UEFI 启动模式的判断

内容一:Linux 判断是 BIOS 启动模式还是 UEFI 启动模式的原理

系统的的启动模式分为 BIOS 启动模式和 UEFI 启动模式两种 (截止到本文发表时)。如果 Linux 是使用的 UEFI 启动模式,则系统里会有 /sys/firmware/efi 文件,若没有此文件的话则代表系统的启动模式为 BIOS。

内容二:Linux 判断是 BIOS 启动模式还是 UEFI 启动模式的方法

# [ -d /sys/firmware/efi ] && echo 'The boot is UEFI' || echo 'The boot is BIOS'

补充:BIOS 启动模式和 UEFI 启动模式的特点

UEFI (Unified Extensible Firmware Interface) 是一种比 BIOS (Basic Input/Outpu System) 更新的启动方式,相比而言主要的区别是 UEFI (Unified Extensible Firmware Interface) 支持 Secure Boot。开启 Secure Boot 的系统在启动的时候更安全,但是某些杀毒软件会让开启 Secure Boot 的系统卡住。