![笔记本电脑崩溃了:为什么?](https://linux22.com/image/1111622/%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%94%B5%E8%84%91%E5%B4%A9%E6%BA%83%E4%BA%86%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我的 Linux(ubuntu 12.04)笔记本电脑崩溃了,我正在试图找出原因。
# last
sds pts/4 :0 Tue Sep 4 10:01 still logged in
sds pts/3 :0 Tue Sep 4 10:00 still logged in
reboot system boot 3.2.0-29-generic Tue Sep 4 09:43 - 11:23 (01:40)
sds pts/8 :0 Mon Sep 3 14:23 - crash (19:19)
这似乎表明崩溃发生在 09:42 (= 14:23+19:19)。根据另一个问题, 我在看/var/日志:
认证日志:
Sep 4 09:17:02 t520sds CRON[32744]: pam_unix(cron:session): session closed for user root
Sep 4 09:43:17 t520sds lightdm: pam_unix(lightdm:session): session opened for user lightdm by (uid=0)
不消息文件
系统日志:
Sep 4 09:24:19 t520sds kernel: [219104.819975] CPU0: Package power limit normal
Sep 4 09:43:16 t520sds kernel: imklog 5.8.6, log source = /proc/kmsg started.
内核日志:
Sep 4 09:24:19 t520sds kernel: [219104.819969] CPU1: Package power limit normal
Sep 4 09:24:19 t520sds kernel: [219104.819971] CPU2: Package power limit normal
Sep 4 09:24:19 t520sds kernel: [219104.819974] CPU3: Package power limit normal
Sep 4 09:24:19 t520sds kernel: [219104.819975] CPU0: Package power limit normal
Sep 4 09:43:16 t520sds kernel: imklog 5.8.6, log source = /proc/kmsg started.
Sep 4 09:43:16 t520sds kernel: [ 0.000000] Initializing cgroup subsys cpuset
Sep 4 09:43:16 t520sds kernel: [ 0.000000] Initializing cgroup subsys cpu
我有一个计算一直运行到 9:24,但是 18 分钟后系统就崩溃了!
内核日志有许多页面这些:
Sep 4 09:43:16 t520sds kernel: [ 0.000000] total RAM covered: 8086M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 64K num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 128K num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 256K num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 512K num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 1M num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 2M num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 4M num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 8M num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 16M num_reg: 10 lose cover RAM: 38M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] *BAD*gran_size: 64K chunk_size: 32M num_reg: 10 lose cover RAM: -16M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] *BAD*gran_size: 64K chunk_size: 64M num_reg: 10 lose cover RAM: -16M
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 128M num_reg: 10 lose cover RAM: 0G
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 256M num_reg: 10 lose cover RAM: 0G
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 512M num_reg: 10 lose cover RAM: 0G
Sep 4 09:43:16 t520sds kernel: [ 0.000000] gran_size: 64K chunk_size: 1G num_reg: 10 lose cover RAM: 0G
Sep 4 09:43:16 t520sds kernel: [ 0.000000] *BAD*gran_size: 64K chunk_size: 2G num_reg: 10 lose cover RAM: -1G
这是否意味着我的 RAM 坏了?!
它还说
Sep 4 09:43:16 t520sds kernel: [ 2.944123] EXT4-fs (sda1): INFO: recovery required on readonly filesystem
Sep 4 09:43:16 t520sds kernel: [ 2.944126] EXT4-fs (sda1): write access will be enabled during recovery
Sep 4 09:43:16 t520sds kernel: [ 3.088001] firewire_core: created device fw0: GUID f0def1ff8fbd7dff, S400
Sep 4 09:43:16 t520sds kernel: [ 8.929243] EXT4-fs (sda1): orphan cleanup on readonly fs
Sep 4 09:43:16 t520sds kernel: [ 8.929249] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 658984
...
Sep 4 09:43:16 t520sds kernel: [ 9.343266] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 525343
Sep 4 09:43:16 t520sds kernel: [ 9.343270] EXT4-fs (sda1): 56 orphan inodes deleted
Sep 4 09:43:16 t520sds kernel: [ 9.343271] EXT4-fs (sda1): recovery complete
Sep 4 09:43:16 t520sds kernel: [ 9.645799] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
这是否意味着我的高清质量不好?
按照硬件故障我尝试了smartctl -l selftest
,没有发现任何错误:
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-30-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Seagate Momentus 7200.4
Device Model: ST9500420AS
Serial Number: 5VJE81YK
LU WWN Device Id: 5 000c50 0440defe3
Firmware Version: 0003LVM1
User Capacity: 500,107,862,016 bytes [500 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Mon Sep 10 16:40:04 2012 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 109) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x103b) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 117 099 034 Pre-fail Always - 162843537
3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 571
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 069 060 030 Pre-fail Always - 17210154023
9 Power_On_Hours 0x0032 095 095 000 Old_age Always - 174362787320258
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 571
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 1
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 061 043 045 Old_age Always In_the_past 39 (0 11 44 26)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 84
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 20
193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always - 2434
194 Temperature_Celsius 0x0022 039 057 000 Old_age Always - 39 (0 15 0 0)
195 Hardware_ECC_Recovered 0x001a 041 041 000 Old_age Always - 162843537
196 Reallocated_Event_Count 0x000f 095 095 030 Pre-fail Always - 4540 (61955, 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 4545 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
谷歌搜索这些信息没有结果,我甚至不能确定这些信息是常规消息还是灾难性消息。
那么,我现在该做什么?
答案1
我认为这要么是由 RAM 故障、文件系统故障或 HDD 故障造成的。我会按顺序执行以下操作,然后查看每个操作是否会产生影响,然后再继续执行下一个操作。
1) 正如 Tom Brossman 在他的链接中所建议的,我将运行 RAM 测试 (Memtest86+)。它可从任何安装或 LiveCD 的 GRUB 菜单中找到。尽可能彻底地执行(这应该是相当明显的,并且需要在夜间完成)。
2)从 LiveCD 运行 fsck.ext4(不安装驱动器)
sudo fsck.ext4 -cf /dev/sda1
3)这个帖子这表明*BAD*gran_size
错误可能是由于未启用 MTRR 清理程序而导致的。编辑/boot/grub/grub.cfg
并更改此行:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
更改为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash enable_mtrr_cleanup mtrr_spare_reg_nr=1 mtrr_gran_size=32M mtrr_chunk_size=128M"
保存文件。然后运行
sudo update-grub
然后重新启动。