Repair method for western digital hard disk stalling fault
Technical Field
The invention relates to the technical field of information security, in particular to a method for repairing a stop-rotation fault of a Western digital hard disk.
Background
In the field of data recovery, defective storage media are often encountered; the important data is often invaluable to the user. When the hard disk fails to work normally due to disk knocking and stalling of the hard disk, the prior art generally performs disk opening detection, and adopts a physical repair scheme, namely a method for replacing a matched magnetic head, so as to achieve the purpose of repairing the hard disk. However, the time for searching the matching magnetic head is long, the cost for purchasing the matching magnetic head is generated, and the process of replacing the magnetic head is easy to cause 2 times of damage, thereby wasting financial resources, manpower and time.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a repair method for the stop-rotation fault of the Western digital hard disk, which can effectively solve the problems in the prior art.
A method for repairing a western digital hard disk stalling fault comprises the following steps:
s1: reading 0B and 20B modules in the ROM;
s2: s3 is performed if there is no 20B module and there is no "0 x 12020100" flag in 0B module, S4 is performed if there are 0B and 20B modules;
s3: recording "0 x 20" as a mask address, S6 is performed;
s4: judging the size of the value of 0x1B position in 0B and 20B, if 0B is larger than 20B, considering that the hard disk starts the UBA address of 01 module in 0B module, and extracting the UBA address of 01 module in 0B and 01 module length; otherwise, extracting the UBA address of the 01 module and the length of the 01 module in the 20B;
s5: setting the shielding address as the length of a module UBA address + 01;
s6: filling a shielding address in a module 30 of the hard disk;
s7: the checking 30 module fills the check value into the check bit and writes back the data to the ROM;
s8: when the hard disk is powered off and electrified, the hard disk is directly ready, does not stop rotating and can normally read the module 01;
s9: resolving the UBA address of the 12 modules from the 01 modules;
s10: setting a shielding address as UBA address +1 of the 12 modules;
s11: filling the shielding address in S10 in the module 30 of the hard disk;
s12: powering off and then powering on, and reading the module 01 again;
s13: erasing the 12 module information from the 01 map module, and modifying two bytes after the entry mark of the 12 module into 0x 0000;
s14: simultaneously restoring the modified 30 modules to the original form;
s15: and when the power is cut off from the starting point again, all modules can be normally accessed, important module information of COPY1 is extracted and written back to COPY0, and data in the hard disk can be extracted at the moment.
Preferably, the specific steps of obtaining the 01 module UBA address and the 01 module length in S4 are as follows:
s41: search for the entry tag "0 x 12020100" or "0 x1a 020100" for module No. 01, and find module length 01; if "0 x 12020100" is found, then S42 is executed, and if "0 x1a 020100" is found, then S43 is executed;
s42: shifting 6 bytes after the entry mark, taking 4 bytes as a group of the following 8 bytes, judging whether the values of the two groups are the same, if so, executing S5, and if not, ending;
s43: shifting 6 bytes after the entry mark, grouping the next 16 bytes by 4 bytes, firstly judging whether the values of the first two groups are both '0 x 00000000', if yes, executing S44; if not, go to S45;
s44: judging whether the values of the two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S5; if not, ending;
s45: judging whether the values of the first two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S5; if not, the process is finished.
Preferably, S6 and S11 specifically include the steps of:
s61: finding 30 total numbers of module defect entries and recording;
s62: adding 1 to the total number of the defect entries in the 30 modules;
s63: performing S64 if the total number of defect entries of the 30 blocks is 0, and performing S65 if it is greater than 0;
s64: 30 module and padding the mask address to 0x40 to 0x 43;
s65: judging whether the original defect entry address in the module 30 is larger than the mask address, if so, executing S66, and if not, executing S67;
s66: taking original defect entries, counting the number of the original defect entries by +1, filling the original defect entries into the last 8 bytes of the original address, filling 0x01000000 into the positions 0x3C to 0x3F, filling the mask address into the positions 0x40 to 0x43, and executing S7;
s67: the number of original defect entries +1 and the mask address are filled 8 bytes after the original defect entry, and S7 is performed.
Preferably, the specific steps of obtaining the UBA address of the 12 modules in S9 are as follows:
s91: an entry mark "0 x 120212000" or "0 x1a 021200" of module No. 12 is searched; executing S92 if "0 x 120212000" is found, executing S93 if "0 x1A 021200" is found;
s92: shifting 6 bytes after the entry mark, taking 4 bytes as a group of the following 8 bytes, judging whether the values of the two groups are the same, if so, executing S5, and if not, ending;
s93: shifting 6 bytes after the entry mark, grouping the next 16 bytes by 4 bytes, firstly judging whether the values of the first two groups are both '0 x 00000000', if yes, executing S94; if not, go to S95;
s94: judging whether the values of the two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S10; if not, ending;
s95: judging whether the values of the first two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S10; if not, the process is finished.
Compared with the prior art, the invention has the advantages that: the hard disk can be repaired and the hard disk data can be extracted without disassembling the hard disk replacing component, and the problems of hard disk fault expansion, secondary damage to the hard disk, even complete damage to the hard disk and the like caused by human factors in the replacing operation are avoided.
Drawings
FIG. 1 is a diagram of a data structure of a module 20B according to an embodiment of the present invention;
FIG. 2 is a diagram of a data structure of a module 0B according to an embodiment of the present invention;
FIG. 3 is a diagram of a data structure of 30 modules with a total number of defect entries of 0 according to an embodiment of the present invention;
FIG. 4 is a block diagram of the data structure of the module 30 of FIG. 3 with a mask entry added;
FIG. 5 is a diagram of a data structure of 30 modules with a total number of defect entries not equal to 0 and a UBA address greater than a mask address according to an embodiment of the present invention;
FIG. 6 is a block diagram of the data structure of the module 30 after adding a mask entry in FIG. 5;
FIG. 7 is a block diagram of a 30-module data structure with total number of defect entries not equal to 0 and UBA addresses smaller than mask addresses according to an embodiment of the present invention;
FIG. 8 is a block diagram of the data structure of the module 30 after the mask entry is added to FIG. 7;
FIG. 9 is a data structure diagram of a module according to embodiment 12 of the present invention;
fig. 10 is a diagram of the data structure of fig. 9 after erasing 12 the module.
Detailed Description
For the purposes of the present invention: technical solutions and advantages of the present invention will be more clearly understood from the following detailed description of the present invention.
A method for repairing a western digital hard disk stalling fault comprises the following steps:
s1: reading 0B and 20B modules in the ROM;
s2: s3 is performed if there is no 20B module and there is no "0 x 12020100" flag in 0B module, S4 is performed if there are 0B and 20B modules;
s3: recording "0 x 20" as a mask address, S6 is performed;
s4: judging the size of the address values of 0B and 20B, if 0B is larger than 20B, considering that the hard disk starts the UBA address of the 01 module in the 0B module, and extracting the UBA address of the 01 module in the 0B and the length of the 01 module; otherwise, extracting the UBA address of the 01 module and the length of the 01 module in the 20B;
the specific steps of obtaining the 01 module UBA address and the 01 module length in S4 are as follows:
s41: search for the entry tag "0 x 12020100" or "0 x1a 020100" for module No. 01, and find the module length of 01 (the length of module 01 is two bytes after the entry tag); if "0 x 12020100" is found, then S42 is executed, and if "0 x1a 020100" is found, then S43 is executed;
s42: shifting 6 bytes after the entry mark, taking 4 bytes as a group of the following 8 bytes, judging whether the values of the two groups are the same, if so, executing S5, and if not, ending;
s43: shifting 6 bytes after the entry mark, grouping the next 16 bytes by 4 bytes, firstly judging whether the values of the first two groups are both '0 x 00000000', if yes, executing S44; if not, go to S45;
s44: judging whether the values of the two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S5; if not, ending;
s45: judging whether the values of the first two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S5; if not, the process is finished.
As shown in fig. 1 and 2, if the value of 20B in fig. 1 is greater than the value of 0B in fig. 2, the UBA address "0 x0002FAE 6" and 01 block length "0 x 18" of the block 01 of 20B are taken.
S5: setting the shielding address as the length of a module UBA address + 01;
s6: filling a shielding address in a module 30 of the hard disk;
s6 specifically includes the following steps:
s61: find 30 module defect entry total and record (7 byte bit defect entry total between value of 30 module 0x28 position and 0x34 to 0x 3C);
s62: the total number of defect entries in the 30 blocks plus 1 (both the value of the 0x28 position and the value of 7 bytes between 0x34 and 0x3C are + 1);
s63: performing S64 if the total number of defect entries of the 30 blocks is 0, and performing S65 if it is greater than 0;
s64: a value of +1 (current number of UBA defect entries +1) at the 0x3C to 0x3F positions of the 30 module and padding the mask address to 0x40 to 0x 43;
as shown in fig. 3, if the original defect entry total number is 0, the defect entry total number is changed to 1 and the mask address "0 x000262C 7" is filled, as shown in fig. 4;
s65: judging whether the original defect entry address (the value of the position 0x40 to 0x 43) in the module 30 is larger than the mask address, if so, executing S66, and if not, executing S67;
s66: taking original defect entries (values from 0x3C to 0x43 positions), filling the original defect entries with the number of +1, into the last 8 bytes of the original address, filling 0x01000000 into the positions from 0x3C to 0x3F, filling the masked addresses into the positions from 0x40 to 0x43, and executing S7;
as shown in fig. 5 and 6, the original defect entry address "0 x000362C 7" is greater than the mask address "0 x000262C 7"; the mask address is added as in fig. 6.
S67: s7 is performed by filling the original defect entry number +1 and the mask address 8 bytes after the original defect entry (position 0x3C to 0x 43).
As shown in fig. 7 and 8, the original defect entry address "0 x000200C 7" is smaller than the mask address "0 x000262C 7"; the mask address is added as in fig. 8.
S7: checking the 30 module, filling check bits (0x0C to 0x0F positions) with check values, and writing back data to the ROM;
s8: when the hard disk is powered off and electrified, the hard disk is directly ready, does not stop rotating and can normally read the module 01;
s9: as shown in fig. 9, the UBA address of 12 blocks "0 x 00013545" is resolved from 01 blocks;
the specific steps of obtaining the UBA address of the 12 modules in S9 are as follows:
s91: an entry mark "0 x 120212000" or "0 x1a 021200" of module No. 12 is searched; executing S92 if "0 x 120212000" is found, executing S93 if "0 x1A 021200" is found;
s92: shifting 6 bytes after the entry mark, taking 4 bytes as a group of the following 8 bytes, judging whether the values of the two groups are the same, if so, executing S5, and if not, ending;
s93: shifting 6 bytes after the entry mark, grouping the next 16 bytes by 4 bytes, firstly judging whether the values of the first two groups are both '0 x 00000000', if yes, executing S94; if not, go to S95;
s94: judging whether the values of the two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S10; if not, ending;
s95: judging whether the values of the first two groups are the same, if so, indicating that the two groups are UBA addresses, and executing S10; if not, the process is finished.
S10: setting a shielding address as UBA address +1 of the 12 modules;
s11: filling the shielding address in S10 in the module 30 of the hard disk in the same way as S6;
s12: powering off and then powering on, and reading the module 01 again;
s13: as shown in fig. 10, the 12 module information is erased from the 01 map module, and the two bytes after the entry mark of the 12 module are modified to 0x 0000;
s14: simultaneously restoring the modified 30 modules to the original form;
s15: and when the power is cut off from the starting point again, all modules can be normally accessed, important module information of COPY1 is extracted and written back to COPY0, and data in the hard disk can be extracted at the moment.
It will be appreciated by those of ordinary skill in the art that the examples described herein are intended to assist the reader in understanding the manner in which the invention is practiced, and it is to be understood that the scope of the invention is not limited to such specifically recited statements and examples. Those skilled in the art can make various other specific changes and combinations based on the teachings of the present invention without departing from the spirit of the invention, and these changes and combinations are within the scope of the invention.