一種修復(fù)三星硬盤無法訪問數(shù)據(jù)區(qū)的方法
【技術(shù)領(lǐng)域】
[0001] 本發(fā)明涉及信息安全技術(shù)領(lǐng)域,特別涉及一種修復(fù)三星硬盤無法訪問數(shù)據(jù)區(qū)的方 法。
【背景技術(shù)】
[0002] 隨著大數(shù)據(jù)時(shí)代的到來,數(shù)據(jù)存儲(chǔ)越來越繁重密集。幾乎所有的數(shù)據(jù)存儲(chǔ)都會(huì)使 用到硬盤。長(zhǎng)時(shí)間、高頻率的使用會(huì)使硬盤的使用壽命降低,或者發(fā)生不可預(yù)知的故障。一 旦發(fā)生硬盤故障,不論是個(gè)人,還是企業(yè)都將會(huì)受到不可估量的損失。三星品牌硬盤容易出 現(xiàn)狀態(tài)忙,就緒但無法訪問數(shù)據(jù)區(qū)的情況,三星硬盤固件出現(xiàn)異常,導(dǎo)致無法訪問數(shù)據(jù)區(qū)的 數(shù)據(jù)恢復(fù)方法。目前,還沒有一種技術(shù)可以解決這個(gè)問題。
【發(fā)明內(nèi)容】
[0003] 本發(fā)明針對(duì)現(xiàn)有技術(shù)的缺陷,提供了一種修復(fù)三星硬盤無法訪問數(shù)據(jù)區(qū)的方法, 能有效的解決上述現(xiàn)有技術(shù)存在的問題。
[0004] 為了實(shí)現(xiàn)以上發(fā)明目的,本發(fā)明采取的技術(shù)方案如下:
[0005] -種修復(fù)三星硬盤無法訪問數(shù)據(jù)區(qū)的方法,步驟包括修復(fù)硬盤,清除SMART表,清 除A表;
[0006] 所述修復(fù)硬盤的具體步驟如下:
[0007] SlOl :讀取數(shù)據(jù)到buffer,判斷硬盤是否為ENG模式,是則執(zhí)行轉(zhuǎn)到S103,否則執(zhí) 行 S102 ;
[0008] 調(diào)用函數(shù):" IRQ_READ_UART0 () " "checkENG () " ;
[0009] S102 :進(jìn)入 ENG 模式;
[0010] 調(diào)用函數(shù):"UARTO_Sendchar (OxOA, OxOD) " ;
[0011] S103 :進(jìn)入ENG模式,執(zhí)行指令"LE"修復(fù)硬盤,并等待硬盤電機(jī)起轉(zhuǎn)就緒;
[0012] 調(diào)用函數(shù):"UARTO_Sendchar (OxOA, OxOD) " "UARTO_SendBufT'LE") "。
[0013] 所述清除SMART表的具體步驟如下:
[0014] S201 :判斷硬盤狀態(tài)是否就緒,是則執(zhí)行S202,否則退出;
[0015] S202 :打開硬盤訪問權(quán)限;
[0016] S203 :發(fā)送 smat 指令響應(yīng),寫入 smart 數(shù)據(jù) "D0C_USBREADRAM(8, integer (@ buff),10000, 3) " ;
[0017] S204 :發(fā)送smat指令響應(yīng),并等待硬盤接收數(shù)據(jù);
[0018] S205 :重置smart數(shù)據(jù)源,恢復(fù)smart為出廠設(shè)置,并等待硬盤接收數(shù)據(jù)。
[0019] 作為優(yōu)選,所述清除A表的具體步驟如下:
[0020] S301 :判斷硬盤狀態(tài)是否就緒,是則執(zhí)行S202,否則退出;
[0021] S302 :備份A表模塊,將A表模塊備份至安全目錄;
[0022] S303 :初始化A表,清除A表。
[0023] 與現(xiàn)有技術(shù)相比本發(fā)明的優(yōu)點(diǎn)在于:可修復(fù)三星硬盤因缺陷表所引起的不認(rèn)盤的 錯(cuò)誤,可清除SMART表,可清除A表,解決了目前三星硬盤無法訪問數(shù)據(jù)區(qū)的問題,硬盤恢復(fù) 成功率高,有效降低因硬盤損壞帶來的損失。
【具體實(shí)施方式】
[0024] 為使本發(fā)明的目的、技術(shù)方案及優(yōu)點(diǎn)更加清楚明白,以下舉實(shí)施例,對(duì)本發(fā)明做進(jìn) 一步詳細(xì)說明。
[0025] 一種修復(fù)三星硬盤無法訪問數(shù)據(jù)區(qū)的方法,步驟包括修復(fù)硬盤,清除SMART表,清 除A表;
[0026] 所述修復(fù)硬盤的具體步驟如下:
[0027] SlOl :讀取數(shù)據(jù)到buffer,判斷硬盤是否為ENG模式,是則執(zhí)行轉(zhuǎn)到S103,否則執(zhí) 行 S102 ;
[0028] 調(diào)用函數(shù):" IRQ_READ_UART0 () " "checkENG () " ;
[0029] S102 :進(jìn)入 ENG 模式;
[0030] 調(diào)用函數(shù):" UARTO_Sendchar (OxOA, OxOD) " ;
[0031] S103 :進(jìn)入ENG模式,執(zhí)行指令"LE"修復(fù)硬盤,并等待硬盤電機(jī)起轉(zhuǎn)就緒;
[0032] 調(diào)用函數(shù):"UARTO_Sendchar (OxOA, OxOD) " "UART0_SendBuf ("LE") "。
[0033] 所述清除SMART表的具體步驟如下:
[0034] S201 :判斷硬盤狀態(tài)是否就緒,是則執(zhí)行S202,否則退出;
[0035] S202 :打開硬盤訪問權(quán)限;
[0036] S203 :發(fā)送smat指令響應(yīng),寫入smart數(shù)據(jù)
[0037] 調(diào)用函數(shù):
[0038] "DOCJJSBREADRAM (8, integer (Obuff),10000, 3) " ;
[0039] S204 :發(fā)送smat指令響應(yīng),并等待硬盤接收數(shù)據(jù);
[0040] S205 :重置smart數(shù)據(jù)源,恢復(fù)smart為出廠設(shè)置,并等待硬盤接收數(shù)據(jù)。
[0041] 清除SMART表需要執(zhí)行以下代碼:
[0042] procedure resetSmart ;stdcal1 ;
[0043] var buff: array [0. . 10240] of byte ;
[0044] hddsn: string ;
[0045] XXj pos: integer ;
[0046] pwd:byte ;
[0047] begin
[0048] for pwd: = $15 to$16 do
[0049] begin
[0050] MAXT0R_SENDCMD($A1,pwd,0, 0, 10000) ;// 打開硬盤訪問權(quán)限
[0051] sleep (100);
[0052] MAXTOR-SENDCMDALL
[0053] ($51, $01, $00, $24, $08, $01, $00, $00, $A0, $9a, 0, 0, 0, 0, 0, 0, 1000);
[0054] MAXTOR-SENDCMDALL
[0055] ($53, $00, $00, $08, $08, $01,$00, $00, $A0, $9a,0, 0, 0, 0, 0, 0, 1000) ;// 發(fā)送 smat指令響應(yīng)
[0056] DOCJJSBREADRAM (8, integer (Obuff),10000, 3) ;// 寫入 smart 數(shù)據(jù)
[0057] MAXTOR_SENDCMDALL
[0058] ($A2, $bl,$00, $00, $0, $00, $00, $00, $A0, $00, 0, 0, 0, 0, 0, 0, 1000);發(fā)送 smat 指 令響應(yīng)
[0059] sleep (1000) ;//等待硬盤接收數(shù)據(jù)
[0060] MAXTOR_SENDCMDALL
[0061] ($A2, $b0, $00, $00, $0, $00, $00, $00, $00, $00, 0, 0, 0, 0, 0, 0, 1000) ;// 重置 smart數(shù)據(jù)源
[0062] MAXTOR_SENDCMDALL
[0063] ($A2, $b0, $00, $00, $0, $00, $00, $00, $00, $00, 0, 0, 0, 0, 0, 0, 1000) ;// 恢復(fù) smart為出廠設(shè)置
[0064] sleep (1000) ;//等待硬盤接收數(shù)據(jù)
[0065] end ;
[0066] showmessage (F3M[24]);
[0067] end ;
[0068] 作為優(yōu)選,所述清除A表的具體步驟如下:
[0069] S301 :判斷硬盤狀態(tài)是否就緒,是則執(zhí)行S202,否則退出;
[0070] S302 :備份A表模塊,將A表模塊備份至安全目錄;
[0071] S303 :初始化A表,清除A表。
[0072] 所述S303需要執(zhí)行以下代碼:
[0073] procedure clearAlistO ;stdcall ;
[0074] var
[0075] s: word ;
[0076] buff: array [0. . $200] of byte ;
[0077] begin
[0078] s: = READST (6);
[0079] MAXT0R_SENDCMDALL
[0080] ($51,$01,$00, $00, $00, $01,$00, $00, $00, $A0, $ec,0, 0, 0, 0, 0, 1000) ;// 初始 化A表
[0081] s: = READST (6);
[0082] if(s<>$50)then
[0083] sleep(100);
[0084] MAXT0R_SENDCMDALL
[0085] ($52, $01, $00, $00, $01, $00, $00, $00, $00, $A0, $C0, $00, $00, $00, $00, $00 ;,1000) ;// 清除 A 表
[0086] sleep (100);
[0087] s: = READST (6);
[0088] if(s<>$50)then
[0089] begin
[0090] sleep (100);
[0091] end ;
[0092] MAXTOR_SENDCMDALL//
[0093] ($52, $01, $00, $00, $02, $00, $f8, $ba, $2e, $A0, $C0, $00, $00, $ cd, $00, $00, 1000);
[0094] sleep (100);
[0095] s: = READST (6);
[0096] if (s<>$50)then
[0097] begin
[0098] sleep (100);
[0099] end ;
[0100] MAXTOR_SENDCMDALL
[0101] ($52, $01, $00, $00, $03, $00, $c0, $cd, $f2, $A0, $C0, $00, $00, $79, $00, $00, 1000);
[0102] sleep(100);
[0103] s: = READST (6);
[0104] {MAXT0R_SENDCMDALL($51, $01, $00, $00, $00, $01, $00, $00, $00, $A0, $ EC, 0, 0, 0, 0, 0, 1000) ;}
[0105] s: = READST (6);
[0106] if (s<>$50) then
[0107] begin
[0108] sleep(100);
[0109] end ;
[0110] MAXTOR_SENDCMDALL
[0111] ($51, $01, $00, $00, $24, $03, $01, $00, $00, $A0, $9a, 0, 0, 0, 0, 0, 1000);
[0112] sleep(1000);
[0113] s: = READST (6);
[0114] if (s<>$50) then
[0115] begin
[0116] sleep (100);
[0117] end ;
[0118] if (s = $50) then
[0119] begin
[0120] showmessage (F3M[24]);
[0121] exit ;
[0122] end ;
[0123] s: = READST (6);
[0124] {MAXT0R_SENDCMDALL($51, $01, $00, $00, $00, $01, $00, $00, $00, $A0, $ ec, 0, 0, 0, 0, 0, 1000) ;}
[0125] sleep (100);
[0126] MAXTOR_SENDCMDALL
[0127] ($52, $01, $00, $00, $01, $00, $00, $00, $00, $A0, $C0, $00, $00, $00, $00, $00, 1000);
[0128] sleep (100);
[0129] s: = READST (6);
[0130] if(s<>$50)then
[0131] begin
[0132] sleep (100);
[0133] end ;
[0134] MAXTOR_SENDCMDALL
[0135] ($52, $01, $00, $00, $02, $00, $f8, $ba, $2e, $A0, $C0, $00, $00, $ cd, $00, $00, 1000);
[0136] sleep (100);
[0137] s: = READST (6);
[0138] if(s<>$50)then
[0139] begin
[0140] sleep (100);
[0141] end ;
[0142] MAXTOR_SENDCMDALL
[0143] ($52, $01, $00, $00, $02, $00, $f8, $ba, $2e, $A0, $C0, $00, $00, $ cd, $00, $00, 1000);
[0144] sleep (100);
[0145] s: = READST (6);
[0146] if (s<>$50) then
[0147] begin
[0148] sleep (100);
[0149] end ;
[0150] MAXTOR_SENDCMDALL
[0151] ($52, $01, $00, $00, $02, $00, $f8, $ba, $2e, $A0, $C0, $00, $00, $ cd, $00, $00, 1000);
[0152] sleep(100);
[0153] s: = READST (6);
[0154] if (s<>$50) then
[0155] begin
[0156] sleep (100);
[0157] end ;
[0158] {MAXT0R_SENDCMDALL($51, $01, $00, $00, $00, $01, $00, $00, $00, $A0, $ EC, 0, 0, 0, 0, 0, 1000) ;}
[0159] sleep (100);
[0160] MAXT0R_SENDCMDALL($51, $01, $00, $00, $24, $03, $01, $00, $00, $A0, $ 9a, 0, 0, 0, 0, 0, 1000);
[0161] sleep (100);
[0162] s: = READST (6);
[0163] if (s = $50) then
[0164] begin
[0165] showmessage (F3M[24]);
[0166] exit ;
[0167] end ;
[0168] s: = READST (6);
[0169] {MAXT0R_SENDCMDALL($51, $01, $00, $00, $00, $01, $00, $00, $00, $A0, $ EC, 0, 0, 0, 0, 0, 1000) ;}
[0170] sleep (100);
[0171] MAXT0R_SENDCMDALL($51, $01, $00, $00, $24, $03, $01, $00, $00, $A0, $ 9a, 0, 0, 0, 0, 0, 1000);
[0172] sleep (100);
[0173] s: = READST (6);
[0174] if (s = $50) then
[0175] begin
[0176] showmessage(F3M[24]);
[0177] exit ;
[0178] end ;
[0179] s: = READST (6);
[0180] MAXTOR_SENDCMDALL
[0181] ($52, $01, $00, $00, $02, $00, $F8, $ba, $2e, $A0, $C0, $00, $00, $ cd, $00, $00, 1000);
[0182] s: = READST (6);
[0183]