在 Debian 系统中,messages / 日志排查故障通常围绕 系统日志、服务状态、内核信息、硬件与网络 来进行。下面给你一套实用排查思路(从入门到进阶)。
/var/log/messages
/var/log/syslog
/var/log/kern.log
查看方式:
tail -n 100 /var/log/syslog
less /var/log/messages
journalctl
常用命令:
journalctl -xe # 最近错误,带解释
journalctl -p err # 只看错误
journalctl -b # 本次启动
journalctl -b -1 # 上一次启动
journalctl -u nginx # 某个服务
journalctl -b -1 # 上一次启动日志
dmesg | less # 内核启动信息
重点看:
kernel panicfailed to mountsystemd[1]: Failedsystemctl status ssh
journalctl -u ssh -xe
常见错误:
permission deniedaddress already in usefailed at step EXECip addr
ip route
journalctl -u networking
dmesg | grep eth
看:
dmesg | grep -i error
journalctl | grep -i "I/O error"
df -h
关键词:
I/O errorread-only file systemEXT4-fs errordmesg | grep -i "out of memory"
journalctl | grep -i oom
free -h
# 看最近所有错误
journalctl -p err -b
# 实时看日志
journalctl -f
# 看某时间点
journalctl --since "2026-01-21 10:00" --until "11:00"
你可以把关键报错贴出来,例如:
systemd[1]: Failed to start A high performance web server.
我可以帮你:
systemctl status 服务journalctl -xedmesg/var/log 相关日志如果你现在正好有某个具体故障(比如 SSH 连不上、网卡没了、服务起不来),直接把报错发我,我可以一步步带你查。