Ubuntu 17.04 升级后出现 EXT4-fs 错误

Ben*_*n B 24 filesystem ext4 17.04

我有一个戴尔 XPS 15 9550。我已经在它上面运行 Ubuntu 16.10 四个月了,没有发生任何戏剧性的变化。

两天前,我升级到Ubuntu 17.04。升级后大约一个小时,我的硬盘驱动器重新安装为只读模式。当我跳到 tty 屏幕时,出现了:

[ 746.341551] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #525023: comm NetworkManager: reading directory iblock 0
[ 746.343318] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #524289: comm pool: reading directory iblock 0
[ 746.356125] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #11272213: comm systemd-udevd: reading directory iblock 0
[ 746.356139] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #11272210: comm systemd-udevd: reading directory iblock 0
[ 746.356332] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #11272193: comm systemd-udevd: reading directory iblock 0
[ 746.356338] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #11272825: comm systemd-udevd: reading directory iblock 0
[ 746.356400] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #11272210: comm systemd-udevd: reading directory iblock 0
[ 746.474632] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #524539: comm unity-settings-: reading directory iblock 0
[ 746.992814] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #5506108: comm BrowserBlocking: reading directory iblock 0
[ 746.304451] EXT4-fs error (device nvme0n1p7): ext4_find_entry:1463: inode #5506117: comm BrowserBlocking: reading directory iblock 0
Run Code Online (Sandbox Code Playgroud)

这是fdisk -l显示的内容:

Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3CD27380-DAC8-48DC-910A-D084CE857DA3

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048    1026047   1024000   500M EFI System
/dev/nvme0n1p2   1026048    1288191    262144   128M Microsoft reserved
/dev/nvme0n1p3   1288192  487948287 486660096 232.1G Microsoft basic data
/dev/nvme0n1p4 972302336  973223935    921600   450M Windows recovery environmen
/dev/nvme0n1p5 973223936  998094847  24870912  11.9G Windows recovery environmen
/dev/nvme0n1p6 998094848 1000204287   2109440     1G Windows recovery environmen
/dev/nvme0n1p7 487948288  939046911 451098624 215.1G Linux filesystem
/dev/nvme0n1p8 939046912  972302335  33255424  15.9G Linux swap

Partition table entries are not in disk order.
Run Code Online (Sandbox Code Playgroud)

我重新启动,并继续每小时出现一次错误。所以我从头重新安装了Ubuntu 17.04 。但是我仍然遇到同样的问题。

我尝试通过创建 /forcefsck 文件来运行 fsck(我创建了一个包装器 shell 脚本,该脚本添加了-v标志并将 stdout 输出到文件)。结果如下:

fsck.fat 4.0 (2016-05-06)                               
Checking we can access the last sector of the filesystem
Boot sector contents:                                   
System ID "MSDOS5.0"                                    
Media byte 0xf8 (hard disk)                             
       512 bytes per logical sector                     
      4096 bytes per cluster                            
      6206 reserved sectors                             
First FAT starts at byte 3177472 (sector 6206)          
         2 FATs, 32 bit entries                         
    508416 bytes per FAT (= 993 sectors)                
Root directory start at cluster 2 (arbitrary size)      
Data area starts at byte 4194304 (sector 8192)          
    126976 data clusters (520093696 bytes)              
63 sectors/track, 255 heads                             
      2048 hidden sectors                               
   1024000 sectors total                                
Reclaiming unconnected clusters.                        
Checking free cluster summary.                          
/dev/nvme0n1p1: 212 files, 15526/126976 clusters    
Run Code Online (Sandbox Code Playgroud)

我尝试从实时 USB 启动并e2fsck -p /dev/nvme0n1p7按照此处的建议运行(https://askubuntu.com/a/768813/679041)。它没有给出任何错误。

我也尝试运行,smartctl -t long /dev/nvme0n1p7但结果似乎表明该工具不适用于我的特定 SSD:

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.10.0-19-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       PM951 NVMe SAMSUNG 512GB
Serial Number:                      S29PNX0H611013
Firmware Version:                   BXV77D0Q
PCI Vendor/Subsystem ID:            0x144d
IEEE OUI Identifier:                0x002538
Controller ID:                      1
Number of Namespaces:               1
Namespace 1 Size/Capacity:          512,110,190,592 [512 GB]
Namespace 1 Utilization:            254,982,533,120 [254 GB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Mon Apr 17 17:45:48 2017 AEST
Firmware Updates (0x06):            3 Slots
Optional Admin Commands (0x0017):   Security Format Frmw_DL *Other*
Optional NVM Commands (0x001f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Maximum Data Transfer Size:         32 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     6.00W       -        -    0  0  0  0        5       5
 1 +     4.20W       -        -    1  1  1  1       30      30
 2 +     3.10W       -        -    2  2  2  2      100     100
 3 -   0.0700W       -        -    3  3  3  3      500    5000
 4 -   0.0050W       -        -    4  4  4  4     2000   22000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
Read NVMe SMART/Health Information failed: NVMe Status 0x2002
Run Code Online (Sandbox Code Playgroud)

知道为什么会发生这个问题以及我如何解决它吗?谢谢!:)

Ben*_*n B 28

正如Elder Geek评论中指出的那样,这是由于已知错误

从错误报告:

APST 支持刚刚登陆最新的 Zesty 内核 (4.10.0-14.16),作为https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1664602 的一部分。该补丁对于戴尔笔记本电脑中的某些 256GB 三星驱动器有一个怪癖,这些驱动器在启用 APST 时表现不佳。除了 512GB 三星之外,我在使用相同型号的笔记本电脑时遇到了相同的症状。在手动禁用 APST 之前,驱动器会死机,系统会在启动后的 20 到 40 分钟内因 I/O 错误而崩溃。

在实施适当的修复之前,建议使用一种解决方法,其中包括添加内核参数

请尝试nvme_core.default_ps_max_latency_us=5500,如果问题仍然存在,请尝试 nvme_core.default_ps_max_latency_us=200

要添加内核引导参数,请编辑 GRUB 的配置文件:

sudo nano /etc/default/grub
Run Code Online (Sandbox Code Playgroud)

找到开头的行GRUB_CMDLINE_LINUX_DEFAULT并将引导参数添加到引号之间的其他行中。例如,在这种情况下,您可能会得到

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvme_core.default_ps_max_latency_us=5500"
Run Code Online (Sandbox Code Playgroud)

保存文件并退出,然后使更改生效,运行

sudo update-grub 
Run Code Online (Sandbox Code Playgroud)