Xfs

斷電後 xfs 超級塊損壞

  • June 11, 2021

像我之前的其他人一樣,我的 xfs 驅動器上的 superblock 已損壞。我試過 xfs_repair 和 xfs_repair -L 來恢復驅動器,但都報告了相同的結果:

Phase 1 - find and verify superblock...
superblock read failed, offset 0, size 524288, ag 0, rval -1

fatal error -- Input/output error

{mkfs.xfs -Nf /dev/sdb1} 報告以下內容:

meta-data=/dev/sdb1              isize=512    agcount=4, agsize=244188544 blks
        =                       sectsz=4096  attr=2, projid32bit=1
        =                       crc=1        finobt=1, sparse=1, rmapbt=0
        =                       reflink=1
data     =                       bsize=4096   blocks=976754176, imaxpct=5
        =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=476930, version=2
        =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

在關注了關於這個主題的各種文章後,這些文章都與我上面嘗試過的內容相似,我有一種下沉的感覺,驅動器內容失去了(感謝 EDF Energy)。有沒有人有任何進一步的恢復建議?

編輯:SMART掃描結果…

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD40EFRX-68N32N0  1
Serial Number:    PBGJYR4S
LU WWN Device Id: 5 000cca 23dc7b57b
Firmware Version: MJAOA5F0
User Capacity:    4,000,787,030,016 bytes [4.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Jun 11 19:11:40 2021 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:  (0x82) Offline data collection activity
                                       was completed without error.
                                       Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 248) Self-test routine in progress...
                                       80% of test remaining.
Total time to complete Offline
data collection:                (   24) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                       Auto Offline data collection on/off support.
                                       Suspend Offline collection upon new
                                       command.
                                       Offline surface scan supported.
                                       Self-test supported.
                                       No 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:        (   1) minutes.
SCT capabilities:              (0x003d) SCT Status supported.
                                       SCT Error Recovery Control 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     0x000b   100   100   016    Pre-fail  Always       -       0
 2 Throughput_Performance  0x0005   136   136   054    Pre-fail  Offline      -       80
 3 Spin_Up_Time            0x0007   176   176   024    Pre-fail  Always       -       411 (Average 468)
 4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       14
 5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
 7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
 8 Seek_Time_Performance   0x0005   121   121   020    Pre-fail  Offline      -       34
 9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       6222
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       14
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       273
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       273
194 Temperature_Celsius     0x0002   142   142   000    Old_age   Always       -       42 (Min/Max 20/42)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   174   174   000    Old_age   Always       -       1272

SMART Error Log Version: 1
ATA Error Count: 1272 (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 1272 occurred at disk power-on lifetime: 6220 hours (259 days + 4 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
 -- -- -- -- -- -- --
 84 51 21 5f b7 c0 01  Error: ICRC, ABRT 33 sectors at LBA = 0x01c0b75f = 29407071

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 00 80 00 b7 c0 e0 08   1d+02:04:04.303  READ DMA EXT
 25 00 f8 00 b6 c0 e0 08   1d+02:04:04.303  READ DMA EXT
 25 00 08 f8 b5 c0 e0 08   1d+02:04:04.302  READ DMA EXT
 25 00 08 f0 b5 c0 e0 08   1d+02:04:04.302  READ DMA EXT
 25 00 08 e8 b5 c0 e0 08   1d+02:04:04.302  READ DMA EXT

Error 1271 occurred at disk power-on lifetime: 6220 hours (259 days + 4 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
 -- -- -- -- -- -- --
 84 51 01 97 b5 c0 01  Error: ICRC, ABRT 1 sectors at LBA = 0x01c0b597 = 29406615

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 00 08 90 b5 c0 e0 08   1d+02:04:04.096  READ DMA EXT
 25 00 08 88 b5 c0 e0 08   1d+02:04:04.095  READ DMA EXT
 25 00 08 80 b5 c0 e0 08   1d+02:04:04.095  READ DMA EXT
 25 00 08 78 b5 c0 e0 08   1d+02:04:04.095  READ DMA EXT
 25 00 08 70 b5 c0 e0 08   1d+02:04:04.095  READ DMA EXT

Error 1270 occurred at disk power-on lifetime: 6220 hours (259 days + 4 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
 -- -- -- -- -- -- --
 84 51 81 7f b5 c0 01  Error: ICRC, ABRT 129 sectors at LBA = 0x01c0b57f = 29406591

 Commands leading to the command that caused the error were:
 CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
 -- -- -- -- -- -- -- --  ----------------  --------------------
 25 00 00 00 b4 c0 e0 08   1d+02:04:03.858  READ DMA EXT
 25 00 f8 08 0a 00 e0 08   1d+02:04:03.856  READ DMA EXT
 c8 00 08 f8 08 00 e0 08   1d+02:04:03.856  READ DMA
 c8 00 08 f0 08 00 e0 08   1d+02:04:03.856  READ DMA
 c8 00 08 e8 08 00 e0 08   1d+02:04:03.855  READ DMA

Error 1269 occurred at disk power-on lifetime: 6220 hours (259 days + 4 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
 -- -- -- -- -- -- --
 84 51 01 c7 08 00 00  Error: ICRC, ABRT 1 sectors at LBA = 0x000008c7 = 2247

 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 c0 08 00 e0 08   1d+02:04:03.648  READ DMA
 c8 00 08 b8 08 00 e0 08   1d+02:04:03.641  READ DMA
 27 00 00 00 00 00 e0 08   1d+02:04:03.640  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
 ec 00 00 00 00 00 a0 08   1d+02:04:03.638  IDENTIFY DEVICE
 ef 03 42 00 00 00 a0 08   1d+02:04:03.636  SET FEATURES [Set transfer mode]

Error 1268 occurred at disk power-on lifetime: 6220 hours (259 days + 4 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
 -- -- -- -- -- -- --
 84 51 01 bf 08 00 00  Error: ICRC, ABRT 1 sectors at LBA = 0x000008bf = 2239

 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 b8 08 00 e0 08   1d+02:04:03.440  READ DMA
 c8 00 08 b0 08 00 e0 08   1d+02:04:03.440  READ DMA
 c8 00 08 a8 08 00 e0 08   1d+02:04:03.440  READ DMA
 c8 00 08 a0 08 00 e0 08   1d+02:04:03.440  READ DMA
 c8 00 08 98 08 00 e0 08   1d+02:04:03.440  READ DMA

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Vendor (0xb0)       Completed without error       00%     36443         -
# 2  Vendor (0x71)       Completed without error       00%     36443         -

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.

我不得不說這看起來像是一個壞磁碟或一個非常接近完全災難性故障的磁碟。我希望你有備份!?!

如果您沒有備份,您應該真正關閉該系統,引導到備用媒體或將故障磁碟帶到另一個系統並開始嘗試將數據複製到新磁碟。如果您無法訪問獨立的磁碟修復工作站(仍然是我購買過的最好的小工具!),這可以通過塊級別的 dd(或 ddrescue)多次重試來完成。ddrescue 有一個 max-retries 選項,有時通過多次重試,您可以成功讀取壞磁碟上的數據。有時… Trinity Rescue Kit LiveCD 提供了這個 GNU 工具。我不確定是否所有 liveCD 發行版都有它。值得得到它並保持它方便!這是另一篇文章中的一個範例,討論了這樣做以供參考: https://superuser.com/questions/905811/faster-recovery-from-a-disk-with-bad-sectors

對於其他人來說,只是一點智慧,我不得不在我的職業生涯中艱難地學習幾次。擁有備份卻永遠不需要它們,總比需要備份卻一無所有要好!配置備份!這應該是您安裝作業系統後要做的第一件事!!!養成習慣和/或現在,如果沒有備份,您將永遠不會被抓住!

引用自:https://serverfault.com/questions/1066447