Ubuntu 是否记录启动期间发生的事件?

Ubuntu 是否记录启动期间发生的事件?

在 ubuntu(或者一般的 linux)日志中是否有任何地方可以记录计算机启动和操作系统加载失败(由于启动阶段遇到的问题)?

答案1

你可以检查一下

/var/日志

该目录包含所有类型的日志

/var/log/auth.log

Record of all logins and logouts by normal users and system processes.

/var/日志/btmp

Log of all attempted bad logins to the system. Accessed via the lastb command.

/var/log/调试

Debugging output from various packages.

/var/log/dmesg

Kernel ring buffer. The content of this file is referred to by the dmesg command.

/var/log/gdm/

GDM log files. Normally a subset of the last X log file. See /var/log/xdm.log for mode details.

/var/log/kdm.log

KDM log file. Normally a subset of the last X log file. See /var/log/xdm.log for more details.

/var/log/消息

System logs.

/var/log/pacct

Process accounting is the bookkeeping of process activity. The raw data of process activity is maintained here. Three commands can be used to access the contents of this file dump-acct, sa (summary of process accounting) and lastcomm (list the commands executed on the system).

/var/日志/utmp

Active user sessions. This is a data file and as such it can not be viewed normally. A human-readable form can be created via the dump-utmp command or through the w, who or users commands.

/var/log/wtmp

Log of all users who have logged into and out of the system. The last command can be used to access a human readable form of this file. It also lists every connection and run-level change.

/var/log/xdm.log

XDM log file. Normally subset of the last X startup log and pretty much useless in light of the details the X logs is able to provide us with. Only consult this file if you have XDM specific issues otherwise just use the X logfile.

/var/log/XFree86.0.log,/var/log/XFree86.?.log

X startup logfile. An excellent resource for uncovering problems with X configuration. Log files are numbered according to when they were last used. For example, the last log file would be stored in /var/log/XFree86.0.log, the next /var/log/XFree86.9.log, so on and so forth.

/var/log/syslog

The 'system' log file. The contents of this file is managed via the syslogd daemon which more often than not takes care of all log manipulation on most systems.

答案2

虽然我发现 Shekhar Raut 的答案是正确的,但我认为这个列表可以短一些。

由于 OP 只询问启动问题,其他什么都没有问,Linux 中的内核日志(一般来说)可以在以下位置找到:

/var/log/messages

因此,如果由于某些硬件问题导致启动失败,则应该首先查看此处。

更新:

看起来 Ubuntu 从 12.04 版开始删除了这个日志文件(未经确认),现在查找系统日志的正确位置是:

/var/log/syslog

答案3

从 Ubuntu 12.04(据我所知)开始,就有了/var/log/boot.log,它记录早期启动的输出。

答案4

/var/log/kern.log 

包含内核在启动期间生成的日志。启动后几乎没有添加任何事件,但您将在每个条目上看到正常运行时间

相关内容