CN101527142A - Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof - Google Patents

Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof Download PDF

Info

Publication number
CN101527142A
CN101527142A CN200910135507A CN200910135507A CN101527142A CN 101527142 A CN101527142 A CN 101527142A CN 200910135507 A CN200910135507 A CN 200910135507A CN 200910135507 A CN200910135507 A CN 200910135507A CN 101527142 A CN101527142 A CN 101527142A
Authority
CN
China
Prior art keywords
raid
data
reserve area
bad track
band
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.)
Granted
Application number
CN200910135507A
Other languages
Chinese (zh)
Other versions
CN101527142B (en
Inventor
郑萍萍
杨西平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2009101355077A priority Critical patent/CN101527142B/en
Publication of CN101527142A publication Critical patent/CN101527142A/en
Application granted granted Critical
Publication of CN101527142B publication Critical patent/CN101527142B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof. The reading-writing method comprises the following steps: a RAID controller restores original data in a bad track when the RAID bad track is detected; the RAID controller stores the original data in a saved area pre-divided by the RAID; and the RAID controller shifts the operation of reading-writing RAID bad track to the saved area so as to read and write. In the reading-writing method, data in a bad track data block are stored in the saved area when a disk bad track is accessed in the reading-writing process, thus avoiding array disk failure caused by the bad track in the disk and lowering data loss probability.

Description

Data write method and apparatus in a kind of redundant arrays of inexpensive disks
Technical field
The present invention relates to the redundant arrays of inexpensive disks technical field, particularly relate to data write method and apparatus in a kind of redundant arrays of inexpensive disks.
Background technology
RAID (Redundant Array of Inexpensive Disks, redundant arrays of inexpensive disks) is the memory technology of a kind of high-performance, high reliability, by a series of independent disks are combined in a different manner, for application terminal or terminal cluster provide in logic disk.Wherein, use the advantage of RAID to comprise: the performance and the safety of data that enlarge disk size, raising disk read-write.
In redundant arrays of inexpensive disks, the packing density of disk is very big, the damage of disk sector occurs easily in transportation, read-write process, thereby causes the bad track of disk.For the RAID redundant arrays of inexpensive disks, if have disk sector bad track to occur in the redundant array, when service traffics are read and write this disk sector that has bad track, the situation that disk is kicked out of redundant array can occur, this moment, redundant array was in degrading state, and the RAID array loses redundancy feature.For redundant array is returned to normal condition, need carry out the reconstruction of data, wherein, spent time of the process that data are rebuild is longer, and need frequent reading and writing data finishing the reconstruction of data, and frequent reading and writing data can reduce the service performance of RAID redundant arrays of inexpensive disks, when redundant array is not rebuild when not finishing, when having a disk to break down in the RAID disk array again, can cause losing of array damage and data.
In the prior art, do not lose by G-List (growth defect map) the tabulation assurance data of using disk to carry, when reading and writing data when the sector of bad track occurring, the G-List tabulation that carries according to disk is deposited into bad track place sectors of data in the reserve sector, and the physical address of sector, bad track place is displaced in the physical address of respective sectors in this reserve sector, thereby the assurance data can be read and write normally.
Based on top analysis, there is following shortcoming when in redundancy array in disc RAID, carrying out the data write operation at present:
Because the G-List space of disk is limited, when having occurred a lot of bad tracks in the disk, space in the G-List table has been write when full, can cause that the data that write can't write, thereby cause the dish of playing of array to take place, influence RAID redundant array of inexpensive disk data redundancy, and influence the reading and writing data performance.Writing in the fashionable disk when the data of redundant array does not have bad track, but because the disk long-play, or the disk vibrations are when causing bad track occurring in the sector, is damaged the read-write operation that carries out that sectors of data just can't be correct, thereby causes that redundant array plays dish.
Summary of the invention
The invention provides data write method and apparatus in a kind of redundant arrays of inexpensive disks, to improve data write performance in the RAID redundant array of inexpensive disk.
In order to achieve the above object, the present invention proposes data write method in a kind of redundant arrays of inexpensive disks, may further comprise the steps:
After detecting the RAID bad track, the RAID controller recovers the raw data in the bad track;
In the reserve area that described RAID controller is divided described original data storage in advance to described RAID;
The operation that described RAID controller will be read and write the RAID bad track is displaced in the described reserve area, so that read and write.
Preferably, the raw data in the described RAID controller recovery bad track comprises:
Described RAID controller obtains the related data that is used to recover described raw data;
Described RAID controller is according to the raw data in RAID redundant arithmetic and the described related data recovery bad track.
Preferably, in the reserve area that described RAID controller is divided described original data storage in advance to described RAID before, also comprise:
Described RAID controller stores array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation among the described RAID into;
Comprise in the reserve area that described RAID controller is divided described original data storage in advance to described RAID:
Described RAID controller according to described array retaining space corresponding relation and/or described array retaining space operating position bitmap with described original data storage in the reserve area of described RAID.
Preferably, described original data storage is comprised in the reserve area of described RAID:
Described RAID controller with the data storage of all disks in the band of described raw data place in described RAID reserve area; Or
Described RAID controller with the data storage in the data block of described raw data place in described RAID reserve area.
Preferably, the operation that will read and write the RAID bad track of described RAID controller is displaced in the described reserve area and comprises:
Described RAID controller is set up the corresponding relation of described RAID bad track and described RAID reserve area;
The operation that described RAID controller will be read and write described RAID bad track is displaced in the reserve area of described RAID.
Preferably, the corresponding relation of the described RAID of foundation bad track and described RAID reserve area comprises:
Described RAID controller is set up the corresponding relation of the band in raw data place band and the described RAID reserve area; Or
Described RAID controller is set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
The present invention proposes a kind of RAID controller, comprising:
Recover module, be used for after detecting the RAID bad track, recover the raw data in the bad track;
Memory module electrically connects with described recovery module, is used for the reserve area that the original data storage of described recovery module recovery is divided in advance to described RAID;
Offset module electrically connects with described memory module, is used for the operation of read-write RAID bad track is displaced to described reserve area, so that read and write the raw data of described memory module storage.
Preferably, described recovery module specifically is used for:
Obtain the related data that is used to recover described raw data, and according to the raw data in RAID redundant arithmetic and the described related data recovery bad track.
Preferably, described memory module specifically is used for:
Array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation are stored among the described RAID;
And according to described array retaining space corresponding relation and/or described array retaining space operating position bitmap with described original data storage in the reserve area of described RAID;
Described described original data storage is specially in the reserve area of described RAID:
With the data storage of all disks in the band of described raw data place in described RAID reserve area; Or with the data storage in the data block of described raw data place in described RAID reserve area.
Preferably, described offset module specifically is used for:
Carry out related with described RAID reserve area described RAID bad track; And the operation that will read and write described RAID bad track is displaced in the reserve area of described RAID;
The corresponding relation of the described RAID of foundation bad track and described RAID reserve area is specially:
Set up the corresponding relation of the band in raw data place band and the described RAID reserve area; Or set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
Compared with prior art, the present invention has the following advantages: when having access to Bad Track in the process of read-write, data computation by other disks in the array goes out the bad track sectors of data, and the data storage of bad track data block in retaining space, thereby avoid causing that redundant array plays dish because bad track appears in disk, reduce the possibility of redundant array degradation, guaranteed the professional high-performance read-write and the redundancy of RAID data, reduced the probability of loss of data.
Description of drawings
In order to be illustrated more clearly in the present invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in the present invention or the description of the Prior Art below, apparently, accompanying drawing in describing below only is accompanying drawings more of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is data write method flow diagram in a kind of redundant arrays of inexpensive disks of the present invention's proposition;
Fig. 2 is data write method flow diagram in the redundant arrays of inexpensive disks under a kind of concrete application scenarios of the present invention's proposition;
Fig. 3 carries out initialized synoptic diagram for what the present invention proposed to RAID;
Fig. 4 is the synoptic diagram of the array retaining space operating position bitmap of the present invention's proposition;
Fig. 5 is data write method flow diagram in the redundant arrays of inexpensive disks under the another kind of concrete application scenarios of the present invention's proposition;
Fig. 6 is data write equipment structure chart in a kind of redundant arrays of inexpensive disks of the present invention's proposition.
Embodiment
Below in conjunction with the accompanying drawing among the present invention, the technical scheme among the present invention is clearly and completely described, obviously, described only is a part of the present invention, rather than whole.Based on the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other invention that is obtained under the creative work prerequisite.
Core concept of the present invention is when bad track appears in the disk in the RAID redundant array of inexpensive disk, data block under the bad track or the RAID strip data that comprises bad track transferred to not to be had in the retention data of the bad track zone, thereby avoid playing dish because the array that bad track causes appears in disk, reduced the possibility of array degradation, guarantee the professional high-performance read-write and the redundancy of RAID data, reduced the probability of loss of data.
Data write method in a kind of redundant arrays of inexpensive disks that the present invention proposes as shown in Figure 1, may further comprise the steps:
Step S101, after detecting the RAID bad track, the RAID controller recovers the raw data in the bad track.
Wherein, the raw data in the described RAID controller recovery bad track comprises:
Described RAID controller obtains the related data that is used to recover described raw data;
The RAID controller is according to the raw data in RAID redundant arithmetic and the described related data recovery bad track.
Concrete, when being that unit is when carrying out data migtation with the band, the described related data that is used for recovering described raw data is: the data in the disk of bad track do not appear in raw data place band, for example, when this raw data was positioned at the disk 1 of band 1, this related data was the data of (having only 4 disks among the RAID) in disk 2, disk 3 and the disk 4 of band 1.
When being that unit is when carrying out data migtation with the data block, the described related data that is used for recovering raw data is: the data in the bad track data in magnetic disk piece do not appear in raw data place band, for example, when this raw data was positioned at the data block 2 of band 1 disk 1, this related data was the data in the data block 2 of the data block 2 of data block 2, disk 3 of band 1 disk 2 and disk 4.
In the reserve area that step S102, described RAID controller divide described original data storage in advance to described RAID.
Wherein, specifically comprise in the reserve area that described RAID controller is divided described original data storage in advance to described RAID:
Described RAID controller according to array retaining space corresponding relation and/or array retaining space operating position bitmap with described original data storage in the reserve area of described RAID.
Above-mentioned array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation are to be stored in advance among the described RAID.
Concrete, comprise in the following content one or more in the described array retaining space corresponding relation:
The numbering of band in the reserve area of described RAID; The start address of described band; The end address of described band; The operating position of described band;
Comprise in the following content one or more in the described array manifold skew corresponding relation:
The start address of the bad track place data block of described RAID; The end address of the bad track place data block of described RAID; Be displaced to the start address of data block in the described RAID reserve area; Be displaced to the end address of data block in the described RAID reserve area.
Concrete, original data storage is comprised in the reserve area of described RAID:
When with the band being unit when carrying out data migtation, described RAID controller with the data storage of all disks in the band of described raw data place in described RAID reserve area;
When with the data block being unit when carrying out data migtation, described RAID controller with the data storage in the data block of described raw data place in described RAID reserve area.
Wherein, after original data storage was in the reserve area of described RAID, described RAID controller will be according to content in the raw data renewal array retaining space operating position bitmap that stores in the RAID reserve area and the content in the array retaining space corresponding relation.
Step S103, the operation that described RAID controller will be read and write the RAID bad track is displaced in the described reserve area, so that read and write.
Wherein, the operation that will read and write the RAID bad track of described RAID controller is displaced in the described reserve area and comprises:
Described RAID controller is set up the corresponding relation of described RAID bad track and described RAID reserve area;
The operation that described RAID controller will be read and write described RAID bad track is displaced in the reserve area of described RAID.
Wherein, the corresponding relation of setting up RAID bad track and described RAID reserve area comprises:
When with the band being unit when carrying out data migtation, described RAID controller is set up the corresponding relation of the band in raw data place band and the described RAID reserve area;
When with the data block being unit when carrying out data migtation, described RAID controller is set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
Concrete, described RAID controller carries out related with described RAID reserve area described RAID bad track by using array manifold skew corresponding relation, with after original data storage is in the reserve area of described RAID, described RAID controller will upgrade content in the array manifold skew corresponding relation according to storing raw data in the RAID reserve area into.
Data write method in a kind of redundant arrays of inexpensive disks that a kind of application scenarios of the present invention proposes down, data migtation when this method is applicable to the read-write Bad Track, wherein, be that unit moves with the band among the present invention, the data write method may further comprise the steps as shown in Figure 2 in the above-mentioned redundant arrays of inexpensive disks:
Step S201, the RAID controller carries out the initialization of RAID, and array retaining space operating position bitmap, array retaining space table and array manifold offset table are stored among the RAID.
Wherein, RAID is carried out initialized process as shown in Figure 3, among the present invention, so that 4 disks (disk 1, disk 2, disk 3 and disk 4) to be arranged in the disk groups is that example describes, RAID band to 4 disks carries out initialization, and the ingredient of RAID comprises: RAID configuration information, RAID retaining space and RAID free memory.The position of this RAID configuration information, RAID retaining space and RAID free memory can be placed arbitrarily in RAID according to the actual needs, for example, the RAID configuration information is arranged on the top of RAID, the RAID retaining space is arranged on the initial part of RAID (being close to the RAID configuration information), the RAID free memory is arranged on remaining position.
Concrete, in 4 disks of RAID, all stored identical RAID configuration information, when bad track appears in the position of a disk storage RAID configuration information, can also from other disk, get access to the RAID configuration information.Wherein, this RAID configuration information comprises but is not limited to: array type, array capacity, disk, array retaining space operating position bitmap, array retaining space table, array manifold offset table.This array type is the class information of RAID, for example, the RAID rank of 6 kinds of clear and definite levels of the standard of RAID 0 to RAID 5, RAID 6, RAID 7, RAID 10 (combination of RAID 1 and RAID 0), RAID 01 (combination of RAID 0 and RAID 1), RAID 30 (combination of RAID 3 and RAID 0), RAID 50 (combination of RAID 0 and RAID 5) etc.; This array capacity is the capacity information of RAID; This disk is the number information of each disk among the RAID, and among the present invention, this disk is disk 1, disk 2, disk 3 and disk 4.
As shown in Figure 4; above-mentioned array retaining space operating position bitmap is used to write down the operating position of RAID retaining space; among the present invention; the title of this array retaining space operating position bitmap is not limited thereto; the information of the operating position of the record RAID retaining space that is useful on is all within protection domain of the present invention; for example, can use the operating position of first corresponding relation record RAID retaining space, this first corresponding relation is above-mentioned array retaining space operating position bitmap.Wherein, each row in this array retaining space operating position bitmap is represented a RAID band, (the RAID array has a minimal data block unit to the read-write of business datum to a minimum data block unit in each expression RAID array, 512b for example, 1K, 2K etc., concrete data block size can be different according to the realization of each manufacturer), represent that with 0 the RAID array is not used, represent that with 1 the RAID array is used, for example, in this bitmap first row all is that first row of 1 expression RAID retaining space band is used, present embodiment is that to carry out array migration be that example describes in unit with the array band, promptly each row in this array retaining space operating position bitmap is identical numerical value, at this moment, can be only in the present embodiment with the operating position of the first bit representation RAID retaining space in each row band, for example, first of first row is 1 o'clock in the bitmap, and first row of expression RAID retaining space band is used.
Above-mentioned array retaining space table is used to safeguard the use of RAID retaining space; same; the title of this array retaining space table also is not limited to this; be useful on safeguard the RAID retaining space information all within protection domain of the present invention; for example; can use second corresponding relation to safeguard the use of RAID retaining space, this second corresponding relation is above-mentioned array retaining space table.Wherein, content in this array retaining space table includes but not limited to: band numbering, the start address of band, the end address of band, the operating position of band, for example, have only first of RAID band to go when being used in the RAID retaining space, this array retaining space table can be as shown in table 1.
Table 1
The band numbering The band start address The band end address The band operating position
Band
1 The 1st The 64th (last position) Be used
Band 2 The 1st The 64th Be not used
Band n The 1st The 64th Be not used
Wherein, this array retaining space table and above-mentioned array retaining space operating position bitmap have one-to-one relationship, for example, expression the 1st of band 1 is when the 64th of band 1 is used in the array retaining space table, and the 1st of band 1 to band 1 the 64th is 1 in the array retaining space operating position bitmap.
Above-mentioned array manifold offset table is used to write down the situation that raw data moves to the RAID retaining space; same; the title of this array manifold offset table also is not limited to this; the record raw data that is useful on moves to the information of RAID retaining space situation all within protection domain of the present invention; for example; can use the 3rd corresponding relation record raw data to move to the situation of RAID retaining space, the 3rd corresponding relation is above-mentioned array manifold offset table.Wherein, the content in this array manifold offset table includes but not limited to: former data block start address, former end of data block address, offset data piece start address, offset data block end address; Start address, former end of data block address that this former data block start address is a bad track place band are the end address of bad track place band, this offset data piece start address is the start address of the above-mentioned former data block of storage in the RAID retaining space, and offset data block end address is the end address of the above-mentioned former data block of storage in the RAID retaining space.For example, when bad track occurring in the RAID band 6, when the data block in this band 6 was moved to RAID band first row in the RAID retaining space, this array manifold offset table can be as shown in table 2.
Table 2
Former data block start address Former end of data block address Offset data piece start address Offset data block end address
The 1st of band 6 The 64th of band 6 The 1st of band 1 The 64th of band 1
Wherein, when the 10th (the 1st between the 64th) of needs read-writes band 6, according to this array manifold offset table, the 10th of direct read RAID retaining space band 1.
Above-mentioned RAID retaining space is the RAID band that is provided with in the initialization procedure, for example, keep 1024 bands and be used for the RAID retaining space in RAID, this information is recorded in the array retaining space table, wherein, the RAID retaining space only need account for the very little ratio of RAID, and this ratio is to be provided with arbitrarily, for example, RAID for 150G, the RAID retaining space of 50M can only be set, and each band among the RAID is 64KB (or 128KB, 256KB, each manufacturer oneself is provided with).Above-mentioned RAID free memory is the space that is used to store data block, all needs when reading and writing data to carry out in the RAID free memory, and this RAID free memory has taken the overwhelming majority of RAID.
Step S202, when detecting disk and bad track occurs, the RAID controller obtains the RAID stripe information at Bad Track place.
Step S203, RAID controller read the data in magnetic disk that does not have bad track in this RAID band.
Wherein, each RAID band when bad track appears in a disk, can be read and write the data of getting its excess-three disk corresponding to 4 disks.For example, the RAID band that gets access to the Bad Track place in step S202 is the 6th band, and when bad track appeared on the disk 1, the RAID controller need be read and write out data in the data in the disk 2 in the 6th band, the disk 3 and the data in the disk 4.
Step S204, RAID controller calculate the raw data of the bad track that will read and write by the RAID redundant arithmetic.
In the pairing a plurality of disks of each band of RAID, data block store in the disk is arranged be verification and, for example, corresponding to band 1 (in the RAID free memory), data block store verification in the disk 1 and, corresponding to band 2, data block store verification in the disk 2 and, corresponding to band 3, the data block store verification in the disk 3 and, corresponding to band 4, data block store verification in the disk 4 and, corresponding to band 5, the data block store verification in the disk 1 and, the rest may be inferred, make all have in the pairing a plurality of disks of each band a data block in the disk be used to store verification and.Same, in the pairing a plurality of disks of each band in the RAID retaining space, also have a data block in the disk be used for storage be verification and.
Wherein, this verification and for the data of its excess-three disk are carried out the result that XOR drew, for example, bad track appears in the 6th band on disk 1, data block store verification in the 6th band in the disk 2 and the time, the above-mentioned RAID redundant arithmetic that passes through, calculate and to read and write the data of getting the bad track disk and be specially: by with the data on the disk 1, data on data on the disk 3 and the disk 4 are done XOR and are drawn data on the disk 2, in the present embodiment, can't read and write the data of getting on the disk 1, can be by the data on the disk 3, data computation on data on the disk 4 and the disk 2 goes out the data on the disk 1.
Step S205, the RAID controller is searched the space that can be used for storing the RAID band in the RAID retaining space according to array retaining space table.
The RAID controller can also be searched the space that can be used for storing the RAID band in the RAID retaining space according to array retaining space operating position bitmap; Or
Search the space that can be used for storing the RAID band in the RAID retaining space according to array retaining space operating position bitmap with according to array retaining space table.
Step S206, the RAID controller with bad track the data of corresponding band be written to and can be used in the RAID retaining space storing in the space of RAID band.
Wherein, this bad track the data of corresponding band be according to verification and the correct data (the pairing data of bad track place disk) that calculate among read-write is got among the above-mentioned step S203 correct data and the step S204, this can be used for storing the space of RAID band for also there not being used RAID retaining space, for example, when the pairing numerical value of RAID retaining space that writes down in the array retaining space operating position bitmap is 0, the band of representing this RAID retaining space is not used, can store bad track the data of corresponding band; Or when the pairing information of band operating position that writes down in the array retaining space table when not being used, the pairing band of this record is not used, can store bad track the data of corresponding band.For example, when the band 1 in the RAID retaining space is not used, when in the 6th band in the RAID free memory bad track being arranged, the data of disk 1 in the 6th band are written on the disk 1 of RAID retaining space band 1, the data of disk 2 in the 6th band are written on the disk 2 of RAID retaining space band 1, the data of disk 3 in the 6th band are written on the disk 3 of RAID retaining space band 1, the data of disk 4 in the 6th band are written on the disk 4 of RAID retaining space band 1.
Step S207, content in the RAID controller renewal array retaining space table and the content in the retaining space operating position bitmap.For example, with the content record in the RAID band of bad track place during to the band 1 of RAID retaining space, for being used, band 1 pairing position is set to 1 in the retaining space operating position bitmap with band 1 pairing information updating in the array retaining space table, represents that this position is used.
Step S208, RAID controller upgrade the array manifold offset table, carry out related with band in the RAID retaining space bad track place band.Wherein, this related result is the situation shown in the table 2 among the above-mentioned steps S201, the start address of the former data block of storage in the start address of bad track place band and the RAID retaining space is carried out related, related (soon band 6 and band 1 carry out related) carried out in the end address of the above-mentioned former data block of storage in the start address of bad track place band and the RAID retaining space.
Wherein, this step S207 and step S208 do not have ordinal relation successively.
Step S209, when reading and writing Bad Track, the RAID controller is displaced to read-write operation in the RAID retaining space according to the array manifold offset table.For example, during bad track in reading and writing band 6, the RAID controller is by searching the array manifold offset table, know that band 6 pairing related bands are the band 1 in the RAID retaining space, the reference address of read-write operation is changed to band 1, and the specific address of this visit is that the start address that writes down in the array manifold offset table is to the end address.
As seen, by using the data of RAID retaining space storage bad track place band, make when read-write is fetched data, when reading and writing the Bad Track in the array, can not cause that array plays dish, guarantee the data redundancy and the reading and writing data performance of RAID redundant array of inexpensive disk, and recovered the data of Bad Track.
Wherein, the inventive method can be adjusted each sequence of steps according to actual needs.
Data write method in a kind of redundant arrays of inexpensive disks that the another kind of application scenarios of the present invention proposes down, data migtation when this method is applicable to the read-write Bad Track, wherein, be that unit moves with the data block among the present invention, the data write method may further comprise the steps as shown in Figure 5 in the above-mentioned redundant arrays of inexpensive disks:
Step S501, the RAID controller carries out the initialization of RAID, and array retaining space operating position bitmap, array retaining space table and array manifold offset table are stored among the RAID.
Step S502, when detecting disk and bad track occurs, the RAID controller obtains the RAID stripe information at Bad Track place.
Wherein, this step S501-step S502 is identical with the process of above-mentioned step S201-step S202, does not repeat them here.
Step S503, RAID controller read data in the data block that does not have the bad track disk in this RAID band, and this data block that does not have the bad track disk is corresponding with the data block at bad track place.
Wherein, RAID has a minimal data block unit to the read-write of business datum, 512b for example, 1K, 2K, 4K, the size of this minimal data piece is provided with according to the actual needs of each manufacturer, the data block of each disk forms by a lot of minimal data set of blocks in the band, when bad track appears in a minimal data piece, need obtain the data in the data block of the disk that does not have bad track in the RAID band at this data block place, for example, the RAID band that gets access to the Bad Track place in step S502 is the 6th band, when bad track appeared on the 6th data block of disk 1, the RAID controller need be read and write out the data in the 6th data block of disk 2 in the 6th band, data in data in the 6th data block of disk 3 and the 6th data block of disk 4.
Step S504, the RAID controller calculates the raw data that will read and write in the bad track place data in magnetic disk piece of getting by the RAID redundant arithmetic.
In the pairing a plurality of disks of each band of RAID, a data block store in the disk is arranged be verification and, wherein, when doing the RAID data check, only need do verification to minimal data piece in each disk in the RAID array.For example, the minimum data piece of RAID array is 4K, the data volume that need revise when the data block at bad track place is less than 4K, and bad track is when appearing on the 6th data block of disk 1, as long as calculate the 6th the pairing 4K data of data block, at this moment, calculate content in the data block at bad track place according to the data block (the 6th data block) of corresponding 4K in other 3 disks (disk 2, disk 3 and disk 4).Wherein, this content that calculates in the data block at bad track place be according to verification and numerical evaluation, these computing method are identical with computing method among the above-mentioned steps S204, do not repeat them here.Among the present invention, do not need to read and write the data that round band, according to the data of whole band carry out verification and calculating.The data volume that need revise when the data block at bad track place is greater than 4K, when bad track appears on the 7th data block of the 6th data block of disk 1 and disk 1, need calculate the 6th data block and the 7th the pairing 4K data of data block respectively, this computation process is identical with computation process among the above-mentioned steps S204, does not repeat them here.
Step S505, the RAID controller is searched the space that can be used for storing the RAID band in the RAID retaining space according to array retaining space table.
Wherein, this step S505 is identical with the process of above-mentioned step S205, does not repeat them here.
Step S506, the RAID controller with bad track the data in the data block of corresponding band be written to and can be used in the RAID retaining space storing in the data block of RAID band.
Wherein, this bad track the data in the data block of corresponding band be according to verification and the correct data (the pairing data of bad track place data block) that calculate among the above-mentioned steps S504, this can be used for storing the data block of RAID band for also there not being used RAID retention data piece, for example, when the pairing numerical value of data block of the RAID reservation of writing down in the array retaining space operating position bitmap is 0, represent that the data block that this RAID keeps is not used, and can store the pairing data block of bad track; Or when the pairing information of band operating position that writes down in the array retaining space table when not being used, the pairing data block of this record is not used, and can store the pairing data block of bad track.For example, when all data blocks all are not used in the band 1 in the RAID retaining space, the pairing data block of bad track can be written in any disk of data block of band 1, when bad track appears in the 6th data block in the 6th band of RAID free memory, data in the 6th data block in the 6th the band disk 1 are written on the disk 1 in the 1st data block of RAID retaining space band 1, or the data in the 6th data block in the 6th the band disk 1 are written on the disk 2 in the 1st data block of RAID retaining space band 1, certainly, this position that writes can be chosen arbitrarily according to the actual needs.
Step S507, content in the RAID controller renewal array retaining space table and the content in the retaining space operating position bitmap.For example, with the data recording in the RAID strip data piece of bad track place in the data block of the band 1 of RAID retaining space, with the pairing information updating of band 1 corresponding data block in the array retaining space table for being used, the pairing position of band 1 corresponding data block is set to 1 in the retaining space operating position bitmap, represents that this position is used.
Step S508, RAID controller upgrade the array manifold offset table, carry out the data block of band in the data block of bad track place band and the RAID retaining space related.For example, carry out related with the data block 1 of band 1 disk 1 data block 6 of band 6 disks 1.
Wherein, this step S507 and step S508 do not have ordinal relation successively.
Step S509, when reading and writing Bad Track, the RAID controller is displaced to read-write operation in the RAID retaining space according to the array manifold offset table.For example, during the bad track in reading and writing band 6 (the 6th data block of disk 1), the RAID controller is by searching the array manifold offset table, the data block 6 pairing ADB associated data blocks of knowing band 6 disks 1 are the data block 1 of band 1 disk 1 in the RAID retaining space, the reference address of read-write operation is changed to the data block 1 of band 1, and the specific address of this visit is that the start address that writes down in the array manifold offset table is to the end address.
As seen, the data of the data block store bad track place data block by using the RAID retaining space, make when read-write is fetched data, when reading and writing the Bad Track in the array, can not cause that array plays dish, guarantee the data redundancy and the reading and writing data performance of RAID redundant array of inexpensive disk, and recovered the data of Bad Track.And also the RAID redundant array of inexpensive disk in the RAID retaining space, when the data of being moved are deposited into the RAID retaining space, also can in the RAID retaining space, try again verification and, thereby to the migration data carried out the secondary redundancy, more guaranteed safety of data.
Wherein, the inventive method can be adjusted each sequence of steps according to actual needs.
The invention allows for data write equipment in a kind of redundant arrays of inexpensive disks, this equipment is the RAID controller, and as shown in Figure 6, this RAID controller comprises:
Recover module 61, be used for after detecting the RAID bad track, recover the raw data in the bad track.
Wherein, described recovery module 61 specifically is used for:
Obtain the related data that is used to recover described raw data, and according to the raw data in recovery of RAID redundant arithmetic and the described related data bad track.
Concrete, when being that unit is when carrying out data migtation with the band, the described related data that is used for recovering described raw data is: the data in the disk of bad track do not appear in raw data place band, for example, when this raw data was positioned at the disk 1 of band 1, this related data was the data of (having only 4 disks among the RAID) in disk 2, disk 3 and the disk 4 of band 1.
When being that unit is when carrying out data migtation with the data block, the described related data that is used for recovering raw data is: the data in the bad track data in magnetic disk piece do not appear in raw data place band, for example, when this raw data was positioned at the data block 2 of band 1 disk 1, this related data was the data in the data block 2 of the data block 2 of data block 2, disk 3 of band 1 disk 2 and disk 4.
Wherein, above-mentioned RAID redundant arithmetic is specially: by using the raw data in verification and the recovery bad track, this verification and be that the data of three disks are carried out the result that XOR drew, for example, be that unit is when carrying out data migtation with the band, bad track appears in the 6th band on disk 1, data block store verification in the 6th band in the disk 2 and the time, by with the data on the disk 1, data on data on the disk 3 and the disk 4 are done XOR and are drawn data on the disk 2, when reading and writing the data of getting on the disk 1, can be by the data on the disk 3, data computation on data on the disk 4 and the disk 2 goes out the data on the disk 1.
Memory module 62 electrically connects with described recovery module 61, is used for the reserve area that the original data storage that described recovery module 61 is recovered is divided in advance to described RAID.
Wherein, described memory module 62 specifically is used for:
Array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation are stored among the described RAID;
And according to described array retaining space corresponding relation and/or described array retaining space operating position bitmap with described original data storage in the reserve area of described RAID;
Described described original data storage is specially in the reserve area of described RAID:
When with the band being unit when carrying out data migtation, with the data storage of all disks in the band of described raw data place in described RAID reserve area; Or when with the data block being unit when carrying out data migtation, with the data storage in the data block of described raw data place in described RAID reserve area.
Wherein, after original data storage was in the reserve area of described RAID, described memory module 62 also was used for according to content in the raw data renewal array retaining space operating position bitmap that stores the RAID reserve area into and the content in the array retaining space corresponding relation.
Concrete, comprise in the following content one or more in the described array retaining space corresponding relation:
The numbering of band in the reserve area of described RAID; The start address of described band; The end address of described band; The operating position of described band;
Comprise in the following content one or more in the described array manifold skew corresponding relation:
The start address of the bad track place data block of described RAID; The end address of the bad track place data block of described RAID; Be displaced to the start address of data block in the described RAID reserve area; Be displaced to the end address of data block in the described RAID reserve area.
Offset module 63 electrically connects with described memory module 62, is used for the operation of read-write RAID bad track is displaced to described reserve area, so that read and write the raw data of described memory module 62 storages.
Wherein, described offset module 63 specifically is used for:
Set up the corresponding relation of described RAID bad track and described RAID reserve area; And the operation that will read and write described RAID bad track is displaced in the reserve area of described RAID;
The corresponding relation of the described RAID of foundation bad track and described RAID reserve area is specially:
Set up the corresponding relation of the band in raw data place band and the described RAID reserve area; Or set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
Concrete, described offset module 63 is set up the corresponding relation of described RAID bad track and described RAID reserve area by using array manifold skew corresponding relation, with after original data storage is in the reserve area of described RAID, described offset module 63 also is used for upgrading content in the array manifold skew corresponding relation according to the raw data that stores the RAID reserve area into.
Wherein, each module of apparatus of the present invention can be integrated in one, and also can separate deployment.Above-mentioned module can be merged into a module, also can further split into a plurality of submodules.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise that some instructions are with so that a computer equipment (can be personal computer, server, perhaps network equipment etc.) is carried out method of the present invention.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of the foregoing description can be merged into a module, also can further split into a plurality of submodules.
The invention described above embodiment sequence number is not represented the quality of embodiment just to description.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (10)

1, data write method in a kind of redundancy array in disc RAID is characterized in that, may further comprise the steps:
After detecting the RAID bad track, the RAID controller recovers the raw data in the bad track;
In the reserve area that described RAID controller is divided described original data storage in advance to described RAID;
The operation that described RAID controller will be read and write the RAID bad track is displaced in the described reserve area, so that read and write.
2, the method for claim 1 is characterized in that, the raw data that described RAID controller recovers in the bad track comprises:
Described RAID controller obtains the related data that is used to recover described raw data;
Described RAID controller is according to the raw data in RAID redundant arithmetic and the described related data recovery bad track.
3, the method for claim 1 is characterized in that, in the reserve area that described RAID controller is divided described original data storage in advance to described RAID before, also comprise:
Described RAID controller stores array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation among the described RAID into;
Comprise in the reserve area that described RAID controller is divided described original data storage in advance to described RAID:
Described RAID controller according to described array retaining space corresponding relation and/or described array retaining space operating position bitmap with described original data storage in the reserve area of described RAID.
4, method as claimed in claim 3 is characterized in that, described original data storage is comprised in the reserve area of described RAID:
Described RAID controller with the data storage of all disks in the band of described raw data place in described RAID reserve area; Or
Described RAID controller with the data storage in the data block of described raw data place in described RAID reserve area.
5, the method for claim 1 is characterized in that, the operation that described RAID controller will be read and write the RAID bad track is displaced in the described reserve area and comprises:
Described RAID controller is set up the corresponding relation of described RAID bad track and described RAID reserve area;
The operation that described RAID controller will be read and write described RAID bad track is displaced in the reserve area of described RAID.
6, method as claimed in claim 5 is characterized in that, the corresponding relation of the described RAID of foundation bad track and described RAID reserve area comprises:
Described RAID controller is set up the corresponding relation of the band in raw data place band and the described RAID reserve area; Or
Described RAID controller is set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
7, a kind of RAID controller is characterized in that, comprising:
Recover module, be used for after detecting the RAID bad track, recover the raw data in the bad track;
Memory module electrically connects with described recovery module, is used for the reserve area that the original data storage of described recovery module recovery is divided in advance to described RAID;
Offset module electrically connects with described memory module, is used for the operation of read-write RAID bad track is displaced to described reserve area, so that read and write the raw data of described memory module storage.
8, RAID controller as claimed in claim 7 is characterized in that, described recovery module specifically is used for:
Obtain the related data that is used to recover described raw data, and according to the raw data in RAID redundant arithmetic and the described related data recovery bad track.
9, RAID controller as claimed in claim 7 is characterized in that, described memory module specifically is used for:
Array retaining space operating position bitmap, array retaining space corresponding relation and array manifold skew corresponding relation are stored among the described RAID;
And according to described array retaining space corresponding relation and/or described array retaining space operating position bitmap with described original data storage in the reserve area of described RAID;
Described described original data storage is specially in the reserve area of described RAID:
With the data storage of all disks in the band of described raw data place in described RAID reserve area; Or with the data storage in the data block of described raw data place in described RAID reserve area.
10, RAID controller as claimed in claim 7 is characterized in that, described offset module specifically is used for:
Set up the corresponding relation of described RAID bad track and described RAID reserve area; And the operation that will read and write described RAID bad track is displaced in the reserve area of described RAID;
The corresponding relation of the described RAID of foundation bad track and described RAID reserve area is specially:
Set up the corresponding relation of the band in raw data place band and the described RAID reserve area; Or set up the corresponding relation of the data block in raw data place data block and the described RAID reserve area.
CN2009101355077A 2009-04-17 2009-04-17 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof Active CN101527142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101355077A CN101527142B (en) 2009-04-17 2009-04-17 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101355077A CN101527142B (en) 2009-04-17 2009-04-17 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof

Publications (2)

Publication Number Publication Date
CN101527142A true CN101527142A (en) 2009-09-09
CN101527142B CN101527142B (en) 2011-04-13

Family

ID=41094978

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101355077A Active CN101527142B (en) 2009-04-17 2009-04-17 Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof

Country Status (1)

Country Link
CN (1) CN101527142B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508620A (en) * 2011-12-01 2012-06-20 浪潮电子信息产业股份有限公司 Method for processing RAID5 (Redundant Array of Independent Disks) bad sector
CN102968361A (en) * 2012-11-19 2013-03-13 浪潮电子信息产业股份有限公司 RAID (Redundant Array of Independent Disk) data self-repairing method
CN103530206A (en) * 2013-09-29 2014-01-22 华为技术有限公司 Data recovery method and device
CN104035886A (en) * 2014-06-23 2014-09-10 华为技术有限公司 Magnetic disk remapping method, magnetic disk remapping device and electronic equipment
CN104035830A (en) * 2014-06-24 2014-09-10 浙江宇视科技有限公司 Method and device for recovering data
CN104166601A (en) * 2014-08-14 2014-11-26 浙江宇视科技有限公司 Storage data backup method and device
CN104407821A (en) * 2014-12-12 2015-03-11 浪潮(北京)电子信息产业有限公司 Method and device for achieving RAID reconstitution
CN104572374A (en) * 2015-01-13 2015-04-29 华为技术有限公司 Storage processing method, storage processing device and storage equipment
CN106959912A (en) * 2017-03-07 2017-07-18 杭州宏杉科技股份有限公司 Disk detection method and device
CN108319426A (en) * 2015-08-29 2018-07-24 华为数字技术(成都)有限公司 A kind of application method and device of redundant array of independent disks
CN108536548A (en) * 2018-04-10 2018-09-14 网宿科技股份有限公司 A kind of processing method of Bad Track, device and computer storage media
CN111007992A (en) * 2020-03-04 2020-04-14 广东电网有限责任公司佛山供电局 Disk data storage representation method, system and storage medium
CN111670428A (en) * 2018-11-22 2020-09-15 株式会社东芝 Information processing apparatus

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508620B (en) * 2011-12-01 2014-08-13 浪潮电子信息产业股份有限公司 Method for processing RAID5 (Redundant Array of Independent Disks) bad sector
CN102508620A (en) * 2011-12-01 2012-06-20 浪潮电子信息产业股份有限公司 Method for processing RAID5 (Redundant Array of Independent Disks) bad sector
CN102968361A (en) * 2012-11-19 2013-03-13 浪潮电子信息产业股份有限公司 RAID (Redundant Array of Independent Disk) data self-repairing method
CN103530206B (en) * 2013-09-29 2015-12-02 华为技术有限公司 A kind of method and apparatus of date restoring
CN103530206A (en) * 2013-09-29 2014-01-22 华为技术有限公司 Data recovery method and device
CN104035886A (en) * 2014-06-23 2014-09-10 华为技术有限公司 Magnetic disk remapping method, magnetic disk remapping device and electronic equipment
WO2015196811A1 (en) * 2014-06-23 2015-12-30 华为技术有限公司 Disk remapping method and apparatus, and electronic device
CN104035830A (en) * 2014-06-24 2014-09-10 浙江宇视科技有限公司 Method and device for recovering data
CN104035830B (en) * 2014-06-24 2017-12-15 浙江宇视科技有限公司 A kind of data reconstruction method and device
CN104166601A (en) * 2014-08-14 2014-11-26 浙江宇视科技有限公司 Storage data backup method and device
CN104166601B (en) * 2014-08-14 2017-08-15 浙江宇视科技有限公司 The backup method and device of a kind of data storage
CN104407821A (en) * 2014-12-12 2015-03-11 浪潮(北京)电子信息产业有限公司 Method and device for achieving RAID reconstitution
CN104407821B (en) * 2014-12-12 2018-02-06 浪潮(北京)电子信息产业有限公司 A kind of method and device for realizing RAID reconstruction
CN104572374A (en) * 2015-01-13 2015-04-29 华为技术有限公司 Storage processing method, storage processing device and storage equipment
WO2016112824A1 (en) * 2015-01-13 2016-07-21 华为技术有限公司 Storage processing method and apparatus, and storage device
CN104572374B (en) * 2015-01-13 2018-02-13 华为技术有限公司 Processing method, device and the storage device of storage
CN108319426B (en) * 2015-08-29 2021-08-13 华为数字技术(成都)有限公司 Method and device for using redundant array of independent disks
CN108319426A (en) * 2015-08-29 2018-07-24 华为数字技术(成都)有限公司 A kind of application method and device of redundant array of independent disks
CN106959912A (en) * 2017-03-07 2017-07-18 杭州宏杉科技股份有限公司 Disk detection method and device
CN106959912B (en) * 2017-03-07 2020-03-24 杭州宏杉科技股份有限公司 Disk detection method and device
CN108536548B (en) * 2018-04-10 2020-12-29 网宿科技股份有限公司 Method and device for processing bad track of disk and computer storage medium
US11073998B2 (en) 2018-04-10 2021-07-27 Wangsu Science & Technology Co., Ltd. Method, apparatus for processing disk bad sector,and computer storage medium
CN108536548A (en) * 2018-04-10 2018-09-14 网宿科技股份有限公司 A kind of processing method of Bad Track, device and computer storage media
CN111670428A (en) * 2018-11-22 2020-09-15 株式会社东芝 Information processing apparatus
CN111670428B (en) * 2018-11-22 2023-07-28 株式会社东芝 Information processing apparatus
CN111007992A (en) * 2020-03-04 2020-04-14 广东电网有限责任公司佛山供电局 Disk data storage representation method, system and storage medium
CN111007992B (en) * 2020-03-04 2020-08-04 广东电网有限责任公司佛山供电局 Disk data storage representation method, system and storage medium

Also Published As

Publication number Publication date
CN101527142B (en) 2011-04-13

Similar Documents

Publication Publication Date Title
CN101527142B (en) Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof
CN101916173B (en) RAID (Redundant Array of Independent Disks) based data reading and writing method and system thereof
KR101570179B1 (en) - Cache synchronization method and system for fast power-off
CN104035830A (en) Method and device for recovering data
CN103064765A (en) Method and device for data recovery and cluster storage system
CN108958656B (en) Dynamic stripe system design method based on RAID5 solid state disk array
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
US10734033B2 (en) Shingled magnetic recording storage system
US8879183B1 (en) Segmenting of read-modify-write operations
CN107346212B (en) Method for screening damaged data row and data storage device with damaged data row general table
CN101866307A (en) Data storage method and device based on mirror image technology
CN103955433A (en) Shingled magnetic recording hard disk, and method and device for writing data in shingled magnetic recording hard disk
US9373347B2 (en) Data write management
CN103729149A (en) Data storage method
CN104375784A (en) Method and device for lowering complexity of virtual disk management
CN104166601A (en) Storage data backup method and device
US10642508B2 (en) Method to limit impact of partial media failure of disk drive and detect/report the loss of data for objects due to partial failure of media
US9377956B1 (en) Rewrite operation for recording bands
JP4347707B2 (en) Information recording medium formatting method and information recording medium
CN101650692B (en) Method and device for modifying data in memory
KR100954603B1 (en) A log file of file system and method for recovering file system
CN101908007A (en) Storage system and computer system
TW201635304A (en) Data storage device and data accessing method thereof
US10867633B1 (en) Reduced adjacent track erasure from write retry
US9443553B2 (en) Storage system with multiple media scratch pads

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address