驱动器不再在启动时安装

驱动器不再在启动时安装

我有一台运行 Ubuntu Server(无 GUI)的服务器,并使用 fstab 将驱动器安装到特定文件夹,但是前几天,重新启动后,它无法安装,并且在启动过程中,我收到以下错误……

An error occurred while mounting /home/user/Media/sdb.
keys:Press S to skip mounting or M for manual recovery

我对 Linux 服务器还很陌生,正在学习,但我知道 skip 会将我发送到我的普通用户登录,而 manual 会将我带到根用户。

我已经检查了我的 fstab 文件,有问题的磁盘 (sdb1) 确实存在……

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4e17c0d0-4774-4604-b73e-706f213208a3 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda3 during installation
UUID=ab7d9edb-65cf-45fa-8306-6d26b42099cd /home           xfs     defaults        0       2
# swap was on /dev/sda2 during installation
UUID=f1d67199-1b76-4035-9efe-f87ffcebe4d9 none            swap    sw              0       0
/dev/sdb1       /home/stephen/Media/sdb ext4    defaults        0       0
/dev/md0        /home/stephen/Media/raid1       ext4    defaults        0       0

我也尝试使用跳过选项,然后手动安装驱动器,并且这工作正常,所以我猜我在 fstab 方面搞砸了,但我很难确定发生了什么。

我也尝试过改变/dev/sdb1对 UUID 的引用,但这没有帮助。

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=4e17c0d0-4774-4604-b73e-706f213208a3 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda3 during installation
UUID=ab7d9edb-65cf-45fa-8306-6d26b42099cd /home           xfs     defaults        0       2
# swap was on /dev/sda2 during installation
UUID=f1d67199-1b76-4035-9efe-f87ffcebe4d9 none            swap    sw              0       0
UUID=4C1C25C81C25AE40       /home/stephen/Media/sdb ext4    defaults        0       0
/dev/md0        /home/stephen/Media/raid1       ext4    defaults        0       0

没有 Windows 电脑,但将驱动器连接到我的 Mac 并设法从 diskutil 列表中获取它...

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *2.0 TB     disk3
   1:               Windows_NTFS                         2.0 TB     disk3s1

smartctl -a /dev/sdb 的输出

user@user:~$ sudo smartctl -a /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.19.0-25-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Green (AF, SATA 6Gb/s)
Device Model:     WDC WD20EARX-00PASB0
Serial Number:    WD-WMAZA5292120
LU WWN Device Id: 5 0014ee 0ad758dc6
Firmware Version: 51.0AB51
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes 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:    Sun Oct 18 20:32:04 2015 BST
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:  (0x84) Offline data collection activity
                    was suspended by an interrupting command from host.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 121) The previous self-test completed having
                    the read element of the test failed.
Total time to complete Offline 
data collection:        (38760) 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:    ( 374) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x3035) 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   192   192   051    Pre-fail  Always       -       266801
  3 Spin_Up_Time            0x0027   175   166   021    Pre-fail  Always       -       6250
  4 Start_Stop_Count        0x0032   098   098   000    Old_age   Always       -       2539
  5 Reallocated_Sector_Ct   0x0033   196   196   140    Pre-fail  Always       -       76
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   056   056   000    Old_age   Always       -       32843
 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   100   100   000    Old_age   Always       -       139
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       118
193 Load_Cycle_Count        0x0032   174   174   000    Old_age   Always       -       78691
194 Temperature_Celsius     0x0022   118   107   000    Old_age   Always       -       32
196 Reallocated_Event_Count 0x0032   150   150   000    Old_age   Always       -       50
197 Current_Pending_Sector  0x0032   197   197   000    Old_age   Always       -       1061
198 Offline_Uncorrectable   0x0030   197   197   000    Old_age   Offline      -       1023
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   150   143   000    Old_age   Offline      -       13350

SMART Error Log Version: 1
ATA Error Count: 8 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 8 occurred at disk power-on lifetime: 31536 hours (1314 days + 0 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 d0 75 31 ed  Error: UNC 8 sectors at LBA = 0x0d3175d0 = 221345232

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 d0 75 31 ed 08   1d+07:59:43.846  READ DMA
  c8 00 08 c8 75 31 ed 08   1d+07:59:43.846  READ DMA
  c8 00 08 c0 75 31 ed 08   1d+07:59:43.846  READ DMA
  c8 00 08 b8 75 31 ed 08   1d+07:59:43.844  READ DMA
  c8 00 08 b0 75 31 ed 08   1d+07:59:41.951  READ DMA

Error 7 occurred at disk power-on lifetime: 31511 hours (1312 days + 23 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 50 fa 94 e0  Error: UNC 8 sectors at LBA = 0x0094fa50 = 9763408

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 50 fa 94 e0 08      07:41:58.418  READ DMA
  ef 10 02 00 00 00 a0 08      07:41:58.415  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      07:41:56.574  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      07:41:55.374  SET FEATURES [Set transfer mode]

Error 6 occurred at disk power-on lifetime: 31511 hours (1312 days + 23 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 50 fa 94 e0  Error: UNC 8 sectors at LBA = 0x0094fa50 = 9763408

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 50 fa 94 e0 08      07:41:49.814  READ DMA
  c8 00 08 f8 fb 94 e0 08      07:41:49.813  READ DMA
  c8 00 08 f0 fb 94 e0 08      07:41:49.813  READ DMA
  c8 00 08 e8 fb 94 e0 08      07:41:49.812  READ DMA
  c8 00 08 e0 fb 94 e0 08      07:41:49.812  READ DMA

Error 5 occurred at disk power-on lifetime: 31511 hours (1312 days + 23 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 50 fa 94 e0  Error: UNC 8 sectors at LBA = 0x0094fa50 = 9763408

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 50 fa 94 e0 08      07:41:39.776  READ DMA

Error 4 occurred at disk power-on lifetime: 31511 hours (1312 days + 23 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 08 50 fa 94 e0  Error: UNC 8 sectors at LBA = 0x0094fa50 = 9763408

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 50 fa 94 e0 08      07:41:18.237  READ DMA
  ef 10 02 00 00 00 a0 08      07:41:18.236  SET FEATURES [Enable SATA feature]
  ec 00 00 00 00 00 a0 08      07:41:18.232  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      07:41:17.219  SET FEATURES [Set transfer mode]

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%     32842         290392361
# 2  Short offline       Completed: read failure       90%     32841         290392360
# 3  Short offline       Completed: read failure       90%     32841         290392360

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.

希望这可以帮助。

如果有人能指出我哪里做错了,我将不胜感激。

谢谢,Ste

答案1

看来您的磁盘出现读取失败:

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%     32842         290392361

并且在过去 54 天发生过 DMA 故障:

Error 8 occurred at disk power-on lifetime: 31536 hours (1314 days + 0 hours)
When the command that caused the error occurred, the device was active or idle.
Command/Feature_Name: READ DMA

(从您运行 开始算起已过去 54 天smartctl --test=short /dev/sdb

并且在前一天和前一小时又出现了几次相同的错误(错误 7、6、5 和 4)

不幸的是,我只看到一种摆脱困境的方法(好吧,两种,但其中一种是商业的,我需要询问一下我是否被允许发布商业解决方案):

尽快停止使用该磁盘,购买另一个大于或等于当前磁盘的磁盘,并将ddrescue坏磁盘上的好扇区复制到新磁盘上。

浏览此网站了解如何使用ddrescue。如果浏览后仍不清楚,请随时提出另一个问题参考您已经研究过的问题并解释出了什么问题!

如果您也想要商业解决方案,请随时在下面发表评论。

相关内容