每天大约都在9:38分左右死机,系统启动10几分钟以后死机。
1. Ubuntu 提供 journalctl 指令 是很好用的查詢記錄工具
1-1.
https://packages.ubuntu.com/artful/amd6 ... d/filelist
/bin/
journalctl
1-2.
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
2.
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
--flush
2-1. journalctl 預設只能查詢當次開機後的記錄
如果要查詢以前的記錄 需要更改設定 啟用 persistent storage
2-2. 方法 參見
https://gist.github.com/JPvRiel/b7c1858 ... 5b40836887
Create storage and enable storage location
代码: 全选
sudo mkdir -p /var/log/journal
sudo systemd-tmpfiles --create --prefix /var/log/journal
sudo systemctl restart systemd-journald
3. 當死機後 重新開機 使用 journalctl 指令 加上 -b 參數 可以查詢任意一次開機的紀錄
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
-b [ID][±offset], --boot=[ID][±offset]
Show messages from a specific boot
例如 加上
--boot=-1
可以查詢 前一次(剛剛死機那一次)的記錄
4.
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
-r, --reverse
加上 -r 參數 可以把時間順序記錄反向排列 即最後的排在第一行 方便你閱讀
5.
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
-n, --lines=
例如
--lines=20
可以只印出 20 行記錄
6. 其它參數 請參閱
http://manpages.ubuntu.com/manpages/art ... ctl.1.html
journalctl - Query the systemd journal
OPTIONS
7. 你應該已經有相當的基礎 上述介紹 你應該就可以自己動手試試 查詢 err fail 等等 關鍵字 看看
引起死機的第一個關鍵原因
7-1. 也歡迎你把你認為可能有助於研判的關鍵行數內容 複製/貼上上來 :
打開 firefox
把
http://paste.ubuntu.com
輸入 firefox 網址欄
按一下 Enter
會出現 空白的 content 框
把 你要貼上本論壇的 全部內容 通通 複製/貼進 content 框裏
按下 paste
會回應
http://paste.ubuntu.com/xxxxxxx # xxxxxxx 是一組數字
把
http://paste.ubuntu.com/xxxxxxx 貼上來