你可能猜到了,我还是 Linux 新手,10 天前我使用 Ubuntu 16.04 开始了我的 Linux 之旅,并升级到 Ubuntu 17.10。我很紧张,因为我担心有一天我打开电脑时会发现黑屏盯着我,阻挡我访问文件和互联网。所以,我尽可能多地学习知识,以防万一。今天我偶然发现了一个叫做“系统日志”的东西,当我打开它时,我发现了很多消息(看起来像错误),其中一些被列为重要消息。我的问题是:有没有办法用它来检测和解决任何问题?谢谢。
附言:我知道我的 wifi 连接有问题,就像溜溜球一样,一会儿上,一会儿下。至少我知道有这个问题。
这是我从“dmesg”命令获得的信息:
[15990.659912] iwlwifi 0000:02:00.0: Microcode SW error detected. Restarting 0x2000000.
[15990.660059] iwlwifi 0000:02:00.0: Start IWL Error Log Dump:
[15990.660064] iwlwifi 0000:02:00.0: Status: 0x00000200, count: 6
[15990.660067] iwlwifi 0000:02:00.0: Loaded firmware version: 29.541020.0
[15990.660072] iwlwifi 0000:02:00.0: 0x000019C2 | ADVANCED_SYSASSERT
[15990.660075] iwlwifi 0000:02:00.0: 0x000002A0 | trm_hw_status0
[15990.660078] iwlwifi 0000:02:00.0: 0x00000000 | trm_hw_status1
[15990.660081] iwlwifi 0000:02:00.0: 0x00043D58 | branchlink2
[15990.660084] iwlwifi 0000:02:00.0: 0x0004B016 | interruptlink1
[15990.660087] iwlwifi 0000:02:00.0: 0x00000000 | interruptlink2
[15990.660091] iwlwifi 0000:02:00.0: 0xDEADBEEF | data1
[15990.660093] iwlwifi 0000:02:00.0: 0xDEADBEEF | data2
[15990.660096] iwlwifi 0000:02:00.0: 0xDEADBEEF | data3
[15990.660100] iwlwifi 0000:02:00.0: 0x488000F3 | beacon time
[15990.660102] iwlwifi 0000:02:00.0: 0x1703DD11 | tsf low
[15990.660105] iwlwifi 0000:02:00.0: 0x00000005 | tsf hi
[15990.660108] iwlwifi 0000:02:00.0: 0x00000000 | time gp1
[15990.660112] iwlwifi 0000:02:00.0: 0x0259E583 | time gp2
[15990.660115] iwlwifi 0000:02:00.0: 0x00000001 | uCode revision type
[15990.660118] iwlwifi 0000:02:00.0: 0x0000001D | uCode version major
[15990.660121] iwlwifi 0000:02:00.0: 0x0008415C | uCode version minor
[15990.660124] iwlwifi 0000:02:00.0: 0x00000210 | hw version
[15990.660127] iwlwifi 0000:02:00.0: 0x00C89200 | board version
[15990.660130] iwlwifi 0000:02:00.0: 0x0000001C | hcmd
[15990.660133] iwlwifi 0000:02:00.0: 0x24022000 | isr0
[15990.660136] iwlwifi 0000:02:00.0: 0x00881800 | isr1
[15990.660139] iwlwifi 0000:02:00.0: 0x0000000A | isr2
[15990.660142] iwlwifi 0000:02:00.0: 0x40415CC0 | isr3
[15990.660144] iwlwifi 0000:02:00.0: 0x00000000 | isr4
[15990.660148] iwlwifi 0000:02:00.0: 0x0A9E001C | last cmd Id
[15990.660151] iwlwifi 0000:02:00.0: 0x00000000 | wait_event
[15990.660154] iwlwifi 0000:02:00.0: 0x000000D4 | l2p_control
[15990.660157] iwlwifi 0000:02:00.0: 0x00018020 | l2p_duration
[15990.660160] iwlwifi 0000:02:00.0: 0x00000007 | l2p_mhvalid
[15990.660163] iwlwifi 0000:02:00.0: 0x00000081 | l2p_addr_match
[15990.660166] iwlwifi 0000:02:00.0: 0x00000005 | lmpm_pmg_sel
[15990.660169] iwlwifi 0000:02:00.0: 0x15061956 | timestamp
[15990.660172] iwlwifi 0000:02:00.0: 0x00006878 | flow_handler
[15990.660178] ieee80211 phy1: Hardware restart was requested
答案1
你好,欢迎来到 Linux 世界!
是的,这就是系统日志的用途;
- 记录正常行为
- 问题警告
- 输出软件/硬件错误(如果发生)。
启动日志正常输出的示例:
[ 15.176458] e1000: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX [ 15.176779] ADDRCONF(NETDEV_UP): eth1: link is not ready [ 15.177032] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
一个例子(取自https://serverfault.com/questions/407007/what-do-these-disk-errors-in-syslog-mean)关于磁盘上的坏扇区:
sd 0:0:0:0:[sda] Add. Sense:未恢复的读取错误 - 自动重新分配失败
这两个例子都来自消息,
$ dmesg
根据 bugs.launchpad.net/ubuntu/+source/linux/+bug/1710390 中所述,针对您的问题建议的解决方案是执行以下操作,
在终端中,打开 NetworkManager.conf
$ nano /etc/NetworkManager/NetworkManager.conf <-- nano is a text-editor for novices.
添加以下内容,
[device] wifi.scan-rand-mac-address=no.
保存文件,然后重新启动网络管理器,
$ sudo service network-manager restart