Ubuntu 每次启动时都要求我执行 fsck

Ubuntu 每次启动时都要求我执行 fsck

我最近安装了 Ubuntu,每次启动时都会看到以下内容:

    /dev/sda2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
fsck exited with status code 4
The root filesystem on /dev/sda2 requires a manual fsck

手动运行后,fsckUbuntu 通常会干净启动,但启动后,我看到系统中的所有文件夹上都有锁定图标,并且没有任何应用程序运行。我还开始看到我的网络浏览器出现问题:Firefox is already running, but is not responding

我不确定这里出了什么问题。我一直手动运行fsck并启动。

结果sudo smartctl -a /dev/sda

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.8.0-36-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Blue
Device Model:     WDC WD5000AAKX-001CA0
Serial Number:    WD-WMAYUA594803
LU WWN Device Id: 5 0014ee 0586a1865
Firmware Version: 15.01H15
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:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Sat May 13 13:39:32 2017 UTC
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
 
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:        ( 8580) 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:    (   2) minutes.
Extended self-test routine
recommended polling time:    (  87) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x3037) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.
 
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       5736
  3 Spin_Up_Time            0x0027   144   143   021    Pre-fail  Always       -       3800
  4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1690
  5 Reallocated_Sector_Ct   0x0033   194   194   140    Pre-fail  Always       -       116
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   086   086   000    Old_age   Always       -       10733
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1665
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       141
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       1548
194 Temperature_Celsius     0x0022   103   094   000    Old_age   Always       -       40
196 Reallocated_Event_Count 0x0032   110   110   000    Old_age   Always       -       90
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       10
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       1
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       188
 
SMART Error Log Version: 1
No Errors Logged
 
SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]
 
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.

由于我正在做fsck /dev/sda2

结果sudo smartctl -a /dev/sda2

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.8.0-36-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
 
=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Blue
Device Model:     WDC WD5000AAKX-001CA0
Serial Number:    WD-WMAYUA594803
LU WWN Device Id: 5 0014ee 0586a1865
Firmware Version: 15.01H15
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:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Sat May 13 13:46:14 2017 UTC
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
 
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:        ( 8580) 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:    (   2) minutes.
Extended self-test routine
recommended polling time:    (  87) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x3037) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.
 
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       5736
  3 Spin_Up_Time            0x0027   144   143   021    Pre-fail  Always       -       3800
  4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1690
  5 Reallocated_Sector_Ct   0x0033   194   194   140    Pre-fail  Always       -       116
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   086   086   000    Old_age   Always       -       10733
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1665
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       141
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       1548
194 Temperature_Celsius     0x0022   102   094   000    Old_age   Always       -       41
196 Reallocated_Event_Count 0x0032   110   110   000    Old_age   Always       -       90
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       10
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       1
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       188
 
SMART Error Log Version: 1
No Errors Logged
 
SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]
 
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.

UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY错误信息:

在此处输入图片描述

从实时 USB 运行 fsck 的结果:



ubuntu@ubuntu:~$ sudo fsck /dev/sda2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
/dev/sda2 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix<y>? yes
Inode 1060186 was part of the orphaned inode list.  FIXED.
Inode 1060191 was part of the orphaned inode list.  FIXED.
Inode 1060193 was part of the orphaned inode list.  FIXED.
Inode 1060200 was part of the orphaned inode list.  FIXED.
Deleted inode 1060223 has zero dtime.  Fix<y>? yes
Pass 2: Checking directory structure
Error reading block 4202608 (Attempt to read block from filesystem resulted in short read) while reading directory block.  Ignore error<y>? yes
Force rewrite<y>? yes
Directory inode 1048767, block #0, offset 0: directory corrupted
Salvage<y>? yes
Missing '.' in directory inode 1048767.
Fix<y>? yes
Setting filetype for entry '.' in ??? (1048767) to 2.
Missing '..' in directory inode 1048767.
Fix<y>? yes
Setting filetype for entry '..' in ??? (1048767) to 2.
 
Pass 3: Checking directory connectivity
'..' in /home/faisal/.cache/logrotate (1048767) is <The NULL inode> (0), should be /home/faisal/.cache (1048583).
Fix<y>? yes
Pass 4: Checking reference counts
Inode 2 ref count is 23, should be 24.  Fix<y>? yes
Inode 1048583 ref count is 19, should be 18.  Fix<y>? yes
Unattached inode 1060211
Connect to /lost+found<y>? yes
Inode 1060211 ref count is 2, should be 1.  Fix<y>? yes
Pass 5: Checking group summary information
Block bitmap differences:  -(79757831--79757834) -(79757837--79757840) -(85494803--85494806) -(85524993--85525000)
Fix<y>? yes
Free blocks count wrong for group #2434 (21451, counted=21459).
Fix<y>? yes
Free blocks count wrong for group #2609 (6147, counted=6151).
Fix<y>? yes
Free blocks count wrong for group #2610 (29311, counted=29319).
Fix<y>? yes
Free blocks count wrong (105800045, counted=105799995).
Fix<y>? yes
Inode bitmap differences:  -1060186 -1060191 -1060193 -1060200 -1060223
Fix<y>? yes
Free inodes count wrong for group #129 (4724, counted=4729).
Fix<y>? yes
Free inodes count wrong (28871737, counted=28871728).
Fix<y>? yes
 
/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 578512/29450240 files (0.4% non-contiguous), 11994565/117794560 blocks

答案1

fsck /dev/sda2 每当终端要求输入时,输入并按回车键。

现在,在该过程完成后,输入:reboot

重启后,打开终端。确保网络连接正常,然后输入:
sudo apt-get clean
sudo apt-get update
sudo apt-get updrade

现在,您的系统将从现在开始正常启动。

答案2

我遇到过类似的问题,原因是 HDD 状况不佳,我用新的 SSD 替换它并全新安装 ubuntu 后问题就消失了。

如果是由于硬盘上的坏扇区造成的,我已通过 Windows 工具进行了验证硬盘哨兵据我所知,坏扇区无法每次都删除,有时这是由于磁盘的物理损坏造成的。另外,我的 HHD 已经使用了 5 年多,已经达到了其使用寿命。

在我的全新 SSD 中,我全新安装了 ubuntu 21.04,并且运行顺畅。

我曾给出过同样的答案Unix Stack Exchange

相关内容