
システムディスクに奇妙な状況が発生しました。これは、ブートパーティション、スワップパーティション、およびファイルシステム(ext4)の3つのパーティションで構成されるLinuxシステムです。数日前、私は読み取れないディスクがあるかどうかを確認したかったので、Pendriveのknoppixを使用しました(knoppixイメージから起動可能なUSBドライブを自分で作成しました)…読み取れないディスクが2つありました!
システムを再起動すると、画面に次のエラーが表示され始めました。
error: failure reading sector ... from 'hd0'.
何度も試したところ、グラップシェルを手に入れました。
Linux Mintを使用して別の起動可能なスティックを作成し、何が間違っているかを確認しようとしました。
ディスクツールを使用してディスクを調べると、ディスクは正常ですが、不良セクタが8つあり(以前にあったかどうかわからない)、ファイルシステムパーティションはありますが、データパーティションは不明なタイプです。testdiskを実行しようとしています。パーティションを見つけてスーパーブロックを確認し、ファイルシステムタイプ(ext4)を設定すると、テストディスク自体のデータを見ることができましたが、まだパーティションをマウントできませんでした。
Testdiskはe2fsck -p -bの実行を提案し、testdiskによって提供されたすべてのスーパーブロックを試しましたが、fsckが問題を修正しようとするたびにディスク書き込みエラーが発生しました。
この時点では、時間がかなり遅く、あきらめて一晩滞在しましたが、データをまだ読み取ることができるという事実に多少安心しました。翌日、驚くべきことに、データはもはや存在しませんでした。おそらくいくつかのfsckを実行すると、状況がさらに悪化した可能性があります。 testdiskがスーパーブロック番号を提供していないためです(そして何を試してもファイルには表示されませんでした)。 testdiskで)、
Bad magic number in super-block while trying to open /dev/sda3
数字に関係なく以前に得た数字でfsckを実行しようとすると(保存しました)この時点で、私はsafecopyで画像を作成し(認めます。最初にしなければなりませんでしたが、ちょっと恥ずかしいとは思いませんでした)、さまざまなソリューションをテストできるようにコピーしました。 a 気に入らないポイントに達するたびに、イメージの新しいコピーが始まります。
私が試したことはすべて役に立ちません。 -Sオプションでmkfsを使用することをお勧めします。これでスーパーブロックのみを再構築できますが、そうしてからfsckを実行すると(ツールが提案するように)パーティションに再びアクセスできるようになります。ただし、パーティションは完全に空です。空白なので、photorecもデータを見つけることができません(mkfs + fsckを実行する前に画像内のデータを見つけます)。
画像の1つでR-Linuxを実行していますが、何も復元できません。私が持っているのは$ Inodeという「ファイル」だけですが、識別できるファイルやディレクトリ構造はありません。
これが結果ですsmartctl -a /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-58-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba 2.5" HDD MQ01ABD...
Device Model: TOSHIBA MQ01ABD100
Serial Number: 95CEC91QT
LU WWN Device Id: 5 000039 683983c2b
Firmware Version: AX0R2J
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
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: Tue Jun 1 22:30:50 2021 CEST
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: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
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: ( 120) 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: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 246) 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 050 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0
3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 1815
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 1377
5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 8
7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0
9 Power_On_Hours 0x0032 053 053 000 Old_age Always - 19115
10 Spin_Retry_Count 0x0033 127 100 030 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1368
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 275
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 50
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 4455
194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 30 (Min/Max 13/49)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 1
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 1
220 Disk_Shift 0x0002 100 100 000 Old_age Always - 0
222 Loaded_Hours 0x0032 053 053 000 Old_age Always - 18889
223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0
224 Load_Friction 0x0022 100 100 000 Old_age Always - 0
226 Load-in_Time 0x0026 100 100 000 Old_age Always - 265
240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0
SMART Error Log Version: 1
ATA Error Count: 2032 (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 2032 occurred at disk power-on lifetime: 19112 hours (796 days + 8 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 41 38 00 d8 16 40 Error: UNC at LBA = 0x0016d800 = 1497088
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 08 38 00 d8 16 40 00 1d+05:06:46.679 READ FPDMA QUEUED
ef 10 03 00 00 00 a0 00 1d+05:06:46.678 SET FEATURES [Enable SATA feature]
ef 10 02 00 00 00 a0 00 1d+05:06:46.678 SET FEATURES [Enable SATA feature]
27 00 00 00 00 00 e0 00 1d+05:06:46.678 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 1d+05:06:46.677 IDENTIFY DEVICE
Error 2031 occurred at disk power-on lifetime: 19112 hours (796 days + 8 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 41 68 00 d8 16 40 Error: UNC at LBA = 0x0016d800 = 1497088
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 08 68 00 d8 16 40 00 1d+05:06:45.909 READ FPDMA QUEUED
e5 00 00 00 00 00 00 00 1d+05:06:45.669 CHECK POWER MODE
e5 00 00 00 00 00 00 00 1d+05:06:40.669 CHECK POWER MODE
e5 00 00 00 00 00 00 00 1d+05:06:35.670 CHECK POWER MODE
e5 00 00 00 00 00 00 00 1d+05:06:30.669 CHECK POWER MODE
Error 2030 occurred at disk power-on lifetime: 19110 hours (796 days + 6 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 41 30 00 d8 16 40 Error: UNC at LBA = 0x0016d800 = 1497088
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 00 e8 fd de 40 00 1d+02:46:45.118 READ FPDMA QUEUED
60 00 f8 e8 fc de 40 00 1d+02:46:45.117 READ FPDMA QUEUED
60 00 b8 e8 fb de 40 00 1d+02:46:45.116 READ FPDMA QUEUED
60 00 b0 e8 fa de 40 00 1d+02:46:45.116 READ FPDMA QUEUED
60 00 a8 e8 f9 de 40 00 1d+02:46:45.115 READ FPDMA QUEUED
Error 2029 occurred at disk power-on lifetime: 19110 hours (796 days + 6 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 41 a0 00 d8 16 40 Error: UNC at LBA = 0x0016d800 = 1497088
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 e8 f8 de 40 00 1d+02:46:44.968 READ FPDMA QUEUED
60 00 00 e8 f7 de 40 00 1d+02:46:44.968 READ FPDMA QUEUED
60 00 f0 e8 f6 de 40 00 1d+02:46:44.966 READ FPDMA QUEUED
60 00 e8 e8 f5 de 40 00 1d+02:46:44.965 READ FPDMA QUEUED
60 00 e0 e8 f4 de 40 00 1d+02:46:44.964 READ FPDMA QUEUED
Error 2028 occurred at disk power-on lifetime: 19110 hours (796 days + 6 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 41 88 00 d8 16 40 Error: UNC at LBA = 0x0016d800 = 1497088
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 a0 e8 e8 de 40 00 1d+02:46:44.792 READ FPDMA QUEUED
60 00 98 e8 e7 de 40 00 1d+02:46:44.791 READ FPDMA QUEUED
60 00 90 e8 e6 de 40 00 1d+02:46:44.788 READ FPDMA QUEUED
60 00 78 e8 e5 de 40 00 1d+02:46:44.787 READ FPDMA QUEUED
60 00 70 e8 e4 de 40 00 1d+02:46:44.786 READ FPDMA QUEUED
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.
答え1
最後に、USBスティックのライブバージョンを使用したとき、Knoppixは私のパーティションテーブルを台無しにし、ディスクは実際には大丈夫であり(一部の不良セクタを除く)、正しいパーティションを回復するためにいくつかの方法を試しましたが、成功しなかったことに気づきました。効果がある
私の質問といくつかのコメントで述べたように、mkfsを使用するとパーティションを再マウントできますが、データがなく、明らかにこれがスーパーブロックを再構築する唯一の方法であるようですが、正しい方法を見つけることができません。それ。
2週間の努力の終わりに必要なすべての重要なデータは、とにかくリポジトリに保存されているので、すべてをフォーマットして最初から始めることにしました。
答え2
盲目的に何かをする前に常に文書を読んでください。man mkfs.ext4
そして、旗を見つけたら、それから走らなければならないと-S
教えてくれますe2fsck
。
保存されたディスクのコピーに書き込んだ場合、そのコピーも期限切れになったはずです。ディスクリカバリのルール1は、できるだけ早くコピーを取得することです。ルール2は、保存されたコピーには絶対に書き込まないことです。
私が気づいたことの1つは、ディスク(/dev/sda
)とパーティション(/dev/sda3
)を混同していることです。mkfs -S /dev/sda
パーティションの代わりにディスク上にファイルシステムを再作成しようとしましたが、問題が発生したことは確実ですか?パーティションテーブルを回復できる場合可能正常に実行できますmkfs -S /dev/sda3
。または循環装置による同等の操作。
注:有効期限が切れているディスクと唯一保存されたコピーに書き換えようとしないでください。レプリカの新しいコピーを取得して処理します。