저는 주로 ddrescue와 testdisk를 사용하여 Seagate 7200.11 1.5TB 드라이브(ext4 파티션 2개_)에서 3일 동안 데이터를 복구하려고 시도했지만 디스크에 심각한 오류(SA 손상 또는 그와 유사한 것일 수도 있음)로 인해 시스템이 특정 섹터에 액세스하면 /dev가 삭제됩니다.
내 생각에 내가 가장 가까이 다가온 것은 ddrescue인 것 같다. 하지만 생성된 이미지가 불완전하고 "잘못된 형상: 블록 수 xxx가 장치 크기를 초과합니다.." 오류 등이 발생하여 설치할 수 없습니다. 어젯밤에 다시 ddrescue를 시작했는데 이번에는 두 번째 파티션에서 3시간을 기다린 후 잠자리에 들었습니다. 당시에는 ~700GB 파티션에서 ~150GB를 복사했습니다. 사용된 명령:
ddrescue -n -v -T 30 --skip-size=1M,10M --min-read-rate=50k /dev/sdc2 /media/rescue/Drive2.img /media/rescue/Drive2.log
잠에서 깨어났을 때 드라이브가 /dev/에서 사라져서 ddrescue가 200GB+ 범위에서 "잘못된 크기"를 표시한 것을 보고 매우 실망했습니다. /var/log/messages에 중복된 줄이 있습니다:
2014-06-13T10:54:08.526490+05:00 suse kernel: [ 6693.096125] Read(10): 28 00 5a 79 55 88 00 00 08 00
2014-06-13T10:54:08.526491+05:00 suse kernel: [ 6693.096174] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T10:54:08.526491+05:00 suse kernel: [ 6693.096176] sd 2:0:0:0: [sdc]
2014-06-13T10:54:08.526492+05:00 suse kernel: [ 6693.096176] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T10:54:08.526493+05:00 suse kernel: [ 6693.096177] sd 2:0:0:0: [sdc] CDB:
2014-06-13T10:54:08.526494+05:00 suse kernel: [ 6693.096178] Read(10): 28 00 5a 79 4d e8 00 00 08 00
2014-06-13T10:54:08.526494+05:00 suse kernel: [ 6693.096226] sd 2:0:0:0: [sdc] Unhandled error code
/dev에서 사라진 즈음에 (제 생각에는):
2014-06-13T07:34:30.290574+05:00 suse kernel: [ 6743.832817] ata3: EH complete
2014-06-13T07:34:33.892459+05:00 suse kernel: [ 6747.432198] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
2014-06-13T07:34:33.892486+05:00 suse kernel: [ 6747.432203] ata3.00: irq_stat 0x40000008
2014-06-13T07:34:33.892489+05:00 suse kernel: [ 6747.432206] ata3.00: failed command: READ FPDMA QUEUED
2014-06-13T07:34:33.892502+05:00 suse kernel: [ 6747.432212] ata3.00: cmd 60/08:00:10:50:08/00:00:5c:00:00/40 tag 0 ncq 4096 in
2014-06-13T07:34:33.892511+05:00 suse kernel: [ 6747.432212] res 41/40:08:17:50:08/00:00:5c:00:00/00 Emask 0x409 (media error) <F>
2014-06-13T07:34:33.892517+05:00 suse kernel: [ 6747.432215] ata3.00: status: { DRDY ERR }
2014-06-13T07:34:33.892519+05:00 suse kernel: [ 6747.432217] ata3.00: error: { UNC }
2014-06-13T07:34:34.003455+05:00 suse kernel: [ 6747.543056] ata3.00: configured for UDMA/133
2014-06-13T07:34:34.003476+05:00 suse kernel: [ 6747.543074] sd 2:0:0:0: [sdc] Unhandled sense code
2014-06-13T07:34:34.003480+05:00 suse kernel: [ 6747.543076] sd 2:0:0:0: [sdc]
2014-06-13T07:34:34.003483+05:00 suse kernel: [ 6747.543078] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
2014-06-13T07:34:34.003486+05:00 suse kernel: [ 6747.543080] sd 2:0:0:0: [sdc]
2014-06-13T07:34:34.003488+05:00 suse kernel: [ 6747.543082] Sense Key : Medium Error [current] [descriptor]
2014-06-13T07:34:34.003491+05:00 suse kernel: [ 6747.543085] Descriptor sense data with sense descriptors (in hex):
2014-06-13T07:34:34.003502+05:00 suse kernel: [ 6747.543086] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
2014-06-13T07:34:34.003503+05:00 suse kernel: [ 6747.543095] 5c 08 50 17
2014-06-13T07:34:34.003504+05:00 suse kernel: [ 6747.543099] sd 2:0:0:0: [sdc]
2014-06-13T07:34:34.003505+05:00 suse kernel: [ 6747.543110] Add. Sense: Unrecovered read error - auto reallocate failed
2014-06-13T07:34:34.003505+05:00 suse kernel: [ 6747.543111] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:34:34.003506+05:00 suse kernel: [ 6747.543112] Read(10): 28 00 5c 08 50 10 00 00 08 00
2014-06-13T07:34:34.003507+05:00 suse kernel: [ 6747.543116] end_request: I/O error, dev sdc, sector 1544048663
2014-06-13T07:34:34.003508+05:00 suse kernel: [ 6747.543118] Buffer I/O error on device sdc2, logical block 3270402
2014-06-13T07:34:34.003509+05:00 suse kernel: [ 6747.543127] ata3: EH complete
2014-06-13T07:34:36.758454+05:00 suse kernel: [ 6750.295735] ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
2014-06-13T07:34:36.758484+05:00 suse kernel: [ 6750.295740] ata3.00: irq_stat 0x40000008
2014-06-13T07:34:36.758488+05:00 suse kernel: [ 6750.295743] ata3.00: failed command: READ FPDMA QUEUED
2014-06-13T07:34:36.758492+05:00 suse kernel: [ 6750.295750] ata3.00: cmd 60/08:00:10:50:08/00:00:5c:00:00/40 tag 0 ncq 4096 in
2014-06-13T07:34:36.758496+05:00 suse kernel: [ 6750.295750] res 41/40:08:17:50:08/00:00:5c:00:00/00 Emask 0x409 (media error) <F>
2014-06-13T07:34:36.758499+05:00 suse kernel: [ 6750.295752] ata3.00: status: { DRDY ERR }
2014-06-13T07:34:36.758502+05:00 suse kernel: [ 6750.295754] ata3.00: error: { UNC }
2014-06-13T07:34:36.932467+05:00 suse kernel: [ 6750.469333] ata3.00: configured for UDMA/133
2014-06-13T07:34:36.932495+05:00 suse kernel: [ 6750.469351] sd 2:0:0:0: [sdc] Unhandled sense code
2014-06-13T07:34:36.932501+05:00 suse kernel: [ 6750.469354] sd 2:0:0:0: [sdc]
2014-06-13T07:34:36.932504+05:00 suse kernel: [ 6750.469355] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
2014-06-13T07:34:36.932507+05:00 suse kernel: [ 6750.469357] sd 2:0:0:0: [sdc]
2014-06-13T07:34:36.932510+05:00 suse kernel: [ 6750.469359] Sense Key : Medium Error [current] [descriptor]
2014-06-13T07:34:36.932514+05:00 suse kernel: [ 6750.469362] Descriptor sense data with sense descriptors (in hex):
2014-06-13T07:34:36.932534+05:00 suse kernel: [ 6750.469364] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
2014-06-13T07:34:36.932546+05:00 suse kernel: [ 6750.469372] 5c 08 50 17
2014-06-13T07:34:36.932551+05:00 suse kernel: [ 6750.469376] sd 2:0:0:0: [sdc]
2014-06-13T07:34:36.932556+05:00 suse kernel: [ 6750.469379] Add. Sense: Unrecovered read error - auto reallocate failed
2014-06-13T07:34:36.932560+05:00 suse kernel: [ 6750.469381] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:34:36.932564+05:00 suse kernel: [ 6750.469382] Read(10): 28 00 5c 08 50 10 00 00 08 00
2014-06-13T07:34:36.932567+05:00 suse kernel: [ 6750.469390] end_request: I/O error, dev sdc, sector 1544048663
2014-06-13T07:34:36.932572+05:00 suse kernel: [ 6750.469394] Buffer I/O error on device sdc2, logical block 3270402
2014-06-13T07:34:36.932576+05:00 suse kernel: [ 6750.469420] ata3: EH complete
2014-06-13T07:36:15.441806+05:00 suse su: (to root) procyon on /dev/pts/5
2014-06-13T07:53:20.731456+05:00 suse kernel: [ 7873.286421] ata3: failed to read log page 10h (errno=-5)
2014-06-13T07:53:20.731483+05:00 suse kernel: [ 7873.286429] ata3.00: exception Emask 0x1 SAct 0x1 SErr 0x0 action 0x0
2014-06-13T07:53:20.731487+05:00 suse kernel: [ 7873.286431] ata3.00: irq_stat 0x40000008
2014-06-13T07:53:20.731488+05:00 suse kernel: [ 7873.286434] ata3.00: failed command: READ FPDMA QUEUED
2014-06-13T07:53:20.731490+05:00 suse kernel: [ 7873.286440] ata3.00: cmd 60/08:00:10:59:6d/00:00:60:00:00/40 tag 0 ncq 4096 in
2014-06-13T07:53:20.731493+05:00 suse kernel: [ 7873.286440] res 40/00:00:10:59:6d/00:00:60:00:00/40 Emask 0x1 (device error)
2014-06-13T07:53:20.731495+05:00 suse kernel: [ 7873.286443] ata3.00: status: { DRDY }
2014-06-13T07:53:20.740442+05:00 suse kernel: [ 7873.296009] ata3.00: both IDENTIFYs aborted, assuming NODEV
2014-06-13T07:53:20.740462+05:00 suse kernel: [ 7873.296013] ata3.00: revalidation failed (errno=-2)
2014-06-13T07:53:20.740464+05:00 suse kernel: [ 7873.296018] ata3: hard resetting link
2014-06-13T07:53:21.045453+05:00 suse kernel: [ 7873.599792] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
2014-06-13T07:53:21.065444+05:00 suse kernel: [ 7873.620355] ata3.00: both IDENTIFYs aborted, assuming NODEV
2014-06-13T07:53:21.065467+05:00 suse kernel: [ 7873.620359] ata3.00: revalidation failed (errno=-2)
2014-06-13T07:53:26.045451+05:00 suse kernel: [ 7878.595494] ata3: hard resetting link
2014-06-13T07:53:26.350457+05:00 suse kernel: [ 7878.900156] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
2014-06-13T07:53:26.395504+05:00 suse kernel: [ 7878.945713] ata3.00: both IDENTIFYs aborted, assuming NODEV
2014-06-13T07:53:26.395516+05:00 suse kernel: [ 7878.945717] ata3.00: revalidation failed (errno=-2)
2014-06-13T07:53:26.395518+05:00 suse kernel: [ 7878.945719] ata3.00: disabled
2014-06-13T07:53:26.395520+05:00 suse kernel: [ 7878.945752] ata3: EH complete
2014-06-13T07:53:26.395522+05:00 suse kernel: [ 7878.945774] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395523+05:00 suse kernel: [ 7878.945775] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395525+05:00 suse kernel: [ 7878.945776] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395528+05:00 suse kernel: [ 7878.945777] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395529+05:00 suse kernel: [ 7878.945778] Read(10): 28 00 60 6d 59 10 00 00 08 00
2014-06-13T07:53:26.395531+05:00 suse kernel: [ 7878.945782] end_request: I/O error, dev sdc, sector 1617778960
2014-06-13T07:53:26.395532+05:00 suse kernel: [ 7878.945784] Buffer I/O error on device sdc2, logical block 12486690
2014-06-13T07:53:26.395534+05:00 suse kernel: [ 7878.945863] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395535+05:00 suse kernel: [ 7878.945868] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395537+05:00 suse kernel: [ 7878.945869] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395538+05:00 suse kernel: [ 7878.945872] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395540+05:00 suse kernel: [ 7878.945873] Read(10): 28 00 60 6d 59 10 00 00 08 00
2014-06-13T07:53:26.395541+05:00 suse kernel: [ 7878.945882] end_request: I/O error, dev sdc, sector 1617778960
2014-06-13T07:53:26.395543+05:00 suse kernel: [ 7878.945885] Buffer I/O error on device sdc2, logical block 12486690
2014-06-13T07:53:26.395544+05:00 suse kernel: [ 7878.945997] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395546+05:00 suse kernel: [ 7878.946000] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395547+05:00 suse kernel: [ 7878.946002] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395548+05:00 suse kernel: [ 7878.946004] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395550+05:00 suse kernel: [ 7878.946005] Read(10): 28 00 60 6d 59 80 00 00 08 00
2014-06-13T07:53:26.395551+05:00 suse kernel: [ 7878.946012] end_request: I/O error, dev sdc, sector 1617779072
2014-06-13T07:53:26.395552+05:00 suse kernel: [ 7878.946015] Buffer I/O error on device sdc2, logical block 12486704
2014-06-13T07:53:26.395554+05:00 suse kernel: [ 7878.946076] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395555+05:00 suse kernel: [ 7878.946080] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395557+05:00 suse kernel: [ 7878.946082] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395558+05:00 suse kernel: [ 7878.946085] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395560+05:00 suse kernel: [ 7878.946100] Read(10): 28 00 60 6d 5a 00 00 00 08 00
2014-06-13T07:53:26.395562+05:00 suse kernel: [ 7878.946141] end_request: I/O error, dev sdc, sector 1617779200
2014-06-13T07:53:26.395563+05:00 suse kernel: [ 7878.946152] Buffer I/O error on device sdc2, logical block 12486720
2014-06-13T07:53:26.395580+05:00 suse kernel: [ 7878.946192] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395582+05:00 suse kernel: [ 7878.946194] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395584+05:00 suse kernel: [ 7878.946195] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395585+05:00 suse kernel: [ 7878.946196] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395587+05:00 suse kernel: [ 7878.946197] Read(10): 28 00 60 6d 5b 00 00 00 08 00
2014-06-13T07:53:26.395588+05:00 suse kernel: [ 7878.946202] end_request: I/O error, dev sdc, sector 1617779456
2014-06-13T07:53:26.395590+05:00 suse kernel: [ 7878.946203] Buffer I/O error on device sdc2, logical block 12486752
2014-06-13T07:53:26.395592+05:00 suse kernel: [ 7878.946221] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395593+05:00 suse kernel: [ 7878.946223] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395595+05:00 suse kernel: [ 7878.946224] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395596+05:00 suse kernel: [ 7878.946224] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395598+05:00 suse kernel: [ 7878.946227] Read(10): 28 00 60 6d 5d 00 00 00 08 00
2014-06-13T07:53:26.395599+05:00 suse kernel: [ 7878.946228] end_request: I/O error, dev sdc, sector 1617779968
2014-06-13T07:53:26.395601+05:00 suse kernel: [ 7878.946229] Buffer I/O error on device sdc2, logical block 12486816
2014-06-13T07:53:26.395602+05:00 suse kernel: [ 7878.946245] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395608+05:00 suse kernel: [ 7878.946254] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395611+05:00 suse kernel: [ 7878.946254] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395612+05:00 suse kernel: [ 7878.946255] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395615+05:00 suse kernel: [ 7878.946258] Read(10): 28 00 60 6d 61 00 00 00 08 00
2014-06-13T07:53:26.395616+05:00 suse kernel: [ 7878.946259] end_request: I/O error, dev sdc, sector 1617780992
2014-06-13T07:53:26.395618+05:00 suse kernel: [ 7878.946260] Buffer I/O error on device sdc2, logical block 12486944
2014-06-13T07:53:26.395624+05:00 suse kernel: [ 7878.946281] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.395626+05:00 suse kernel: [ 7878.946282] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.395628+05:00 suse kernel: [ 7878.946284] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.395629+05:00 suse kernel: [ 7878.946285] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.395634+05:00 suse kernel: [ 7878.946286] Read(10): 28 00 60 6d 69 00 00 00 08 00
2014-06-13T07:53:26.395636+05:00 suse kernel: [ 7878.946295] end_request: I/O error, dev sdc, sector 1617783040
2014-06-13T07:53:26.395637+05:00 suse kernel: [ 7878.946297] Buffer I/O error on device sdc2, logical block 12487200
2014-06-13T07:53:26.396515+05:00 suse kernel: [ 7878.946314] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.396522+05:00 suse kernel: [ 7878.946315] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.396524+05:00 suse kernel: [ 7878.946316] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.396527+05:00 suse kernel: [ 7878.946318] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.396529+05:00 suse kernel: [ 7878.946319] Read(10): 28 00 60 6d 79 00 00 00 08 00
2014-06-13T07:53:26.396531+05:00 suse kernel: [ 7878.946323] end_request: I/O error, dev sdc, sector 1617787136
2014-06-13T07:53:26.396533+05:00 suse kernel: [ 7878.946325] Buffer I/O error on device sdc2, logical block 12487712
2014-06-13T07:53:26.396534+05:00 suse kernel: [ 7878.946344] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.396536+05:00 suse kernel: [ 7878.946346] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.396538+05:00 suse kernel: [ 7878.946347] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.396540+05:00 suse kernel: [ 7878.946348] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.396542+05:00 suse kernel: [ 7878.946349] Read(10): 28 00 60 6d 99 00 00 00 08 00
2014-06-13T07:53:26.396544+05:00 suse kernel: [ 7878.946354] end_request: I/O error, dev sdc, sector 1617795328
2014-06-13T07:53:26.396546+05:00 suse kernel: [ 7878.946356] Buffer I/O error on device sdc2, logical block 12488736
2014-06-13T07:53:26.396548+05:00 suse kernel: [ 7878.946374] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.396550+05:00 suse kernel: [ 7878.946376] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.396552+05:00 suse kernel: [ 7878.946377] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
2014-06-13T07:53:26.396554+05:00 suse kernel: [ 7878.946379] sd 2:0:0:0: [sdc] CDB:
2014-06-13T07:53:26.396556+05:00 suse kernel: [ 7878.946379] Read(10): 28 00 60 6d d9 08 00 00 08 00
2014-06-13T07:53:26.396557+05:00 suse kernel: [ 7878.946401] sd 2:0:0:0: [sdc] Unhandled error code
2014-06-13T07:53:26.396560+05:00 suse kernel: [ 7878.946403] sd 2:0:0:0: [sdc]
2014-06-13T07:53:26.396561+05:00 suse kernel: [ 7878.946404] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
아쉽게도 어떤 블록/섹터에서 문제가 발생했는지 알 수 없어서 문제가 되는 부분을 건너뛰고 해당 지점부터 ddrescue를 다시 시작하면 됩니다. 이제 복구할 파일 목록을 나열하려고 할 때 testdisk에서도 같은 일이 발생합니다. 복사할 모든 파일을 힘들게 선택한 후 검사 중에 드라이브가 사라진 것 같아서 testdisk가 그 중 하나를 복사하지 못합니다.
이제 다음을 사용하여 ddrescue를 다시 시작했습니다.
ddrescue -n -v -T 30 -A --retrim -d -i 150G --skip-size=500k,10M --min-read-rate=50k /dev/sdc2 /media/rescue/Drive2.img /media/rescue/Drive2.log
하지만 확실히 드라이브가 사라지는 현상이 다시 반복되고 불완전하거나 거의 쓸모없는 이미지가 생성되기 때문에 이 문제를 일으키는 섹터를 건너뛰는 방법이나 데이터를 복구하기 위한 다른 트릭을 찾는 데 도움이 정말 필요합니다.