CN110209519A - A kind of Bad Track scan method, system, device and computer memory device - Google Patents
A kind of Bad Track scan method, system, device and computer memory device Download PDFInfo
- Publication number
- CN110209519A CN110209519A CN201910476872.8A CN201910476872A CN110209519A CN 110209519 A CN110209519 A CN 110209519A CN 201910476872 A CN201910476872 A CN 201910476872A CN 110209519 A CN110209519 A CN 110209519A
- Authority
- CN
- China
- Prior art keywords
- block
- layer
- trouble
- scan
- scanning
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0727—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B5/00—Recording by magnetisation or demagnetisation of a record carrier; Reproducing by magnetic means; Record carriers therefor
- G11B5/48—Disposition or mounting of heads or head supports relative to record carriers ; arrangements of heads, e.g. for scanning the record carrier to increase the relative speed
- G11B5/58—Disposition or mounting of heads or head supports relative to record carriers ; arrangements of heads, e.g. for scanning the record carrier to increase the relative speed with provision for moving the head for the purpose of maintaining alignment of the head relative to the record carrier during transducing operation, e.g. to compensate for surface irregularities of the latter or for track following
- G11B5/596—Disposition or mounting of heads or head supports relative to record carriers ; arrangements of heads, e.g. for scanning the record carrier to increase the relative speed with provision for moving the head for the purpose of maintaining alignment of the head relative to the record carrier during transducing operation, e.g. to compensate for surface irregularities of the latter or for track following for track following on disks
Abstract
The invention discloses a kind of Bad Track scan methods, the block of first layer in disk is scanned first, when the block of first layer is Fisrt fault block, enter back into the second layer, more fine-grained object block corresponding to Fisrt fault block is scanned, it determines the second trouble block therein, otherwise continues to scan on the block of first layer.Therefore, this programme first carries out coarseness scanning to disk, scan the block of first layer, as the block of first layer breaks down, fine granularity scanning is carried out to the block of the first layer again, the second layer is jumped into, determines object block corresponding with the block of the first layer of failure in the second layer, object block is scanned and determines trouble block therein.Coarseness scanning can save the sweep time to trouble-free piece, and fine granularity scanning can increase the accuracy of trouble block again, both improved scan full hard disk rate, and in turn ensured the accuracy of scanning result.
Description
Technical field
The present invention relates to disk detection techniques, more specifically to a kind of Bad Track scan method, system, device
And computer readable storage medium.
Background technique
Disk various problem may occur using long, and Bad Track is one of the most common problem.
After bad track occurs in disk, the risk that operation system cannot well be run can be increased and therefore require disk in operation system
The mechanism of bad track Scanning Detction.
Currently, in order to not influence the normal use of operation system, it will usually be carried out by the way of offline to Bad Track
Detection.When operation system is closed or disk is detached from operation system, disk is scanned.Scanning is usually pressed from the beginning to the end
Disk is scanned according to certain scanning block size, scanning block is the granularity scanned.It is exactly fine granularity when scanning block is smaller
Scanning is exactly coarseness scanning when scanning block is larger.
When carrying out fine granularity scanning to disk, the accuracy of scanning result can be higher, but the scan full hard disk time can be non-
Chang Duo;Sweep speed can be accelerated by carrying out coarseness scanning to disk, reduce sweep time, but the accuracy of scanning result is again
It can have a greatly reduced quality.
Therefore, the accuracy of disk scanning result how had not only been guaranteed but also scan full hard disk rate can be improved, and be art technology
Personnel's problem to be solved.
Summary of the invention
The purpose of the present invention is to provide a kind of Bad Track scan method, system, device and computer-readable storage mediums
Matter, to solve the problems, such as to guarantee disk scanning result and scan full hard disk rate simultaneously in the prior art.
To achieve the above object, the embodiment of the invention provides following technical solutions:
A kind of Bad Track scan method, comprising:
The block for scanning first layer in disk to be detected judges whether the block of the first layer of Current Scan is Fisrt fault
Block;The block of the first layer is the block divided in advance to the disk to be detected;
If so, determining the object block that the Fisrt fault block includes in the block of the second layer, the object block is carried out
Scanning determines the second trouble block in the object block;Wherein, the block of the second layer is in advance to each of described first layer
The block that block is divided, the block fine granularity of the second layer are higher than the block of the first layer.
Optionally, after whether the block of the first layer for judging Current Scan is Fisrt fault block, further includes:
If it is not, then continuing to scan on other blocks of first layer.
Optionally, before described other blocks for continuing to scan on first layer, further includes:
Whether the byte number of the block for the first layer that judgement has currently scanned is greater than or equal to the capacity of the disk to be detected;
If it is not, the step of continuing to scan on other blocks of the first layer described in then executing;
If so, stopping scanning.
Optionally, the object block that the Fisrt fault block is determined in the block of the second layer and includes, to the object block
It is scanned, in the object block after determining second trouble block, further includes:
Judge second trouble block whether be the bottom trouble block;
If so, recording the information of second trouble block;
If it is not, the lower failure block group of second trouble block is then scanned, until second trouble block pair is completed in scanning
The trouble block for the bottom answered records the information of the trouble block of the corresponding bottom of second trouble block;Every layer of lower layer
Trouble block group is the chunking divided in advance to upper one layer of trouble block.
Optionally, the block for scanning first layer in disk to be detected, judges that the block of the first layer of Current Scan is
No is Fisrt fault block, comprising: the block that first layer in disk to be detected is scanned using the first algorithm judges the described of Current Scan
Whether the block of first layer is Fisrt fault block;
The object block for determining the Fisrt fault block in the block of the second layer and including, sweeps the object block
It retouches, the second trouble block is determined in the object block, comprising: determine the mesh that the Fisrt fault block includes in the block of the second layer
Block is marked, the object block is scanned using the second algorithm, the second trouble block is determined in the object block;
Wherein, the accuracy of second algorithm is higher than the accuracy of first algorithm.
Optionally, the block of the first layer is the block divided according to the first specification to the disk to be detected,
In the block of the first layer, last blocks of specification is the remainder result of disk size and the first specification;
The block of the second layer is the block divided according to block of second specification to each first layer, corresponding
In the block of all second layers of one first layer block, last blocks of specification is the remainder of disk size and the second specification
As a result, second specification is less than first specification.
Optionally, described that object block corresponding with the Fisrt fault block is determined in the block of the second layer, to the target
Block is scanned, in the object block after determining second trouble block, further includes:
Record the disc information to be detected, the second trouble block banner word joint number, the second failure block length, institute
State the failure serial number of the second trouble block.
To achieve the above object, present invention also provides a kind of Bad Track scanning systems, comprising:
First scan module judges the first layer of Current Scan for scanning the block of first layer in disk to be detected
Block whether be Fisrt fault block;The block of the first layer is the block divided in advance to the disk to be detected;
Second scan module, when the block of the first layer for Current Scan is Fisrt fault block, in the block of the second layer
The object block that the middle determination Fisrt fault block includes, is scanned the object block, and second is determined in the object block
Trouble block;Wherein, the block of the second layer is the block divided in advance to each of described first layer piece, described second
The block fine granularity of layer is higher than the block of the first layer.
Optionally, further includes:
When the block of third scan module, the first layer for Current Scan is not Fisrt fault block, institute is continued to scan on
State the block of first layer.
Optionally, further includes:
First judgment module, before the block for continuing to scan on the first layer, first layer that judgement has currently scanned
Whether the byte number of block is greater than or equal to the capacity of the disk to be detected;If it is not, continuing to scan on described first described in then executing
The step of block of layer;If so, stopping scanning.
Optionally, further includes:
Second judgment module, for judge second trouble block whether be the bottom trouble block;
First information logging modle, for second trouble block be the bottom trouble block when, record it is described second therefore
Hinder the information of block;
When second information logging modle for second trouble block is not the trouble block of the bottom, scanning described second
The lower failure block group of trouble block, until the trouble block for completing the corresponding bottom of second trouble block is scanned, described in record
The information of the trouble block of the corresponding bottom of second trouble block;Every layer of lower failure block group is in advance to upper one layer of failure
The chunking that block is divided.
Optionally, first scan module is specifically used for scanning first layer in disk to be detected using the first algorithm
Block judges whether the block of the first layer of Current Scan is Fisrt fault block;
Second scan module is specifically used for determining target corresponding with the Fisrt fault block in the block of the second layer
Block is scanned the object block using the second algorithm, and the second trouble block is determined in the object block;
Wherein, the accuracy of second algorithm is higher than the accuracy of first algorithm.
Optionally, the system also includes:
Third judgment module, before the block for continuing to scan on the first layer, first layer that judgement has currently scanned
Whether the byte number of block is greater than or equal to the specification of the disk to be detected, and second specification is less than first specification;If
It is no, then execute described in the step of continuing to scan on the block of the first layer;If so, stopping scanning.
Optionally, further includes:
Second logging modle, for determining object block corresponding with the Fisrt fault block in the block of the second layer, to institute
It states object block to be scanned, after determining the second trouble block in the object block, records the disc information to be detected, described
Second trouble block banner word joint number, the second failure block length, the failure serial number of second trouble block.
To achieve the above object, the application also provides a kind of Bad Track scanning means, comprising:
Memory, for storing computer program;
Processor realizes the step of the Bad Track scan method as described in any one when for executing the computer program
Suddenly.
To achieve the above object, the application also provides a kind of computer readable storage medium, the computer-readable storage
It is stored with computer program on medium, realizes that the Bad Track as described in any one is swept when the computer program is executed by processor
The step of retouching method.
By above scheme it is found that a kind of Bad Track scan method provided by the invention, comprising: scan disk to be detected
The block of middle first layer judges whether the block of the first layer of Current Scan is Fisrt fault block;The block of the first layer is pre-
The block that first disk to be detected is divided;If so, determining the Fisrt fault block packet in the block of the second layer
The object block contained is scanned the object block, and the second trouble block is determined in the object block;Wherein, the second layer
Block be the block divided in advance to each of described first layer piece;If it is not, the block of the first layer is then continued to scan on,
The block fine granularity of the second layer is higher than the block of the first layer.
It can be seen that a kind of Bad Track scan method provided by the invention, the block of first layer first in scanning disk, when
When the block of first layer is Fisrt fault block, the second layer is entered back into, more fine-grained object block corresponding to Fisrt fault block carries out
Scanning, determines the second trouble block therein, otherwise continues to scan on the block of first layer.Therefore, this programme first carries out coarse grain to disk
Degree scanning, that is, scan the block of first layer, as the block of first layer breaks down, then carries out fine granularity scanning to the block of the first layer,
The second layer is jumped into, object block corresponding with the block of the first layer of failure is determined in the second layer, object block is scanned really
Fixed trouble block therein.Coarseness scanning can save the sweep time to trouble-free piece, and fine granularity scanning can increase again
The accuracy of trouble block had both improved scan full hard disk rate, in turn ensured the accuracy of scanning result.The present invention also provides one kind
Bad Track scanning system, device and calculating street readable storage medium storing program for executing, equally may be implemented said effect.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of Bad Track scan method flow chart disclosed by the embodiments of the present invention;
Fig. 2 is a kind of specific Bad Track scan method flow chart disclosed by the embodiments of the present invention;
Fig. 3 is a kind of specific Bad Track scan method flow chart disclosed by the embodiments of the present invention;
Fig. 4 is a kind of specific Bad Track scan method flow chart disclosed by the embodiments of the present invention;
Fig. 5 is a kind of Bad Track scanning system structural schematic diagram disclosed by the embodiments of the present invention;
Fig. 6 is a kind of Bad Track scanning means structural schematic diagram disclosed by the embodiments of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of Bad Track scan method, system, device and computer readable storage medium,
To solve the problems, such as to guarantee disk scanning result and scan full hard disk rate simultaneously in the prior art.
Referring to Fig. 1, a kind of Bad Track scan method provided in an embodiment of the present invention is specifically included:
S101 scans the block of first layer in disk to be detected, judges whether the block of the first layer of Current Scan is
One trouble block;The block of the first layer is the block divided in advance to the disk to be detected.
It in the present solution, need to divide disk, is different from the prior art, this programme divides at least same disk
Two kinds of scanning blocks, a kind of scanning block are one layer.First layer is the block directly divided to disk, and the second layer is to each
The block that the block of first layer is divided.
For example, disk size is 500MB (million), directly disk is divided first, obtains 10 blocks, each piece is
50MB, the block of this 10 50MB are exactly the block of the first layer in this programme.It is further to the block of this 10 50MB to be divided, such as
The block of one 50MB is divided, the block of 10 5MB is obtained, the block of this 10 5MB is exactly the block of the second layer, and and first layer
A 50MB block it is corresponding.
Scanning when, first scanning disk in first layer block, judge Current Scan to first layer block whether be therefore
Hinder block, to distinguish trouble block described below, trouble block is as Fisrt fault block herein.
S102, if so, the object block that the Fisrt fault block includes is determined in the block of the second layer, to the object block
It is scanned, the second trouble block is determined in the object block;Wherein, the block of the second layer is in advance to the first layer
The each piece of block divided, the block fine granularity of the second layer are higher than the block of the first layer.
If currently Fisrt fault block is arrived in scanning in the block of first layer, the second layer is jumped into, in the block of the second layer
It determines the object block that Fisrt fault block includes, trouble block is determined in all object blocks, trouble block is as the second trouble block herein.
It should be noted that Fisrt fault block is the block of failure in the block of first layer, the second trouble block is the block of the second layer
The block of middle failure, since the block of the second layer is more fine-grained piece divided in advance to the block of first layer, the
Two trouble blocks are the more fine-grained trouble block of corresponding Fisrt fault block.
That is, in the present solution, first coarseness scanning, the i.e. block of scanning first layer are carried out to disk, such as first layer
Block breaks down, then carries out fine granularity scanning to the block of the first layer, that is, jumps into the second layer, determines the of failure in the second layer
The object block that one layer of block is included is scanned object block and determines trouble block therein.
In order to which Bad Track is accurately positioned and facilitates the subsequent maintenance to bad track, in a specific embodiment,
The object block that the Fisrt fault block includes is determined in the block of the second layer, the object block is scanned, in the target
In block after determining second trouble block, further includes:
Record the disc information to be detected, the second trouble block banner word joint number, the second failure block length, institute
State the failure serial number of the second trouble block.
It should be noted that the banner word joint number of the second trouble block is it can be appreciated that the second trouble block is inclined in disk
It moves, by the length of banner word joint number and the second trouble block, the trouble block can be navigated in disk, namely navigate to bad
Road.
In a specific embodiment, if Current Scan to the block of first layer be not trouble block, can hold
Row S103 continues coarseness scanning, that is, continues to scan on the block of first layer.
S103, if it is not, then continuing to scan on the block of the first layer.
It can be seen that a kind of Bad Track scan method provided in an embodiment of the present invention, first first layer in scanning disk
Block, when the block of first layer be Fisrt fault block when, enter back into the second layer, more fine-grained target corresponding to Fisrt fault block
Block is scanned, and is determined the second trouble block therein, is otherwise continued to scan on the block of first layer.Therefore, this programme first to disk into
The scanning of row coarseness, that is, scan the block of first layer, such as the block failure of first layer, then the block progress fine granularity to the first layer
Scanning, that is, jump into the second layer, determines object block corresponding with the block of the first layer of failure in the second layer, sweeps to object block
It retouches and determines trouble block therein.Coarseness scanning can save the sweep time to trouble-free piece, and fine granularity scanning again can be with
The accuracy for increasing trouble block, had both improved scan full hard disk rate, and had in turn ensured the accuracy of scanning result.
On the basis of the above embodiments, the embodiment of the present invention has done further expansion and explanation to technical solution.
Specifically, above-described embodiment S102 determines the object block that the Fisrt fault block includes in the block of the second layer, right
The object block is scanned, in the object block after determining second trouble block, further includes:
Judge second trouble block whether be the bottom trouble block;
If so, recording the information of second trouble block;
If it is not, the lower failure block group of second trouble block is then scanned, until second trouble block pair is completed in scanning
The trouble block for the bottom answered records the information of the trouble block of the corresponding bottom of second trouble block;Every layer of lower layer
Trouble block group is the chunking divided in advance to upper one layer of trouble block.
In the present solution, the division number of plies of disk can not only two layers, if the second trouble block is not the bottom
When trouble block, it is also necessary to the block for continuing the more lower for being included to the second trouble block is scanned, until the bottom is arrived in scanning, from
The bottom determines most fine-grained trouble block, i.e. most accurately abort situation.
Specific scanning step may refer to following step in this programme:
Referring to fig. 2, a kind of specific Bad Track scan method provided in an embodiment of the present invention, specifically includes:
S201 scans the block of first layer in disk to be detected, judges whether the block of the first layer of Current Scan is
One trouble block;The block of the first layer is the block divided in advance to the disk to be detected;If so, S202 is executed,
If it is not, executing S208.
S202, if so, the object block that the Fisrt fault block includes is determined in the block of the second layer, to the object block
It is scanned, the second trouble block is determined in the object block;Wherein, the block of the second layer is in advance to the first layer
The each piece of block divided, the block fine granularity of the second layer are higher than the block of the first layer.
S203, using second trouble block as current failure block.
S204, judge Current Scan to current failure block whether be the bottom trouble block;If so, executing S205;
If it is not, then executing S206.
In the present solution, the number of plies of disk can be set as according to the actual situation 2 it is even more, it is to be understood that
When the number of plies is more, more the granularity of bottom will be smaller, and the accuracy of scanning result is also just higher.
However the number of plies is more, the time of scanning is also just more.Therefore, in a specific embodiment, to make the time
Balanced with accuracy, when the capacity of the disk to be detected is greater than 1T, the bottom is third layer, that is, disk one is divided into
It is three layers.And when the capacity of disk to be detected is less than or equal to 1T, the bottom is the second layer, i.e., disk is divided into two layers.
Specifically, judge Current Scan to trouble block whether be the bottom trouble block, that is to say, that judgement be currently
It is no to have scanned the bottom, if it is, executing S205, the information of current failure block is directly recorded, S206 is otherwise executed,
Continue to scan on more next layer of block.
S205 records the information of current failure block.
S206, the next layer of block group that scanning current failure block includes;The next layer of block group is in advance to current failure
The chunking that block is divided.
In the present solution, the division of each layer of block is similar with the division of the block of first layer, e.g., the block of third layer is to each
The block that the block of the second layer is divided.
S207, judge Current Scan to block whether be trouble block;If so, executing S204.
Judge Current Scan to block whether be trouble block, if it is not, then continuing to scan on other blocks of current layer;If
It is to return to S204 continues to determine whether it has been the bottom, if not, it is also necessary to continue to scan to bottom.
It should be noted that if can continue to scan on when current failure block has been the block of the bottom in bottom
Other bottom blocks corresponding with upper one layer of trouble block, scanning process are identical.If other blocks corresponding with upper one layer of trouble block
All after the completion of scanning, then one layer is returned to, in this layer, scans other blocks corresponding with upper one layer of trouble block of this layer, directly
To first layer is returned to, other blocks in first layer are continued to scan on, until entire disk scanning is completed.
S208, if it is not, then continuing to scan on the block of the first layer.
It can be seen that a kind of Bad Track scan method provided in an embodiment of the present invention, first first layer in scanning disk
Block, when the block of first layer be Fisrt fault block when, enter back into the second layer, more fine-grained target corresponding to Fisrt fault block
Block is scanned, and is determined the second trouble block therein, is otherwise continued to scan on the block of first layer.Therefore, this programme first to disk into
The scanning of row coarseness, that is, scan the block of first layer, such as the block failure of first layer, then the block progress fine granularity to the first layer
Scanning, that is, jump into the second layer, determines object block corresponding with the block of the first layer of failure in the second layer, sweeps to object block
It retouches and determines trouble block therein.Coarseness scanning can save the sweep time to trouble-free piece, and fine granularity scanning again can be with
The accuracy for increasing trouble block, had both improved scan full hard disk rate, and had in turn ensured the accuracy of scanning result.
It provides a kind of specific Bad Track scan method to the embodiment of the present invention below to be introduced, described below one
The specific Bad Track scan method of kind makes further restriction and explanation to the scanning algorithm in above-described embodiment, other are walked
Rapid content is roughly the same with above-described embodiment, specifically may refer to above-described embodiment.
Referring to Fig. 3, a kind of specific Bad Track scan method provided in an embodiment of the present invention is specifically included:
S301 scans the block of first layer in disk to be detected using the first algorithm, judges the first layer of Current Scan
Block whether be Fisrt fault block;The block of the first layer is the block divided in advance to the disk to be detected.
S302 utilizes the second algorithm if so, determining the object block that the Fisrt fault block includes in the block of the second layer
The object block is scanned, the second trouble block is determined in the object block;Wherein, the block of the second layer is right in advance
The block that each of described first layer piece is divided, the block fine granularity of the second layer are higher than the block of the first layer;Institute
The accuracy for stating the second algorithm is higher than the accuracy of first algorithm.
It should be noted that under normal conditions, scanning algorithm accuracy is higher, scanning time-consuming will be bigger, therefore, is
The accuracy of scanning result is further increased, and avoids unnecessary time-consuming, respectively using two kinds of algorithms to the in this programme
One layer of block and the block of the second layer are scanned.
Specifically, due to first layer it is only necessary to know that the Position Approximate of failure, the scanning algorithm that first layer uses for
Lower first algorithm of accuracy, and the second layer needs to know the accurate location of failure, therefore, the scanning algorithm that the second layer uses
For higher second algorithm of accuracy.
Such as, scanning algorithm common at present has bb (badblocks) algorithm and si (sg_ioctl) algorithm, wherein scanning
The rate of algorithm is si algorithm > bb algorithm, and accuracy rate is bb algorithm > si algorithm, and misdetection rate is si algorithm > bb algorithm.Therefore, right
It is higher for sweep speed requirement in first layer, si algorithm can be selected, the second layer is higher for accuracy rate requirement, can select
Bb algorithm.
It should be noted that bb algorithm can only carry out 32 bit scans at present, if disk size is greater than 2T, i.e., greater than 2
When 32 power, it will appear mistake using bb algorithm, therefore, to avoid such situation, when disk size is less than 2T, first layer
Using bb algorithm, other algorithms are otherwise selected.
It should be noted that above-mentioned algorithm is only as an example, other algorithms, such as sv can also be selected according to the actual situation
(sg_verify) algorithm etc., as long as the algorithm that the algorithm accuracy for meeting the second layer is higher than first layer is protected in this programme
In range.
S303, if it is not, then continuing to scan on the block of the first layer.
Since under normal conditions, scanning algorithm accuracy is higher, scanning time-consuming will be bigger, therefore, divides in this programme
The block of first layer and the block of the second layer are not scanned using the algorithm of two kinds of different accuracies, can be further improved scanning knot
The accuracy of fruit, and avoid unnecessary time-consuming.
The embodiment of the present invention makes further restriction and explanation to above-mentioned technical proposal, specific as follows:
In above-described embodiment, the block for stating first layer is divided to obtain according to the first specification to the disk to be detected
Block, in the block of the first layer, last blocks of specification is the remainder result of disk size and the first specification;
The block of the second layer is the block divided according to block of second specification to each first layer, corresponding
In the block of all second layers of one first layer block, last blocks of specification is the remainder of disk size and the second specification
As a result.
It should be noted that specification, that is, block size.Disk, can not when according to the first specification or the division of the second specification
Guarantee completely average division, last blocks of specification is likely less than the specification of other blocks.Such as, when disk size be 49MB,
First specification be 5MB, then last blocks of specification be 49 and 5 remainder as a result, i.e. 49 divided by 5 remainder, then the last one
The specification of block is 4.If last blocks of specification is still divided according to the first specification, in scanning, that is, it will appear offset
The case where crossing the border if that the last one block defines is 5MB, and actually only has 4MB for example, when scanning the last one block,
The data of remaining 1MB then can not be just obtained when scanning through 4MB, to will appear the situation of scanning mistake.
And last blocks of specification is set as the remainder of disk size and the second specification as a result, can avoid in this programme
The case where offset is crossed the border.
A kind of specific Bad Track scan method provided in an embodiment of the present invention is introduced below, it is described below
A kind of specific Bad Track scan method can be cross-referenced with any of the above-described embodiment.
Referring to fig. 4, a kind of specific Bad Track scan method provided in an embodiment of the present invention, specifically includes:
S401 scans the block of first layer in disk to be detected, judges whether the block of the first layer of Current Scan is
One trouble block;The block of the first layer is the block divided in advance to the disk to be detected.If so, executing
S402, if it is not, then executing S403.
S402 determines the object block that the Fisrt fault block includes in the block of the second layer, sweeps to the object block
It retouches, the second trouble block is determined in the object block;Wherein, the block of the second layer is in advance to each of described first layer piece
The block divided, the block fine granularity of the second layer are higher than the block of the first layer;
Whether the byte number of S403, the block for the first layer that judgement has currently scanned are greater than or equal to the disk to be detected
Capacity;If it is not, S404 is executed, if so, executing S405.
If the specification of the last one block setting is greater than its actual byte number, it will appear the problem of offset is crossed the border, out
Now scan the situation of mistake.Therefore, in the present solution, in order to further avoid the problem of scanning hour offset crosses the border, the end of scan
The mark for judging benchmark not instead of block, the byte number that actual scanning is crossed.That is, it is judged that whether the byte number of Current Scan is greater than
Or it has been equal to the specification of disk to be detected, it is continued to scan on if not, executes S404, otherwise execute S405, stop scanning.
S404 continues to scan on the block of the first layer;
S405 stops scanning.
If due to the last one block setting specification be greater than its actual byte number, will appear offset cross the border ask
There is the situation of scanning mistake in topic.Therefore, in the present solution, the end of scan the mark for judging benchmark not instead of block, it is practical
Scanned byte number.That is, it is judged that whether the byte number of Current Scan has been greater than or equal to the capacity of disk to be detected, if do not had
Have, continue to scan on, otherwise stops scanning.Further avoid the problem of scanning hour offset crosses the border.
A kind of Bad Track scanning system provided in an embodiment of the present invention is introduced below, a kind of magnetic described below
Disk bad track scanning system can be cross-referenced with any of the above-described embodiment.
Referring to Fig. 5, a kind of Bad Track scanning system provided in an embodiment of the present invention is specifically included:
First scan module 501 judges described the first of Current Scan for scanning the block of first layer in disk to be detected
Whether the block of layer is Fisrt fault block;The block of the first layer is the block divided in advance to the disk to be detected.
Second scan module 502, when the block of the first layer for Current Scan is Fisrt fault block, in the second layer
The object block that the Fisrt fault block includes is determined in block, the object block is scanned, and the is determined in the object block
Two trouble blocks;Wherein, the block of the second layer is the block divided in advance to each of described first layer piece, described
Two layers of block fine granularity is higher than the block of the first layer.
It can be seen that a kind of Bad Track scanning system provided in an embodiment of the present invention, the first scan module 501 are swept first
The block for retouching first layer in disk, when the block of first layer is Fisrt fault block, the second scan module 502 enters back into the second layer, right
The corresponding more fine-grained object block of Fisrt fault block is scanned, and determines the second trouble block therein, otherwise continues to scan on
One layer of block.Therefore, this programme first carries out coarseness scanning to disk, that is, scans the block of first layer, as the block of first layer occurs
Failure, then fine granularity scanning is carried out to the block of the first layer, that is, the second layer is jumped into, in the second layer the determining first layer with failure
The corresponding object block of block, object block is scanned and determines trouble block therein.Coarseness scanning can be saved to fault-free
Block sweep time, fine granularity scanning can increase the accuracy of trouble block again, not only improve scan full hard disk rate, but also guarantee
The accuracy of scanning result.
Optionally, the system also includes:
When the block of third scan module, the first layer for Current Scan is not Fisrt fault block, institute is continued to scan on
State the block of first layer.
First judgment module, before the block for continuing to scan on the first layer, first layer that judgement has currently scanned
Whether the byte number of block is greater than or equal to the capacity of the disk to be detected;If it is not, continuing to scan on described first described in then executing
The step of block of layer;If so, stopping scanning.
Optionally, further includes:
Second judgment module, for judge second trouble block whether be the bottom trouble block;
First information logging modle, for second trouble block be the bottom trouble block when, record it is described second therefore
Hinder the information of block;
When second information logging modle for second trouble block is not the trouble block of the bottom, scanning described second
The lower failure block group of trouble block, until the trouble block for completing the corresponding bottom of second trouble block is scanned, described in record
The information of the trouble block of the corresponding bottom of second trouble block;Every layer of lower failure block group is in advance to upper one layer of failure
The chunking that block is divided.
Optionally, first scan module is specifically used for scanning first layer in disk to be detected using the first algorithm
Block judges whether the block of the first layer of Current Scan is Fisrt fault block;
Second scan module is specifically used for determining target corresponding with the Fisrt fault block in the block of the second layer
Block is scanned the object block using the second algorithm, and the second trouble block is determined in the object block;
Wherein, the accuracy of second algorithm is higher than the accuracy of first algorithm.
Optionally, the system also includes:
Third judgment module, before the block for continuing to scan on the first layer, first layer that judgement has currently scanned
Whether the byte number of block is greater than or equal to the specification of the disk to be detected, and second specification is less than first specification;If
It is no, then execute described in the step of continuing to scan on the block of the first layer;If so, stopping scanning.
Optionally, further includes:
Second logging modle, for determining object block corresponding with the Fisrt fault block in the block of the second layer, to institute
It states object block to be scanned, after determining the second trouble block in the object block, records the disc information to be detected, described
Second trouble block banner word joint number, the second failure block length, the failure serial number of second trouble block.
The Bad Track scanning system of the present embodiment is for realizing Bad Track scan method above-mentioned, therefore Bad Track
The embodiment part of the visible Bad Track scan method hereinbefore of specific embodiment in scanning system, for example, first sweeps
Module 501 is retouched, the second scan module 502 is respectively used to realize step S101, S102, institute in above-mentioned Bad Track scan method
With specific embodiment is referred to the description of corresponding various pieces embodiment, and details are not described herein.
A kind of Bad Track scanning means provided in an embodiment of the present invention is introduced below, a kind of magnetic described below
Disk bad track scanning means can be cross-referenced with any of the above-described embodiment.
Referring to Fig. 6, a kind of Bad Track scanning means provided in an embodiment of the present invention is specifically included:
Memory 100, for storing computer program;
Processor 200, the step of any of the above-described Bad Track scan method is realized when for executing the computer program.
Specifically, memory 100 includes non-volatile memory medium, built-in storage.Non-volatile memory medium storage
There are operating system and computer-readable instruction, which is that the operating system and computer in non-volatile memory medium can
The operation of reading instruction provides environment.
It can be seen that a kind of Bad Track scanning means provided in an embodiment of the present invention, first first layer in scanning disk
Block, when the block of first layer be Fisrt fault block when, enter back into the second layer, more fine-grained target corresponding to Fisrt fault block
Block is scanned, and is determined the second trouble block therein, is otherwise continued to scan on the block of first layer.Therefore, this programme first to disk into
The scanning of row coarseness, that is, scan the block of first layer, such as the block failure of first layer, then the block progress fine granularity to the first layer
Scanning, that is, jump into the second layer, determines object block corresponding with the block of the first layer of failure in the second layer, sweeps to object block
It retouches and determines trouble block therein.Coarseness scanning can save the sweep time to trouble-free piece, and fine granularity scanning again can be with
The accuracy for increasing trouble block, had both improved scan full hard disk rate, and had in turn ensured the accuracy of scanning result.
Further, the Bad Track scanning means in the present embodiment can also include:
Input interface 300, for obtaining the computer program of extraneous importing, and the computer program that will acquire save to
In the memory 100, it can be also used for the various instructions and parameter that obtain extraneous terminal device transmission, and be transmitted to processor
In 200, so that processor 200 is handled accordingly using above-mentioned various instructions and parametric evolving.In the present embodiment, the input is connect
Mouth 300 can specifically include but be not limited to USB interface, serial line interface, speech input interface, fingerprint input interface, hard disk and reads
Interface etc..
Output interface 400, the various data for generating processor 200 are exported to coupled terminal device, with
Other terminal devices convenient for being connected with output interface 400 can get the various data of the generation of processor 200.The present embodiment
In, the output interface 400 can specifically include but be not limited to USB interface, serial line interface etc..
Communication unit 500, for establishing remote linkage between Bad Track scanning means and other nodes.
Keyboard 600, the various parameters data or instruction inputted and tapping keycap in real time for obtaining user.
Display 700 carries out real-time display for the relevant information to Bad Track scanning process, in order to which user is timely
Ground understands current Bad Track and scans situation.
Mouse 800 can be used for assisting user input data and simplify the operation of user.
The present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, the computer
Step provided by above-described embodiment may be implemented when program is executed by processor.The storage medium may include: USB flash disk, movement
Hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory,
RAM), the various media that can store program code such as magnetic or disk.
Since the computer program in computer readable storage medium provided by the embodiments of the present application is performed, make can be real
Step provided by existing above-described embodiment, therefore can also bring the corresponding beneficial effect of above-described embodiment.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (16)
1. a kind of Bad Track scan method characterized by comprising
The block for scanning first layer in disk to be detected judges whether the block of the first layer of Current Scan is Fisrt fault block;
The block of the first layer is the block divided in advance to the disk to be detected;
If so, determining the object block that the Fisrt fault block includes in the block of the second layer, the object block is scanned,
The second trouble block is determined in the object block;Wherein, the block of the second layer be in advance to each of described first layer piece into
Row divides obtained block, and the block fine granularity of the second layer is higher than the block of the first layer.
2. the method according to claim 1, wherein the block of the first layer for judging Current Scan whether
After Fisrt fault block, further includes:
If it is not, then continuing to scan on other blocks of first layer.
3. according to the method described in claim 2, it is characterized in that, also being wrapped before described other blocks for continuing to scan on first layer
It includes:
Whether the byte number of the block for the first layer that judgement has currently scanned is greater than or equal to the capacity of the disk to be detected;
If it is not, the step of continuing to scan on other blocks of the first layer described in then executing;
If so, stopping scanning.
4. the method according to claim 1, wherein described determine the Fisrt fault block in the block of the second layer
The object block for including is scanned the object block, in the object block after determining second trouble block, further includes:
Judge second trouble block whether be the bottom trouble block;
If so, recording the information of second trouble block;
If it is not, the lower failure block group of second trouble block is then scanned, until scanning completion second trouble block is corresponding
The trouble block of the bottom records the information of the trouble block of the corresponding bottom of second trouble block;Every layer of lower failure
Block group is the chunking divided in advance to upper one layer of trouble block.
5. the method according to claim 1, wherein the block for scanning first layer in disk to be detected, judgement
Whether the block of the first layer of Current Scan is Fisrt fault block, comprising: scans in disk to be detected the using the first algorithm
One layer of block judges whether the block of the first layer of Current Scan is Fisrt fault block;
The object block for determining the Fisrt fault block in the block of the second layer and including, is scanned the object block,
The second trouble block is determined in the object block, comprising: the object block that the Fisrt fault block includes is determined in the block of the second layer,
The object block is scanned using the second algorithm, the second trouble block is determined in the object block;
Wherein, the accuracy of second algorithm is higher than the accuracy of first algorithm.
6. the method according to claim 1, wherein the block of the first layer be according to the first specification to it is described to
The block that is divided of detection disk, in the block of the first layer, last blocks of specification is disk size and the first rule
The remainder result of lattice;
The block of the second layer is the block divided according to block of second specification to each first layer, one corresponding
In the block of all second layers of first layer block, last blocks of specification is the remainder knot of disk size and the second specification
Fruit, second specification are less than first specification.
7. method according to any claim from 1 to 6, which is characterized in that described to be determined in the block of the second layer
Object block corresponding with the Fisrt fault block, is scanned the object block, and the second failure is determined in the object block
After block, further includes:
Record the disc information to be detected, the second trouble block banner word joint number, the second failure block length, described
The failure serial number of two trouble blocks.
8. a kind of Bad Track scanning system characterized by comprising
First scan module judges the block of the first layer of Current Scan for scanning the block of first layer in disk to be detected
It whether is Fisrt fault block;The block of the first layer is the block divided in advance to the disk to be detected;
Second scan module, when the block of the first layer for Current Scan is Fisrt fault block, in the block of the second layer really
The object block that the fixed Fisrt fault block includes, is scanned the object block, and the second failure is determined in the object block
Block;Wherein, the block of the second layer is the block divided in advance to each of described first layer piece, the second layer
Block fine granularity is higher than the block of the first layer.
9. system according to claim 8, which is characterized in that further include:
When the block of third scan module, the first layer for Current Scan is not Fisrt fault block, described is continued to scan on
One layer of block.
10. system according to claim 9, which is characterized in that further include:
First judgment module, before the block for continuing to scan on the first layer, the block for the first layer that judgement has currently scanned
Whether byte number is greater than or equal to the capacity of the disk to be detected;If it is not, continuing to scan on the first layer described in then executing
The step of block;If so, stopping scanning.
11. system according to claim 8, which is characterized in that further include:
Second judgment module, for judge second trouble block whether be the bottom trouble block;
First information logging modle, for second trouble block be the bottom trouble block when, record second trouble block
Information;
When second information logging modle for second trouble block is not the trouble block of the bottom, second failure is scanned
The lower failure block group of block records described second until the trouble block of the corresponding bottom of second trouble block is completed in scanning
The information of the trouble block of the corresponding bottom of trouble block;Every layer of lower failure block group be in advance to upper one layer of trouble block into
Row divides an obtained chunking.
12. system according to claim 8, which is characterized in that first scan module is specifically used for calculating using first
Method scans the block of first layer in disk to be detected, judges whether the block of the first layer of Current Scan is Fisrt fault block;
Second scan module is specifically used for determining object block corresponding with the Fisrt fault block in the block of the second layer, benefit
The object block is scanned with the second algorithm, the second trouble block is determined in the object block;
Wherein, the accuracy of second algorithm is higher than the accuracy of first algorithm.
13. system according to claim 8, which is characterized in that the system also includes:
Third judgment module, before the block for continuing to scan on the first layer, the block for the first layer that judgement has currently scanned
Whether byte number is greater than or equal to the specification of the disk to be detected, and second specification is less than first specification;If it is not, then
The step of block of the first layer is continued to scan on described in execution;If so, stopping scanning.
14. according to system described in claim 8-13 any claim, which is characterized in that further include:
Second logging modle, for determining object block corresponding with the Fisrt fault block in the block of the second layer, to the mesh
Mark block is scanned, and after determining the second trouble block in the object block, records the disc information to be detected, described second
Trouble block banner word joint number, the second failure block length, the failure serial number of second trouble block.
15. a kind of Bad Track scanning means characterized by comprising
Memory, for storing computer program;
Processor realizes the Bad Track scanning side as described in any one of claim 1 to 7 when for executing the computer program
The step of method.
16. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes the Bad Track scan method as described in any one of claim 1 to 7 when the computer program is executed by processor
The step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910476872.8A CN110209519A (en) | 2019-06-03 | 2019-06-03 | A kind of Bad Track scan method, system, device and computer memory device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910476872.8A CN110209519A (en) | 2019-06-03 | 2019-06-03 | A kind of Bad Track scan method, system, device and computer memory device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110209519A true CN110209519A (en) | 2019-09-06 |
Family
ID=67790367
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910476872.8A Pending CN110209519A (en) | 2019-06-03 | 2019-06-03 | A kind of Bad Track scan method, system, device and computer memory device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110209519A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110931072A (en) * | 2019-11-28 | 2020-03-27 | 深信服科技股份有限公司 | Bad track scanning method, device, equipment and storage medium |
CN112052129A (en) * | 2020-07-13 | 2020-12-08 | 深圳市智微智能科技股份有限公司 | Computer disk detection method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080028264A1 (en) * | 2006-07-27 | 2008-01-31 | Microsoft Corporation | Detection and mitigation of disk failures |
CN103389920A (en) * | 2012-05-09 | 2013-11-13 | 深圳市腾讯计算机系统有限公司 | Self-detection method and device for bad blocks of magnetic disc |
US20150355968A1 (en) * | 2014-06-09 | 2015-12-10 | Oracle International Corporation | Systems and methods for sequential resilvering |
CN109508268A (en) * | 2018-11-13 | 2019-03-22 | 郑州云海信息技术有限公司 | Function test method is quickly wiped in a kind of ISE hard disk test device and the hard disk sector ISE |
-
2019
- 2019-06-03 CN CN201910476872.8A patent/CN110209519A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080028264A1 (en) * | 2006-07-27 | 2008-01-31 | Microsoft Corporation | Detection and mitigation of disk failures |
CN103389920A (en) * | 2012-05-09 | 2013-11-13 | 深圳市腾讯计算机系统有限公司 | Self-detection method and device for bad blocks of magnetic disc |
US20150355968A1 (en) * | 2014-06-09 | 2015-12-10 | Oracle International Corporation | Systems and methods for sequential resilvering |
CN109508268A (en) * | 2018-11-13 | 2019-03-22 | 郑州云海信息技术有限公司 | Function test method is quickly wiped in a kind of ISE hard disk test device and the hard disk sector ISE |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110931072A (en) * | 2019-11-28 | 2020-03-27 | 深信服科技股份有限公司 | Bad track scanning method, device, equipment and storage medium |
CN110931072B (en) * | 2019-11-28 | 2022-03-22 | 深信服科技股份有限公司 | Bad track scanning method, device, equipment and storage medium |
CN112052129A (en) * | 2020-07-13 | 2020-12-08 | 深圳市智微智能科技股份有限公司 | Computer disk detection method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7613871B2 (en) | Storage system using a flash memory partitioned with write-once and rewritable blocks | |
US7953950B2 (en) | Storage device including flash memory and capable of predicting storage device performance | |
CN102855941B (en) | Based on try to be the first storage repairing method and the system of the analysis of many symbol many cleaning cycles | |
US20190163622A1 (en) | Estimation method for data access performance | |
CN102722443B (en) | Bad block management method for flash memory | |
CN101894591B (en) | Linear feedback shift register (LFSR)-based random test device for external storage interface | |
JP2015082269A (en) | Storage control device, storage control program, and storage control method | |
TW201839615A (en) | Methods for gc (garbage collection) por (power off recovery) of a flash memory device and apparatuses using the same | |
CN101911207A (en) | Semiconductor storage device, controlling apparatus and controlling method | |
US7519764B2 (en) | Apparatus and method for detecting data validity in flash memory | |
CN106776095A (en) | SSD solid state hard disc data reliability intelligent detecting methods and detection means | |
CN101819543A (en) | Snapshot data processing method, system and storage device | |
CN109240870A (en) | A kind of solid state hard disk Fault Locating Method and relevant apparatus | |
CN110209519A (en) | A kind of Bad Track scan method, system, device and computer memory device | |
CN109254883B (en) | Debugging device and method for on-chip memory | |
CN110704287B (en) | RAID card abnormal log collection method and system under Linux system and storage medium | |
CN109522154A (en) | Data reconstruction method and relevant device and system | |
CN104461526B (en) | A kind of control visiting method and device of end application | |
CN109669818A (en) | Continuous data protection method and system without local cache | |
WO2024055611A1 (en) | Fault site backtracking method based on firmware emulation, and device and readable storage medium | |
CN110275800A (en) | SSD Data Physical backup method, device, computer equipment and storage medium | |
CN109614272B (en) | Data back up method and system without local cache | |
CN106373616A (en) | Method and apparatus for detecting failure of random access memory, and network processor | |
CN114924923A (en) | Method, system, equipment and medium for verifying correctness of hard disk write-in point | |
CN109614273A (en) | The read method and system of incremental data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |