CN1290019C - Method and apparatus for hard disk array data transfer - Google Patents

Method and apparatus for hard disk array data transfer Download PDF

Info

Publication number
CN1290019C
CN1290019C CN 200410098003 CN200410098003A CN1290019C CN 1290019 C CN1290019 C CN 1290019C CN 200410098003 CN200410098003 CN 200410098003 CN 200410098003 A CN200410098003 A CN 200410098003A CN 1290019 C CN1290019 C CN 1290019C
Authority
CN
China
Prior art keywords
data
hard disk
district
migrated
migtation
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.)
Active
Application number
CN 200410098003
Other languages
Chinese (zh)
Other versions
CN1614573A (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.)
Via Technologies Inc
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CN 200410098003 priority Critical patent/CN1290019C/en
Publication of CN1614573A publication Critical patent/CN1614573A/en
Application granted granted Critical
Publication of CN1290019C publication Critical patent/CN1290019C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a method for migrating array data of hard disks and a relevant apparatus thereof. The present invention is characterized in that when data in a source hard disk is fragmented and migrated to each hard disk in a hard disk array, all the data fragments to be migrated in the source hard disk are classified to different areas; after a plurality of data fragments of one specific area are respectively written into different hard disks, the data fragments of the next area can be overwritten to the specific area. All the data fragments of the next area are written into each hard disk in a dispersion mode, and only few data fragments can be overwritten to the specific area; therefore, the number of the data fragments of the next area is larger than the number of the data fragments of the specific area so that each area is larger than the previous area under the precondition that migration security is ensured so as to facilitate the management of the migration progress and optimize the reading/writing process of the data.

Description

Carry out the method and the relevant apparatus of hard disk array data migtation
Technical field
The present invention relates to a kind of method and relevant apparatus that carries out the hard disk array data migtation, particularly a kind of can the enhancement by preferable migration progress planning/record and the reading and writing data optimized moves usefulness, guarantees to move safe data migration method and relevant apparatus.
Background technology
Computer system is one of most important hardware foundation of advanced information society, and various data, data, information and knowledge can both manage, handle and store with computer system; Present information manufacturer also endeavours to study various technology, so that computer system can store more multidata, and these data of access more quickly.
In general, existing computer system generally is provided with single hardware with as non-volatile storage device; Yet, along with the hard disk cost reduces, a plurality of hard disks to be installed in computer system to be gone out the practice of a hard disk array with integrated tissue, its feasibility is also more and more higher.In existing technology, there has been multiple different hard disk array framework to be suggested, and even similarly be RAID0, RAID1 redundant cheap hard disk array framework (Redundant Array of Inexpensive Disks), or redundant cheap hard disk array (matrix RAID) framework of matrix form to RAID5 RAID0+1.These hard disk array frameworks can utilize different modes that other storage space in a plurality of hard disks is integrated into one, and obtain some data access and managerial advantage.For instance, the hard disk array under the RAID0 framework, the data that be stored to hard disk array can be divided into a plurality of different data slots (stripe), and different data slots can be interlocked writes to hard disks different in this hard disk array; In the time of will from hard disk array, reading these data, just can from different hard disks, simultaneously the data slot of correspondence be read abreast, and be combined into original data by each data slot again.In other words, in by hard disk array during data of access, in fact as long as simultaneously from the some (data slot just) of each these data of harddisk access, so can realize preferable data access speed and usefulness.In addition, as the hard disk array under the RAID5 framework,, also can store a coordination in addition and check data except disperseing to store the different pieces of information fragment of data with each hard disk in the hard disk array; This makes also this type of hard disk array can not only can also check whether its stored data damage than single hardware access data more quickly, even the data of damaging can also be reverted to correct data.
Though hard disk array has above-mentioned advantage, but because the hardware of hard disk array is built and is set to higherly, existing computer system is all also only built mostly when dispatching from the factory and put a hard disk; If the user has other needs, the hard disk that just can install other in computer system additional is realized out the hard disk array that usefulness is higher with upgrading.When hard disk array is upgraded, except installing hard disk additional, the user also will carry out data migtation (datamigration), so that the data in the original hard disk are read, again according to the upgrading after the hard disk array framework, with data return again deposit to the upgrading after hard disk array.How to assist the user to carry out data migtation, also just become one of research and development emphasis of present information manufacturer.In existing prior art, promptly the data migtation module at the hard disk array development of RAID0 as Intel information manufacturers such as (intel); In computer system, carry out the data transferring module, just can finish data migtation.
Yet, existing data migtation module usefulness is relatively poor, the more time need be expended and just data migtation can be finished, can not finish data migtation fast efficiently, and its range of application is also restricted, though can carry out data migtation to the hard disk array of RAID0, may just can not support fully to the hard disk array of other data frameworks (as RAID5 or the like).
Summary of the invention
Therefore, fundamental purpose of the present invention is promptly to provide that a kind of usefulness is preferable, range of application is wide and can keep the data migration method and the relevant apparatus of data migtation safety, and can assist the user is hard disk array with hard disk upgrade, and overcomes the shortcoming of prior art.
According to a first aspect of the invention, provide a kind of method of in a hard disk array, carrying out data migtation, included source hard disk and at least one member's hard disk in this hard disk array; This method is each hard disk that is used for the data in this source hard disk are disperseed to be stored to this hard disk array.This method includes: data to be migrated are divided into a plurality of data slots in the hard disk of will originating; The storage space of this source hard disk is divided into one can overrides a district and a district to be migrated, make this can override the district and record many data fragments, and record other many data fragments in this district to be migrated; The start address in this district to be migrated is recorded as initial data; Data slot in this district to be migrated is carried out data migtation, make each data slot in this district to be migrated write to member's hard disk respectively or override to the override district of this source hard disk, and make to be written and be less than the number of data slot in this district to be migrated to this number that can override the data slot in the district; After data slot in district to be migrated to this carries out data migtation, if member's hard disk that each data slot in this district to be migrated all is written into a correspondence respectively is this source hard disk maybe, then new an override district is used as in this district to be migrated, and from the data to be migrated of this source hard disk, mark off a new district to be migrated, make this district to be migrated have a plurality of data slots to be migrated; And upgrade this initial data, make this initial data write down the start address in this new district to be migrated.
According to a further aspect of the invention, provide a kind of computer system, it includes: a hard disk array, and it includes source hard disk and at least one member's hard disk, and each hard disk is used to provide storage space with record data; One central processing unit is used for the running of this computer system of master control; And an internal memory, it can store a data migtation module; When this central processing unit is carried out this data migtation module, can make data in this source hard disk disperse to be stored to each hard disk of this hard disk array, and this transferring module include: a planning module; When this central processing unit is carried out this planning module, data to be migrated in this source hard disk can be divided into a plurality of data slots, and the storage space of the hard disk of will originating be divided into one can override the district and a district to be migrated, make this can override the district and record many data fragments, and record many data fragments in addition in this district to be migrated; One zone migration module; When this central processing unit is carried out this zone migration module, can carry out data migtation to the data slot in this district to be migrated, make each data slot in this district to be migrated write to member's hard disk respectively or override to the override district of this source hard disk, and make to be written and be less than the number of data slot in this district to be migrated to this number that can override the data slot in the district; An and logging modle; When this central processing unit is carried out this logging modle, the start address in this district to be migrated can be recorded as initial data, wherein, when this central processing unit is carried out this zone migration module, if member's hard disk that each data slot in this district to be migrated all is written into a correspondence respectively is this source hard disk maybe, then this central processing unit can be used as new an override district with this district to be migrated, from the data to be migrated of this source hard disk, mark off a new district to be migrated again, make this district to be migrated have a plurality of data slots to be migrated, and this central processing unit also can be carried out this logging modle, to upgrade this initial data, make this initial data write down the start address in this new district to be migrated.
As discussed earlier, under various hard disk array frameworks, data can be divided into fragment data, in each hard disk are unit and by access with the fragment data.And when a hard disk upgrade was hard disk array, hard disk originally just can be considered a source hard disk, and other hard disk that installs additional in the hard disk array can be considered member's hard disk; Carry out the purpose of data migtation, originally the data that store in the hard disk of source to be divided into many data slots exactly, and respectively these data slots be redistributed/write to each hard disk (comprising source hard disk and each member's hard disk) in the hard disk array according to the framework of hard disk array.When carrying out data migtation, except data write, also want to take into account data migtation safety, just in data migration process, have no progeny (similarly being to interrupt) because of the power failure that can not expect, correctly restore data migration can factor cause the loss or the damage of data according to the accidental interruption of migration.In the present invention, utilize preferable migration progress planning/record to promote the usefulness of data migtation, keep data migtation safety exactly, and during data migtation, utilize preferable read-write to manage the speed that improves data migtation, shorten the required time of data migtation.
When the present invention carrying out migration progress when planning, be that each data slot data to be migrated in the hard disk of source are ranged each zone (zone) in regular turn, have in each zone a plurality ofly will write (storages) extremely fragment datas of different hard disks respectively; When the present invention when carrying out data migtation, be that an integral body is carried out in regular turn with the zone exactly.After the data slot in j zone all write to each hard disk of hard disk array smoothly in the present invention will originate hard disk, this can be regarded as one once the zone can override the district; When continuing to move the data slot in (j+1) individual zone, the data slot that will write in (j+1) individual zone in the hard disk of source just can override in j zone.Because the data slot in each zone is will be written in the different hard disks of hard disk array, so the data slot number that will write to the source hard disk can be less than the number of all data slots in this zone, also therefore, the size in an inferior zone (number of the data slot that it had) just can be greater than the size in last zone.
For instance, when in the RAID0 of two hard disks hard disk array, carrying out data migtation, the present invention will make each zone in the hard disk of source have the even number data slot, and wherein half will write to source hard disk itself, and second half will write to another hard disk.In this case, if in j zone 2*M data fragment arranged, (j+1) individual zone just can have 4*M data fragment.Because, after all finishing data migtation, the data slot in j the zone (have M data fragment to be write to (j-1) individual zone in the hard disk, source again, M data fragment is written into member's hard disk in addition), to be write to 2*M data fragment of source hard disk in (j+1) individual zone again, just just can be written into j zone, override 2*M data fragment originally in j the zone.By that analogy, just can have 8*M data fragment in (j+2) individual zone, then can have 16*M data fragment in (j+3) individual zone, or the like.In other words, under migration progress of the present invention planning, the size of zones of different (number of the data slot that it had) can be the index kenel to be increased, till the size in zone arrives a suitable threshold value.
Under above-mentioned migration progress planning, the situation that the present invention moves progress control then can be described below.The present invention stores an initial data respectively in each hard disk of hard disk array, be used for writing down the start address of carrying out the zone of data migtation.For instance, when the data slot in j zone carried out data migtation in to the source hard disk, what initial data write down was exactly the start address in j zone; By the time after all data slots in j zone all are written into each hard disk in the hard disk array fully, initial data in each hard disk just can be updated to the start address in (j+1) individual zone, represent j the data slot in the zone can be written, and can begin the data slot in (j+1) individual zone is carried out data migtation, also override to j zone, and the data slot that will write to other member's hard disk in (j+1) individual zone is write to corresponding member's hard disk respectively with regard to the data slot that begins to write to the source hard disk in (j+1) individual zone again.Before the data slot in (j+1) individual zone all being write to corresponding hard disk, initial data can not be updated, and can continue writing down the start address in (j+1) individual zone.After will waiting until that always all data slots in (j+1) individual zone have all been write to smoothly corresponding hard disk respectively, initial data just can be updated to the start address in (j+2) individual zone, the progress of representative data migration will be advanced into (j+2) individual zone, also represents the data slot in (j+1) individual zone can be written.
In other words, the zone that initial data points to is the zone of carrying out data migtation, and the data slot in this zone can never be written, and the last zone in this zone is only the zone that can override.Unless all data slots in a certain zone have correctly been write to each hard disk, initial data all can point to this zone constantly and can not be updated, and has also protected all data slots in should the zone can not be written; All data in this zone have been written into each corresponding hard disk, and initial data just can point to next zone, and original zone also just can become a zone that can override.
Utilize above-mentioned administrative mechanism, the present invention just can keep the safety of data migtation.For instance, when the data in (j+1) individual zone are write to each corresponding hard disk, if take place suddenly to have a power failure the process of data migtation is interrupted, by the time power recovery and restore data when migration again, the present invention just can be according to the address of being put down in writing in the initial data, again first data slot by (j+1) individual zone begins data migtation, just again all data slots in (j+1) individual zone is write to each corresponding hard disk.Because data migration process is interrupted when the individual zone of migration (j+1), initial data can continue writing down the start address in (j+1) individual zone; When data migtation will be recovered again by the time, just can come the judgment data migration to interrupt according to initial data in which zone.The more important thing is, because initial data points to (j+1) individual zone, so after data migtation was recovered again, all data slots in (j+1) individual zone (no matter have moved or not migration) all also were not written, this also makes data can factor not run off according to the migration accidental interruption or damage.
It should be noted that in the present invention ground increases even the size of zones of different can be the index kenel, above-mentioned migration progress control mechanism still can be guaranteed the safety of data migtation, can can't not keep migration safety because the zone that will move is big.In fact, bigger area dividing can reduce the update times of initial data, helps to promote the usefulness of data migtation of the present invention.Because initial data wants to continue the start address of posting field during power breakdown, reasonably one of selection is recorded in it in each hard disk of hard disk array exactly, does non-volatile storage.Yet if initial data will be upgraded in zone of every migration again in each zone all very little (having less data slot), that certainly will will upgrade the initial data in each hard disk continually in whole data migration process, cause the consumption of usefulness.But in fact, regional planning among the present invention can allow zones of different be the index kenel to be increased, bigger regional planning just can reduce the number of times that upgrades initial data during the data migtation, under the situation of taking into account data migtation safety, can also promote the usefulness of data migtation.
In addition, in the process of data migtation, the present invention also can adopt the read-write of optimization to manage increases usefulness.When in data origin source hard disk, moving to each hard disk of hard disk array, to read in elder generation's data slot origin source hard disk that each is to be migrated, write to each hard disk more respectively.As be familiar with known to the operator, control hard disk and read or write data, will send reading of specific format or write instruction to hard disk; And in the in the industry cycle existing order format that generally adopts, read or write instruction once the data of institute's energy access its upper limit is all arranged.For instance, in the substandard instruction of existing ATA (Advanced Techno1ogy Attachment), maximum may command one hard disks of reading command read the data of 128K byte, and one writes instruction and the data of 128K byte can be write to a hard disk at most.Read or write instruction and all will consume suitable time and system resource owing to hard disk is sent at every turn, so in data migration process, preferably can make full use of the chance of sending the read/write instruction each time, in each read/write instruction, read or write as far as possible the data of more (at most), write/the required number of times of reading command with minimizing.In existing Data Transference Technology, can waste and send the chance that writes instruction at every turn because yielding to the hard disk array framework; For instance, when prior art will be moved the 256K byte in the RAID0 of one two hard disk hard disk array, can send 128K byte reading command to the source hard disk earlier, according to the data framework of RAID0 the 128K byte of reading is divided into the part of two 64K bytes immediately, simultaneously writing instruction with two 64K bytes writes to the data of each 64K byte of two parts respectively in two hard disks, send the reading command of another 128K byte again, write the data of the other 128K byte of instruction migration equally with two 64K bytes.Moved the data of 256K byte, prior art amounts to divide sends six read/write instructions for four times.
In comparison, the read-write administrative skill of optimization of the present invention will repeat reading command earlier and read abundant data with accumulation, so that write more data in the instruction writing at every turn, makes full use of each and writes instruction.Same data of in the RAID0 of two hard disks hard disk array, moving the 256K byte, meeting of the present invention is sent twice 128K byte reading command read the 256K position with accumulation data to the source hard disk earlier, the instruction that writes of sending two 128K bytes more simultaneously writes to two hard disks respectively with two parts of 256K byte, amounts to only need divide to send the data migtation that four read/writes instructions can be finished the 256K byte for three times.Utilize read-write management optimization technology of the present invention, the present invention just can further promote the usefulness and the speed of data migtation, reduces the system resource and the time of required consumption in the data migration process.
The above-mentioned technical characterictic of the present invention is except being applicable to the hard disk array data migtation of RAID0, can also promote the use in the hard disk array framework of other kind with parallel mode access separate data, similarly be the redundant cheap hard disk array framework of RAID0+1, RAID5 or matrix form, high-effect under these frameworks, to carry out, save time, safety data migtation.
Description of drawings
Fig. 1 unifies the synoptic diagram of embodiment for department of computer science of the present invention.
Fig. 2 carries out the schematic flow sheet of data migtation for computer system among Fig. 1.
Fig. 3 is the synoptic diagram of RAID0 hard disk array DATA DISTRIBUTION before and after data migtation of one or two hard disk.
What Fig. 4 and Fig. 5 illustrated is the situation that the present invention's hard disk array in Fig. 3 carries out the planning of migration progress.
Fig. 6 to Figure 10 signal be the situation of the present invention when hard disk array carries out data migtation in Fig. 3.
What Figure 11 to Figure 12 illustrated is the situation of the present invention's hard disk array restore data migration in Fig. 3.
What Figure 13 illustrated is the present invention implements read-write optimum management when hard disk array carries out data migtation in Fig. 3 situation.
Figure 14 is the synoptic diagram of RAID0 hard disk array DATA DISTRIBUTION before and after data migtation of a N hard disk.
What Figure 15 and Figure 16 illustrated is the situation that the present invention's hard disk array in Figure 14 carries out the planning of migration progress.
What Figure 17 to 19 illustrated is the situation that the present invention's hard disk array in Figure 14 carries out data migtation.
What Figure 20 illustrated is the present invention implements read-write optimum management when hard disk array carries out data migtation in Figure 14 situation.
Figure 21 tabular be the present invention carries out data migtation progress planning under the hard disk array of different frameworks situation.
Figure 22 is the synoptic diagram of the hard disk array DATA DISTRIBUTION before and after data migtation under the RAID0+1 framework.
Figure 23 is the synoptic diagram of hard disk array DATA DISTRIBUTION before and after data migtation of a RAID5 framework.
What the 24th to 26 figure illustrated is the situation that the present invention's hard disk array in Figure 23 carries out data migtation.
What Figure 27 illustrated is the situation of the redundant cheap hard disk array of matrix form DATA DISTRIBUTION before and after data migtation.
The element numbers explanation
10: computer system 12: central processing unit
14: chipset 16: hard disk array controller
18: internal memory 20: the data migtation module
22A: planning module 22B: zone migration module
22C: read-write administration module 22D: logging modle
22E: recover module 100: flow process
102-116: step HD (0)-HD (N-1): hard disk
G (.): the S of group (.) (.): data slot
Z (.): regional P (.): check data
D0, D, D1-D2: data M SA: initial data
Embodiment
Please refer to Fig. 1; Fig. 1 is the synoptic diagram of computer system 10 1 embodiment of the present invention.Be provided with a central processing unit 12, a chipset 14, a hard disk array controller 16, an internal memory 18 (similarly being DRAM (Dynamic Random Access Memory)) and a plurality of hard disk HD (0), HD (1) in the computer system 10 to HD (N-1).Central processing unit 12 executable programs, operational data and deal with data, and the running of host computer system 10; Internal memory 18 promptly is used for required program code and related data during temporary central processing unit 12 runnings, data.Hard disk array controller 16 is provided with a plurality of bus channel (channel), and each channel is connected to a hard disk respectively, makes hard disk array controller 16 be integrated the data access of these hard disks of control, and these hard disk groups are woven to a hard disk array.Chipset 14 then is used for managing the data contact transmission between central processing unit 12, internal memory 18 and hard disk array controller 16 (and other peripheral circuit).Wherein, hard disk array controller 16 can be integrated into one with chipset 14, perhaps, hard disk array controller 16 also can be (similarly to be the PCI auxiliary insert card with auxiliary insert card, PCI is peripheral communication interconnect), be connected to chipset 14 with the interface (similarly being pci interface) that sees through auxiliary insert card.
In computer system 10, Data Transference Technology of the present invention can utilize the data migtation module 20 of a software to realize; When the user will upgrade to hard disk array with single hardware, just can control computer system 10 and make central processing unit 12 begin to carry out data transferring module 20, data be moved, are dispersed to each hard disk of hard disk array by original single hardware (hard disk of promptly originating) with the framework (RAID0, RAID0+1 or RAID5 or the like) of foundation hard disk array.Can be provided with a planning module 22A, a zone migration module 22B, a read-write administration module 22C, a logging modle 22D and a recovery module 22E in the data migtation module 20.But carry out the progress of planning module 22A layout data migration; In the present invention, be with the source hard disk in data separation to be migrated be zones of different, and be that an integral body is carried out data migtation with the zone, after the data in the zone are finished migration correctly, just can move the data in time zone again, and the storage space of different sizes can be contained in each zone, and planning module 22A can determine the size in each zone.During execution area transferring module 22B, central processing unit 12 just can see through chipset 14/ hard disk array controller 16 and actual instruction of sending read/write to each hard disk, with the data in zone of actual migration.When execution area transferring module 22B, read-write administration module 22C can optimize the process of read/write, make each write instruction all can write more (at most) in hard disk data as far as possible, to make full use of each time hard disk is sent the chance that writes instruction, promote the usefulness of data migtation further.
After the data of migration in one zone, logging modle 22D can be recorded in initial data, the progress of representative data migration with start address that should the zone; In preferred embodiment of the present invention, initial data will be replicated and be stored in each hard disk, make and all store the identical initial data of a content in each hard disk.When having moved the data in the zone, initial data will be updated and write down the start address in a time zone; According to the initial data that upgrades, zone migration module 22B just can begin to move the data in time zone.Because initial data has been stored in each hard disk, if data migtation module 20 interrupts carrying out Halfway Stopping data migtation, when data migtation module 20 is performed once again by the time, recovery module 22E just can read the initial data in each hard disk once again, coming judgment data migration to proceed to which zone according to initial data, and make zone migration module 22B proceed uncompleted data migtation from this zone.
Please refer to Fig. 2 (and Fig. 1), computer system 10 is carried out data transferring module 20 and is carried out the process of data migtation with technology of the present invention, can further describe with the flow process among Fig. 2 100; The following step is arranged in the flow process 100:
Step 102: begin to carry out data migtation.When the user is extended for the hard disk array of many hard disks with single hardware, just can make computer system 10 carry out flow process 100 to carry out data migtation, data are distributed according to the framework of hard disk array by original hard disk (hard disk of promptly originating) migrates to each hard disk.In addition, flow process 100 also can in have no progeny and carry out again again.For instance, during computer system 10 was being carried out flow process 100, the user may temporarily be interrupted flow process 100 because of certain reason (as carrying out other high preferential program), or had interrupted flow process 100 because of unpredictable accident (as having a power failure).In have no progeny, the user still can make computer system 10 carry out flow process 100 again, the data migtation of interrupting before continuing.
Step 104: the initial data of access data migration.If formerly do not carry out beginning flow process 100 under the situation of any data migtation, just can be in this step initial data of initialization, make this initial data write down the start address of data to be migrated; In preferred embodiment of the present invention, this initial data can be replicated each hard disk that is stored in the hard disk array, makes each hard disk all store the identical initial data of content.If before carried out flow process 100 but interrupted midway, should store initial data in each hard disk, wait and carry out flow process 100 again and when arriving this step, just can be by reading this initial data in the hard disk.
Step 106: plan zone to be migrated according to initial data.Described as the front, in various hard disk array frameworks, data can be divided into the data slot of a plurality of fixed sizes (can be 4K, 8K or 16K byte) and disperse to be stored in each hard disk.So when carrying out data migtation, the data in the hard disk of source also can be divided into data slot; Each data slot in the hard disk of source is write to its pairing hard disk according to the framework of hard disk array, also just finished data migtation.After data to be migrated are divided into each data slot, the present invention also can range same zone with a plurality of data slots that will migrate to different hard disks respectively, and then all data that will move are divided into a plurality of zones, and be that an integral body is carried out data migtation with the zone.In preferred embodiment of the present invention, can have the data slot of different numbers in the zones of different; And in this step, just can cook up zone to be migrated, and can plan to have what data fragments in the zone to be migrated according to the start address that initial data points to.
Step 108: the data slot in the zone to be migrated is disperseed to write to each hard disk in the hard disk array, just will read in the data slot origin source hard disk in the zone to be migrated, and redistribute/write to different hard disks.Under migration progress planning of the present invention, it is to migrate to source hard disk itself that the partial data fragment all can be arranged in each migration zone, and the data slot of other parts then will write to other hard disk.And those data slots that will migrate to source hard disk itself just can be written into the last zone in zone to be migrated, just the last zone in zone to be migrated are considered as one and can override the district.
When carrying out this step, in order to promote the usefulness of data read/write, the read-write management that the present invention can implement to optimize is to give full play to the benefit of each read/write instruction.As discussed earlier, when hard disk being sent the read/write instruction, the data that each instruction can read/writes have an extreme value (for example being the 128K byte); All can consume suitable time and system resource owing to send the read/write instruction to hard disk each time, so should make full use of the chance of sending instruction each time, read/write avoids sending continually the read/write instruction near the data of extreme value in each read/write instruction as far as possible.And in preferred embodiment of the present invention, the read-write management of optimizing is to repeat a plurality of reading command earlier to read more data with accumulation from zone to be migrated, the data that will write to a certain hard disk have by the time been accumulated and have been approached to the extreme value that writes that writes instruction, just write instruction with one the data of these accumulations are write to this hard disk.Like this, just can be apt to, and then promote the usefulness of data migtation with each read/write instruction.
Step 110:, just can proceed to step 112 if in step 108, the data slot in the zone to be migrated has been write corresponding hard disk respectively; If step 108 is interrupted and failed successfully all data slots in the zone to be migrated to be write to respectively corresponding hard disk, process ends 100 with regard to proceeding directly to step 116.Interrupt even it should be noted that step 110, the start address in zone to be migrated still has been recorded in the initial data (being step 104).When carrying out flow process 100 once again next time, just can find out zone to be migrated once again, and proceed data migtation according to initial data.
Step 112: judge whether that data are not moved in addition.If also have the not data of migration, just proceed to step 114 once again; If all data to be migrated all are dispensed to each hard disk according to the hard disk array framework in the hard disk of source, just can proceed to step 116.
Step 114: after having moved the data slot in last zone, if also have the not data of migration in the hard disk of source, just can upgrade the initial data in each hard disk, the start address of follow-up not migration data is recorded in the initial data of each hard disk, and proceed to step 106, in the data of not migration, cook up not migration zone once again, carry out the data migtation in a time zone.
Step 116: process ends 100.
In order to further specify the situation that the present invention carries out data migtation, below inciting somebody to action first RAID0 hard disk array with two hard disks is example, the present invention carries out data migtation under this kind hard disk array situation is described, again technical spirit of the present invention is extended to the RAID0 hard disk array of N hard disk, so the data migtation under other hard disk array framework.
Please refer to Fig. 3 (and in the lump with reference to figure 1); Suppose that the computer system 10 among Fig. 1 is provided with two hard disks (N=2), what Fig. 3 illustrated is exactly the situation of RAID0 hard disk array before and after data migtation of two hard disks.Before data migtation, hard disk HD (0) is the source hard disk, and hard disk HD (1) then is the member's hard disk that installs additional.As discussed earlier, under the hard disk array framework of RAID0, data are that the form with data slot is interspersed in each hard disk of hard disk array; Access data in hard disk array just is equivalent to each data slot of access abreast in each hard disk.Just as shown in Figure 3, before data migtation, data in source hard disk HD (0) can be divided into S0 (0), S0 (1), S1 (0), S1 (1), S2 (0), S2 (1) data slot to Sm (0), Sm (1) or the like in regular turn, and the purpose of data migtation is distributed to these data slots among hard disk HD (0) and the HD (1) exactly alternately.For instance, data slot S1 (0), S2 (0), these data slots that just are stored in hard disk HD (0) originally of S3 (0) will migrate to other address of hard disk HD (0), and data slot S0 (1), S1 (1), S2 (1), S3 (1) etc. then will be migrated to member's hard disk HD (1).For the convenience of follow-up discussion, below will be being classified as same group by the data slot of parallel access in the hard disk array.As shown in Figure 3, be respectively first data slot of hard disk HD (0), HD (1) in data slot S0 (0), the hard disk array of S0 (1) after data migtation, be distributed in " same one deck " in the data array, can be by access simultaneously abreast, so can be categorized in the same G of group (0).In like manner, data slot S3 (0), S3 (1) can be sorted in the same G of group (3), and data Sm (0), Sm (1) can be sorted in the G of group (m).
The example of continuity Fig. 3 please refer to Fig. 4 and Fig. 5.Fig. 4 is that the present invention carries out migration progress planning and the synoptic diagram of cooking up zones of different in data to be migrated; Fig. 5 then tabular group number and the data slot number that is had in each zone among Fig. 4.As shown in Figure 4, in preferred embodiment of the present invention, the regional Z of first of data to be migrated (0) can have a G of group (0), second regional Z (1) also has a group, and the size in ensuing each zone just can be the increase of index kenel ground, can have two groups as regional Z (2), and inferior can have four groups once regional Z (3), next regional Z (4) can have eight groups again, by that analogy.Fig. 5 has then concluded group number that each zones of different had respectively and data slot number; Arrived regional Z (j), just can have the individual group of 2^ (j-1), just 2^j data fragment (two data fragments are arranged in every group).
By the real process of data migtation, can further understand the mode that every technology realizes among the principle of regional planning of the present invention and the present invention.Example among continuity Fig. 3 please refer to Fig. 6 to Figure 10 (and in the lump with reference to figure 2); When flow process 100 begins to carry out, Fig. 6 to the 10 promptly is used for exemplary flow 100 respectively and proceeds to the situation of different phase.As shown in Figure 6, when the flow process among Fig. 2 100 started anew, each hard disk HD (0), HD (1) can store an initialized initial data MSA (step 104), and this initial data MSA just points to the start address of data to be migrated; Owing to also moved without any data, first regional start address, the just start address of all data to be migrated among the hard disk HD (0) so the start address among the initial data MSA is originated exactly.Proceed to step 108, the data slot S0 (1) that will be migrated to member's hard disk HD (1) among the zone Z (0) will be read out from source hard disk HD (0), write (storage) again to member's hard disk HD (1), be equivalent to data slot S0 (1) is copied to hard disk HD (1) by hard disk HD (0).Contrast Fig. 3 as can be known, after data migtation, the address of data slot S0 (0) is exactly that it is by the address before the migration, so do not need in Fig. 6 its affected any migration.
If smoothly data slot S0 (1) is copied to hard disk HD (1), just finished the migration of regional Z (0), and flow process 100 just can proceed to step 114 via step 110,112.As shown in Figure 7, arrived step 114, the initial data MSA in two hard disks can be updated to the start address of regional Z (1), represents regional Z (1) for new district to be migrated, and last regional Z (0) just can be considered one and can override the district.When proceeding to step 108 once again,, be used for the place of storage data fragment S0 (1) among the hard disk HD (0) originally just can be used for data slot S1 (0) among the storage area Z (1) because the data slot S0 (1) among the regional Z (0) has been copied to hard disk HD (1); So, be equivalent to data slot S1 (0) is duplicated/overrides to regional Z (1) in that regional Z (1) when moving, is read data slot S1 (0) and override the data slot S0 (1) to regional Z (0) exactly.Simultaneously, the data slot S1 (1) among the regional Z (1) also can be read out and write among the hard disk HD (1), is equivalent to data slot S1 (1) is copied among the hard disk HD (1).When the data slot among the regional Z (1) was carried out above-mentioned migration, initial data MSA can not be changed/upgrade.
After smoothly the data slot S1 (0) among the regional Z (1), S1 (1) being copied to corresponding hard disk, flow process 100 proceeds to step 114 again once again.As shown in Figure 8, when proceeding to step 114 once again, the initial data MSA among hard disk HD (0), the HD (1) upgrades again once again, points to the start address of a time regional Z (2), just make regional Z (2) become zone to be migrated, and last regional Z (1) just become and can override the district.Because regional Z (1) data slot S1 (0), S1 (1) originally has been copied to corresponding hard disk, data slot S2 (0), the S3 (0) that will migrate to source hard disk itself among the zone Z (2) just can override to regional Z (1), and two other data slot S2 (1), S3 (1) then will be copied to hard disk HD (1).Here it may be noted that owing among the regional Z (1) two data slots that can override are arranged, just can be assigned two groups among the regional Z (2); This is because have only a data fragment can be written into regional Z (1) (another will be written into member's hard disk) in each group, so in regional Z (1) two can override data slot just can be corresponding to two groups among the regional Z (2), making regional Z (2) can be that the twice of regional Z (1) is big.
Smoothly four data fragments among the regional Z (2) are copied to respectively (step 108) behind the corresponding hard disk, flow process 100 can proceed to step 114 once again, to move each data slot among time regional Z (3).As shown in Figure 9, initial data MSA in each hard disk can be updated to the start address of regional Z (3), and four data fragments among the regional Z (2) also just become the data slot that can override, but data slot S4 (0), S5 (0), S6 (0) and the S7 (0) among the housing region Z (3) just; Other four data fragment S4 (1), S5 (1), S6 (1) and S7 (1) then will be copied among the hard disk HD (1) according to the hard disk array framework.Similarly, owing to vacated four data slots that can override among the regional Z (2), so just can be assigned four groups among the regional Z (3); It is big that this makes that also regional Z (3) becomes the twice of regional Z (2), and four times of just regional Z (1) are big.The cumulative trend of each area size can be understood among observation the present invention, except first regional Z (0), several data slots is arranged in the last zone, and the group of same quantity just can be arranged in one zone, back; This also makes the size in each zone among the present invention can present the growth of index kenel, as institute's tabular among Fig. 5.
After each data slot of regional Z (3) is copied to corresponding hard disk respectively, as shown in figure 10, the initial data MSA that stores in each hard disk can upgrade once again again and point to the start address of regional Z (4), to move 16 data fragments among the regional Z (4), wherein have 8 data fragments can be replicated/override to last regional Z (3), 8 data fragments can be copied to member's hard disk HD (1) in addition.Move each follow-up zone in regular turn according to the similar practice, finally just can finish the migration of all data.As shown in figure 10, when proceeding to the stage of Figure 10, data slot S0 (0) has all interlocked according to the requirement of hard disk array framework to S7 (0), S0 (1) to S7 (1) and has been dispensed to two hard disks.
The situation of safeguarding migration safety as for the present invention during data migtation can be described below.The example of continuity Fig. 3 please refer to Fig. 9, Figure 11 and Figure 12.Suppose to interrupt when flow process 100 proceeds to the stage of Fig. 9, the situation that each data slot distributes during interruption then as shown in figure 11; Wherein, data slot S4 (0), S5 (0), S4 (1), S5 (1) are copied to corresponding position smoothly, but also have the data slot of the G of group (6), G (7) not move among the regional Z (3).Because flow process 100 is interrupted when regional Z (3) is carried out data migtation, so the start address in each hard disk still points to regional Z (3).As shown in Figure 11, though data migtation is interrupted when proceeding to regional Z (3), all data slots among the regional Z (3) all were not written; Data slot among the zone Z (2) may be written, or even damage because of the undesired interruption of the process of overriding, but the data slot among the regional Z (2) is copied to the correspondence position of each hard disk already, no matter the state of each data slot how among the regional Z (2), as long as the data slot among the regional Z (3) is not written and complete preservation, the process of data migtation just can be recovered.By the time flow process 100 is carried out once again and is wanted extensive many during according to migration, and its operation situation just as shown in figure 12; According to the initial data MSA of non-volatile preservation in the hard disk as can be known, data migtation is to proceed to regional Z (3) (step 104 among Fig. 2), and flow process 100 will be begun to move again all data slots of regional Z (3) by the initial address of regional Z (3), with data slot S4 (0), S5 (0), S6 (0) and S7 (0) override to regional Z (2) (no matter whether these data slots have successfully been write to regional Z (2) before interruption) again, simultaneously also again with data slot S4 (1), S5 (1), S6 (1) and S7 (1) write to hard disk HD (1) (no matter whether these data have successfully been write hard disk HD (1) before interruption) again.Like this, the process of data migtation just can be recovered again by regional Z (3) beginning, does not have the damage and the loss of any data.
By the example of Figure 11, Figure 12 as can be known, when initial data point to certain regional Z (j) and the migration regional Z (j) data slot the time, the present invention can not override the data slot of regional Z (j), only the data among the regional Z (j) can be duplicated and is override to last section Z (j-1); So the interruption of transition process only can have influence on the data slot among the regional Z (j-1).And by flow process 100 as can be known, when initial data points to regional Z (j) by regional Z (j-1), just represent the data slot of the script storage of regional Z (j-1) to copy to corresponding hard disk smoothly, so regional Z (j-1) is no matter be subjected to influence how, its original data can not run off or damage, data slot in also can range of influence Z (j), also therefore, the present invention is able to the data security during the service data migration.Even it should be noted that the big I in each zone among the present invention is the index kenel and increases, but by above-mentioned discussion as can be known, the safety of data migtation still can be guaranteed, can not increase the safety that influences data migtation because of the zone.In fact, the usefulness of data migtation also can be promoted in the zone that the index kenel increases, because the present invention will upgrade initial data MSA in each hard disk behind each zone of migration, necessity that initial data is updated can be reduced in the zone that increases, and has also just promoted usefulness in the equivalence.In addition, except the progress of record data migration, the information that writes down among the initial data MSA also can assist computer system to understand the configuration of hard disk array; For instance, the ROM-BIOS of computer system (BIOS, basicinput/output system) just can be judged the situation of hard disk array via initial data MSA in when start, similarly is load operation system program or the like from hard disk array how.
Have no progeny in considering and recover the required time, the present invention can set a suitable threshold value to the size in each zone.By the discussion of Figure 11, Figure 12 as can be known, when data migration process was interrupted in certain zone, all data slots in this zone were moved in meeting of the present invention again when data migtation is recovered.If this zone is excessive, moving this zone again may just need the suitable time; For fear of this kind situation, the size in each zone can have the threshold value of a upper limit, for example is 1% of source hard-disk capacity.Certainly, this threshold value can be adjusted according to circumstances, and for instance, if the chance that data migration process is interrupted seldom, or the user do not mind long release time, and this threshold value just can increase, and for example is 5% or the like of the hard-disk capacity of originating.
The example of continuity Fig. 3 please refer to Figure 13; Figure 13 signal to be the present invention implement to optimize the situation of read-write management therebetween the time in data migtation.By Fig. 6 to Figure 10 as can be known, when data migtation is carried out in each zone, can relate to many read/write runnings, comprise data slot origin source hard disk to be migrated is read, and write to corresponding hard disk.In order to promote the usefulness of read-write running, the read-write management that the present invention can be optimized.As discussed earlier, when a hard disk being sent read/write instruction, the size of data of its read/write has an extreme value, for example is the 128K byte.All can consume suitable time and system effectiveness owing at every turn hard disk is sent the read/write instruction,, make the data that each read/write instruction can read/write more (or maximum) as far as possible so should make full use of each read/write instruction.At the drawing left of Figure 13, demonstration be exactly the read-write process of not optimizing in the prior art; Suppose in the RAID0 of two hard disks hard disk array, to move the data of 256K byte, this moment, prior art can be sent a 128K byte reading command to the source hard disk earlier, read the data of 128K byte, again according to RAID0 hard disk array framework, the 128K byte is divided into two parts of each 64K byte, writes instruction with two 64K bytes simultaneously these two-part data are write to two hard disks respectively.Repeat above-mentioned " 128K byte reading command-two a 64K byte reading command ", just can finish the data migtation of 256K byte.
Observe existing read-write process as can be known, prior art does not make full use of and writes instruction, because one writes the data that instruction can write the 128K byte at most, but prior art has only write the data of 64K byte.Write instruction in order to make full use of each, the present invention can adopt right-hand optimization read-write process of Figure 13 drawing, repeat the reading command of two 128K bytes earlier, the data of 256K byte are read in the hard disk accumulation of origin source, according to the hard disk array framework 256K byte is divided into two parts of each 128K byte again, and simultaneously the data of 128K byte are write to corresponding hard disk respectively with the instruction that writes of two 128K bytes, finish the data migtation of 256K byte.Be the data of migration 256K byte in the hard disk array of two hard disks equally, prior art need be divided and sent the instruction of six read/writes for four times, optimization of the present invention read-write process only need be divided and sent four read/writes instructions for three times, so the present invention can promote the read-write usefulness in the data migration process further, shorten the required time of data migtation.
Basically, just as discussed earlier, the present invention is that an integral body is carried out data migtation with " zone "; That is to say, the present invention is when reading each data slot in a certain zone and write to corresponding hard disk, can not read the data slot of zones of different in same reading command, the data slot of zones of different is bound to read in the hard disk of origin source with different reading command.Because, when data migration process is interrupted during this reading command is carried out, can't the specified data transition process be when that zone is moved, to interrupt just if can read the data slot of zones of different in the same reading command.When flow process 100 of the present invention has just begun to carry out, initial several zones are all very little, as regional Z (0), Z (1) two data fragments (can with reference to figure 5) are only arranged, each data slot is generally 4,8 or the 16K byte, so a single reading command just can be read all data slots.But,, just can highlight the advantage that the present invention optimizes the read-write management more along with the size in each zone is the growth of index kenel.For example, regional Z (5) has 16 data fragments, if each data slot is the 16K byte, regional Z (5) just has the data of 256K byte, can utilize the optimization read-write process among Figure 13 to quicken its data migtation.Regional Z (5) each zone afterwards can become big more more, just more can bring into play the advantage of optimization read-write management.
In Fig. 3 to Figure 13, be that the RAID0 hard disk array with two hard disks is that example is discussed every ins and outs of the present invention.Below will promote application of the present invention, the present invention carries out data migtation under the RAID0 of N hard disk hard disk array situation will be discussed.Please refer to Figure 14, shown in Figure 14 is exactly the situation of RAID0 hard disk array data allocations before and after data migtation of N hard disk.Before the data migtation, data storing is in source hard disk HD (0); Install member's hard disk HD (1) additional to HD (N-1) and after forming a hard disk array, the data in the hard disk of source will be divided into a plurality of data slots and staggered each hard disk that is allocated in.As shown in figure 14, the data slot S0 (0) that is divided out among the source hard disk HD (0) understands to S0 (N-1) be reassigned to hard disk HD (0) to HD (N-1) after data migtation, forming in hard disk array can be by the data slot of parallel access with one deck, and this N data fragment just can be sorted in the same G of group (0).In like manner, data slot Sm (0) to Sm (N-1) can after data migtation, become with one deck by the data slot of parallel access, this N data fragment just can be categorized in the same G of group (m).
The example of continuity Figure 14 please refer to Figure 15 and Figure 16; Figure 15 signal be the synoptic diagram that the present invention carries out regional planning, Figure 16 then tabular the size in each zone, just each zone group number that can have and the number of data slot.By Figure 15, Figure 16 as can be known, be generalized to the example of N hard disk, the size in each zone still can be the index kenel and increase.Basically, there is a data fragment (data slot S0 (0) just) to be moved among the zone Z (0), so regional Z (0) has (N-1) individual data fragment and can override after data migtation, also therefore, regional Z (1) just can have (N-1) individual group; Because have only a data fragment can be written into regional Z (0) in each group, other data slot can be written into other member's hard disk, so (N-1) that be available among the regional Z (0) individual data slot that overrides just can be corresponding to (N-1) the individual group among the regional Z (1).According to identical principle, if M the data slot that can override arranged among the last regional Z (j), inferior can have M*N group (M*N*N data fragment just) once regional Z (j+1), forms the trend that each area size index kenel increases, as shown in figure 16.Discussed as the front, considering has no progeny in the data migtation recovers the required time, and the present invention can set a threshold value to the size in zone, for example is 1% of source hard-disk capacity; In other words, the size of zone Z (j) is exactly: the total volume of the individual data fragment of min{ (N-1) * (N^j), threshold value }, just between " threshold value " and " (N-1) total volume of the individual data fragment of * (N^j) ", get the size that a smaller value decides regional Z (j).
Please refer to Figure 17 to Figure 20; The example of continuity among Figure 14, Figure 15, the 17th to Figure 19 has just illustrated the hard disk array of 100 pairs of N the hard disks of flow process just among Fig. 2 of the present invention to carry out the process of data migtation.At first, as shown in figure 17, data migtation begins, and the initial data MSA in each hard disk points to the start address of regional Z (0), and begin with each data slot S0 (1) among the regional Z (0) to S0 (N-1) duplicate respectively (writing) to hard disk HD (1) to HD (N-1); Data slot S0 (0) then need not move.Next, as shown in figure 18, after smoothly the data slot S0 (1) among the regional Z (0) being copied to each member's hard disk to S0 (N-1), initial data MSA will be updated, point to a time regional Z (1), begin regional Z (1) is carried out data migtation, and last regional Z (0) just becomes and can override the district, the data slot S0 (1) in it just can be override to S (N-1) (0) by first data slot S1 (0) of (N-1) individual group among the regional Z (1), S2 (0) to S0 (N-1).Simultaneously, the data slot S1 (1) of each group, S2 (1) can be copied to hard disk HD (1) to S (N-1) (1) among the regional Z (1), by that analogy; Data slot S1 (N-1), S2 (N-1) (N-1) then can be copied to hard disk HD (N-1) to S (N-1).
All be copied to after the corresponding hard disk etc. all data slots of (N-1) individual group among the regional Z (1), the individual data fragment of N* (N-1) among the regional Z (1) just becomes the data slot that can override.Accept the situation of Figure 18, the data migration process of more vague generalization (general) can be represented with Figure 19.Suppose that regional Z (j) has M group, a M*N data fragment, regional Z (j+1) just can have M*N group (being that the G of group (m+1) is to G (m+M*N)), the individual data fragment of M* (N^2).When data migration process proceeds to regional Z (j+1), initial data MSA points to regional Z (j+1) and has write down the start address of district Z (j+1), and the process of data migtation, exactly the G of group (m+1) first data slot (M*N altogether) to the G (m+M*N) is duplicated/overrides to regional Z (j), simultaneously also the G of group (m+1) is copied to hard disk HD (1) to second the data fragment (M*N altogether) among the G (m+M*N), by that analogy; N the data fragment (altogether M*N) of the G of group (m+1) to the G (m+M*N) then is copied to hard disk HD (N-1).In zones of different, carry out data migtation in regular turn according to Figure 19, just can finish all data migtations.
The example of continuity Figure 14, the present invention is optimized the read-write management in the hard disk array of N hard disk situation then is illustrated in Figure 20.In the existing read-write process of not optimizing, after the source hard disk sends a reading command, just divide at every turn and write to each hard disk, so each writes the data that instruction all only writes minority with the data that are about to read; Finish the data migtation of N*128K byte, existing read-write process may need branch to send the individual read/write instruction of N* (N+1) for 2*N time.In comparison, the present invention can repeat to send many reading command to the source hard disk earlier, and after accumulative total was read more data, just the data write-once that accumulative total is read was to corresponding hard disk.Will finish the data migtation of N*128 byte equally, the present invention only need divide the instruction of (N+1) inferior 2*N of sending read/write, and by to writing making full use of of instruction, the present invention just can save considerable time and system resource during data migtation.Certainly, the present invention not necessarily will accumulate N reading command and just send and write instruction, and the visible system resource is adjusted the mode that reads of optimizing.For instance, accumulate the data available buffer of obtaining and be temporarily stored in the internal memory owing to repeat repeatedly reading command, how many storage resources are reading command repeatably number of times just can provide relevant with internal memory.If the user also will carry out other program in data migration process, just can suitably reduce the number of times that reading command repeats, the required memory source that takies of minimizing data migtation.Basically, as long as can repeat the data that the reading command accumulation is read, just can be better than the existing read-write process of not optimizing.
Except the hard disk array of RAID0, spirit of the present invention also can promote the use the hard disk array framework in other kind, similarly is redundant cheap hard disk array (matrixRAID) framework of RAID0+1, RAID5 and matrix form.Please refer to Figure 21; Progress and regional planning situation are moved in being of Figure 21 tabular when the present invention carries out data migtation under the hard disk array of different frameworks.In the hard disk array of different frameworks, the flow process 100 that the present invention still can continue to use among Fig. 2 is carried out data migtation, and only the planning meeting of each zone, group is slightly different.When carrying out data migtation, each data slot that the present invention still will originate in the hard disk classifies as different groups in regular turn, and each group is categorized in each zone in regular turn, the data slot number that is had in each zone, each group, with regard to tabular in Figure 21.Figure 21 is very similar to Figure 16; When extending to various different hard disk array framework, a group fixedly has Q data fragment, and the size in each zone then forms the index kenel with the power of K and increases.Under the framework of RAID0 (with the redundant cheap hard disk array of matrix form), constant Q just equals the number of hard disk in the hard disk array, just N.Under the hard disk array framework of RAID0+1, constant Q just equals hard disk number half (hard disk array that will form RAID0+1 must have the even number hard disk) in the hard disk array.Under the hard disk array framework of RAID5, constant Q equals then that the hard disk number subtracts 1 in the hard disk array.Below incite somebody to action bright the present invention for instance carries out data migtation under different hard disc archetectures situation.
Please refer to Figure 22.Figure 22 signal be the situation of a RAID0+1 hard disk array that forms by four hard disks in data migtation front and back DATA DISTRIBUTION; Wherein, hard disk HD (0) is the source hard disk, and HD (1) is to the member hard disk of HD (3) for increasing newly.Basically, the RAID0+1 hard disk array is a hard disk array of forming two RAID0 respectively with the hard disk of half number separately, and one of them RAID0 hard disk array is the mirror back-up of another RAID0 hard disk array.As shown in figure 22, hard disk HD (0) and HD (1) form a RAID0 hard disk array, and other hard disk HD (2) is used for backing up the data among the hard disk HD (0), and hard disk HD (3) then is used for backing up the data among the hard disk HD (1).So, when Data Transference Technology of the present invention being promoted the use (N is an even number), just be equivalent in (N/2) individual hard disk, carry out the data migtation of RAID0 hard disk array in the RAID0+1 of N hard disk hard disk array.This just among Figure 21 with the reason of Q=(N/2).Picture is at the example of Figure 22, when the present invention is used in the RAID0+1 hard disk array of four hard disks, be to be sorted in a group by the data slot of parallel access at hard disk HD (0), HD in (1) in the hard disk of source in fact, similarly be that data slot S0 (0), S0 (1) are divided into the G of group (0), follow-up two data fragment S1 (0), S1 (1) they then are the G of group (1), or the like; The planning in zone then can utilize the tabulation of Figure 21, calculates the size in each zone with Q=2.When actual the migration, the flow process 100 that can directly continue to use among Fig. 2 is carried out, only, when a certain regional Z (j) is carried out step 108, override to the data slot of last regional Z (j-1) and will be copied to hard disk HD (2) separately, the data slot of origin source hard disk HD (0) to write to hard disk HD (1) also will write to hard disk HD (3) simultaneously.
To be example below, illustrate that Data Transference Technology of the present invention promotes the use in the situation of RAID5 hard disk array with the RAID5 hard disk array of three hard disks.Please refer to Figure 23; What Figure 23 illustrated is the DATA DISTRIBUTION situation of RAID5 hard disk array before and after data migtation of three hard disks.Except the data slot that is similar to RAID0 hard disk array framework was divided, another feature of RAID5 hard disk array was exactly parity check operation of data and distribution.In the RAID5 of N hard disk hard disk array, whenever (N-1) individual meeting just can be calculated (similarly being the same bit arithmetic according to XOR) and be gone out inspection data by the data slot of parallel access, this (N-1) individual data fragment is stored in a hard disk in the hard disk array respectively together with the inspection data that calculate just can be regarded as N fragment.If a hard disk failure is arranged in N hard disk, utilize (N-1) individual fragment of other (N-1) individual hard disk just can recalculate that fragment of damage.Just as what Figure 23 illustrated, utilize two fragment S0 (0), the S0 (1) of source hard disk HD (0) can calculate inspection data P0, and fragment S0 (0), S0 (1) and P0 can be respectively allocated to each hard disk HD (0) to HD (2) after data migtation, and forming can be by three fragment of parallel access with one deck.In like manner, time two data fragment S1 (0), the S1 (1) of origin source hard disk HD (0) can calculate the inspection data P1 of a correspondence, fragment S1 (0), S1 (1) and P (1) (can be assigned to that hard disk as for that fragment multiple different embodiment can be arranged and will be respectively allocated to a hard disk after data migtation, picture checks that data P1 can be assigned to HD (1) in the example of Figure 23).By that analogy, can calculate inspection data P2 according to data slot S2 (0), S2 (1), and fragment S2 (0), S2 (1) and P2 will be in the fragments that becomes after the data migtation with one deck in each hard disk.
When technical spirit of the present invention is extended to the RAID5 hard disk array of N hard disk, owing to just can calculating inspection data, every (N-1) individual data fragment gathers into N fragment with one deck, so (N-1) individual data fragment can be categorized in same group, this is the cause of Q=(N-1) among Figure 21 just.The RAID5 hard disk array that three hard disks are arranged in the image pattern 23 just can be categorized in same group with per two the data fragments in the migration data not, the size of utilizing the formula of Figure 21 to come each zone in the computation migration progress.Actual when carrying out data migtation, the present invention can continue to use the flow process 100 of Fig. 2 and come the RAID5 hard disk array is carried out data migtation, only 108 to revise a little in steps: in the time of moving the data of each group among the regional Z (j), to calculate corresponding inspection data according to the data slot in the same group, again the data slot in the same group be write to each hard disk respectively together with the inspection data; Wherein there is a fragment can be written to last regional Z (j-1).The example of continuity Figure 23 please refer to the 24th to Figure 26; Figure 24 to Figure 26 is the present invention carries out data migtation in the RAID5 of three hard disks hard disk array synoptic diagram.At first, as shown in figure 24, at the beginning of data migtation, initial data MSA points to regional Z (0), calculate inspection data P0 according to the data slot S0 (0) among the regional Z (0), S0 (1) after, data slot S0 (1) and inspection data P0 just can copy to hard disk HD (1) and HD (2) respectively, finish the data migtation of regional Z (0).
Next, in Figure 25, initial data MSA is updated and points to regional Z (1); According to data slot S1 (0), S1 (1) calculate check data P1 after, data slot S1 (0), S1 (1) and check that data P1 just can be written into each hard disk HD (0) to HD (2); Wherein, data slot S1 (0) can be overwritten among the regional Z (0).
As shown in figure 26, after the data migtation in finishing regional Z (1), initial data MSA just can be updated and point to regional Z (2), and regional Z (1) just becomes and can override the district, makes regional Z (1) two data fragments originally can be corresponding to two groups of regional Z (2).According to each data slot among the G of group (2) calculate check data P2 after, each data slot among the G of group (2) is together with checking that data P2 just can write to each hard disk, wherein, according to RAID5 hard disk array framework, check that data P2 can override the data slot S1 (0) among the regional Z (1).In like manner, according to each data slot among the G of group (3) calculate check data P3 after, the data slot S3 (0) among the G of group (3), S3 (1) and check that data P3 just can write to each hard disk respectively; Wherein, data slot S3 (0) can override the data slot S1 (1) among the regional Z (2).Move each zone in regular turn with similar principle, just can finish the data migtation of RAID5 hard disk array.By the discussion of Figure 24 to Figure 26 as can be known, all extensible hard disk array that is extended to the RAID5 framework of the read-write administrative skill of data progress planning/recording/recovering of the present invention and optimization.
Please refer to Figure 27; Hard disk array with two hard disks is an example, and Figure 27 is the synoptic diagram of the redundant cheap hard disk array of matrix form DATA DISTRIBUTION before and after data migtation; Hard disk HD (0) is the source hard disk, and hard disk HD (1) then is member's hard disk.In the redundant cheap hard disk array of matrix form, be the hard disk array framework that the storage space of hard disk array is configured to different kenels; For instance, originally the data D0 in source hard disk HD (0) can be dispensed to each hard disk (just can be divided into each data slot and be dispensed to hard disk HD (0) and HD (1) alternately) according to the hard disk array framework of RAID0, and other data D in the hard disk of source then can be assigned as data D1, D2 and be stored in hard disk HD (0), HD (1) respectively according to the hard disc archetecture (for example being RAID0+1 or the like) of other kind.When the redundant cheap hard disk array of matrix form was carried out data migtation, just can utilize technology of the present invention to move those need be with the data of RAID0 framework distribution; In this case, the formula that can directly apply mechanically Figure 16 comes layout data migration progress, and the flow process of continuing to use among Fig. 2 100 is carried out data migtation.
In summary, the present invention has disclosed preferable migration progress planning/record and the read-write management of optimizing, and promoting the usefulness of hard disk array data migtation, and can take into account the safety of data migtation; Even data migration process is interrupted, also can not cause the loss or the damage of data, can also after interruption, continue the restore data migration.Aspect migration progress planning/record, the present invention ranges each zone with data slot to be migrated in the hard disk of source, a plurality of data slots that will migrate to different hard disks are arranged in each zone, be that an integral body is carried out data migtation in regular turn with each zone again, and in each hard disk of hard disk array, store the progress (the just start address in to be migrated zone) of an initial data with the record data migration, with foundation as the answer of having no progeny in the migration.When a certain regional Z (j) was copied to each hard disk of hard disk array carrying out data migtation with its data slot, initial data will write down this regional start address; After the data of regional Z (j) all had been copied to corresponding hard disk, initial data just can be updated to a time regional Z (j+1); And the data that will be distributed to the source hard disk among the regional Z (j+1) just can be replicated and override to last regional Z (j+1), and the data slot that be distributed to other hard disk also is copied to each corresponding hard disk simultaneously.During data slot in migration regional Z (j+1), because these data slots are to be copied to other hard disk or the last zone in the hard disk of source, so the data slot among the regional Z (j+1) can not be written or change.That is to say that even data migration process is interrupted, the data among the regional Z (j+1) can not run off or damage yet when the regional Z of migration (j+1); When data migtation is recovered, just can recover the data migtation of interruption by regional Z (j+1).In addition, move the progress planning principle based on the present invention, the data slot that zone Z (j+1) only understands some will override to regional Z (j), other data slot then is to write to other hard disk, so the size of regional Z (j+1) just can be greater than last regional Z (j), and make the big I in each zone be the growth of index kenel.The cumulative regional planning of size can reduce the number of times that start address is updated, and can also complement each other with the read-write management of optimization of the present invention, can accumulate more data to make full use of each read/write instruction, promotes the usefulness of data migtation.And technical spirit of the present invention can not only carry out data migtation at the hard disk array under the RAID0 framework, can also promote the use in the hard disk array of other kind framework, similarly is the redundant cheap hard disk array of RAID0+1, RAID5 and matrix form.Compared to prior art, the present invention can promote the usefulness of data migtation under the situation of guaranteeing data migtation safety, reduces required consumed time of data migtation and resource for computer system, and can be widely used in different types of hard disk array.
The above only is preferred embodiment of the present invention, and all equalizations of being done according to the present patent application claim change and modify, and all should belong to covering scope of the present invention.

Claims (8)

1. a method of carrying out data migtation in a hard disk array includes source hard disk and at least one member's hard disk in this hard disk array; This method is each hard disk that is used for the data in this source hard disk are disperseed to be stored to this hard disk array, and this method includes:
Data to be migrated in this source hard disk are divided into a plurality of data slots;
The storage space of this source hard disk is divided into one can overrides a district and a district to be migrated, make this can override the district and record many data fragments, and record other many data fragments in this district to be migrated;
The start address in this district to be migrated is recorded as initial data;
Data slot in this district to be migrated is carried out data migtation, make each data slot in this district to be migrated write to member's hard disk respectively or override to the override district of this source hard disk, and make to be written and be less than the number of data slot in this district to be migrated to this number that can override the data slot in the district;
After data slot in district to be migrated to this carries out data migtation, if member's hard disk that each data slot in this district to be migrated all is written into a correspondence respectively is this source hard disk maybe, then new an override district is used as in this district to be migrated, and from the data to be migrated of this source hard disk, mark off a new district to be migrated, make this district to be migrated have a plurality of data slots to be migrated; And
Upgrade this initial data, make this initial data write down the start address in this new district to be migrated.
2. the method for claim 1, it includes in addition:
This initial data is recorded in this source hard disk and each member's hard disk.
3. the method for claim 1, it includes in addition:
When the data slot in district to be migrated to this carries out data migtation, if still have in this district to be migrated member's hard disk that data slot is not written into a correspondence maybe during the hard disk of this source data migtation interrupt, then when restarting data migtation, find this district to be migrated according to this initial data, and each data slot that again will this district to be migrated writes to member's hard disk of a correspondence or overrides to the override district of this source hard disk.
4. the method for claim 1, wherein each hard disk can receive a reading command and is no more than one with sense data amount size from this hard disk and reads the data of extreme value, and can receive one and write instruction data being write to this hard disk, and this method includes in addition:
When the data slot in this district to be migrated is carried out data migtation, if the data volume size of all data slots reads extreme value above this in this district to be migrated, then utilize a plurality of reading command by after reading data slot to be migrated in this source hard disk earlier, to write instruction a plurality of reading command are accumulated each hard disk that the data of reading write to this hard disk array again.
5. computer system, it includes:
One hard disk array, it includes source hard disk and at least one member's hard disk, and each hard disk is used to provide storage space with record data;
One central processing unit is used for the running of this computer system of master control; And
One internal memory, it can store a data migtation module; When this central processing unit is carried out this data migtation module, can make data in this source hard disk disperse to be stored to each hard disk of this hard disk array, and this transferring module includes:
One planning module; When this central processing unit is carried out this planning module, data to be migrated in this source hard disk can be divided into a plurality of data slots, and the storage space of the hard disk of will originating be divided into one can override the district and a district to be migrated, make this can override the district and record many data fragments, and record many data fragments in addition in this district to be migrated;
One zone migration module; When this central processing unit is carried out this zone migration module, can carry out data migtation to the data slot in this district to be migrated, make each data slot in this district to be migrated write to member's hard disk respectively or override to the override district of this source hard disk, and make to be written and be less than the number of data slot in this district to be migrated to this number that can override the data slot in the district; And
One logging modle; When this central processing unit is carried out this logging modle, the start address in this district to be migrated can be recorded as initial data,
Wherein, when this central processing unit is carried out this zone migration module, if member's hard disk that each data slot in this district to be migrated all is written into a correspondence respectively is this source hard disk maybe, then this central processing unit can be used as new an override district with this district to be migrated, from the data to be migrated of this source hard disk, mark off a new district to be migrated again, make this district to be migrated have a plurality of data slots to be migrated, and this central processing unit also can be carried out this logging modle, to upgrade this initial data, make this initial data write down the start address in this new district to be migrated.
6. computer system as claimed in claim 5 wherein, when this central processing unit is carried out this logging modle, can be recorded in this initial data in this source hard disk and each member's hard disk in addition.
7. computer system as claimed in claim 5 wherein, includes one in addition and recovers module in this transferring module; When this central processing unit is carried out this zone migration module, if still have in this district to be migrated member's hard disk that data slot is not written into a correspondence maybe during the hard disk of this source data migtation interrupt, then when re-executing this transferring module, can carry out this recovery module when this central processing unit, finding this district to be migrated according to this initial data, and each data slot that again will this district to be migrated writes to member's hard disk of a correspondence or overrides to the override district of this source hard disk.
8. computer system as claimed in claim 5, wherein, each hard disk can receive a reading command and be no more than data that read extreme value with sense data amount size from this hard disk, and can receive one and write instruction data are write to this hard disk, read and write administration module and include one in this transferring module in addition, when this central processing unit is carried out this zone migration module, this central processing unit can be carried out this read-write administration module, whether has surpassed this with the data volume size of judging all data slots in this district to be migrated and has read extreme value; If then this central processing unit can utilize a plurality of reading command by after reading data slot to be migrated in this source hard disk earlier, write instruction with each simultaneously more a plurality of reading command are accumulated each hard disk that the data of reading write to this hard disk array.
CN 200410098003 2004-12-01 2004-12-01 Method and apparatus for hard disk array data transfer Active CN1290019C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200410098003 CN1290019C (en) 2004-12-01 2004-12-01 Method and apparatus for hard disk array data transfer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200410098003 CN1290019C (en) 2004-12-01 2004-12-01 Method and apparatus for hard disk array data transfer

Publications (2)

Publication Number Publication Date
CN1614573A CN1614573A (en) 2005-05-11
CN1290019C true CN1290019C (en) 2006-12-13

Family

ID=34766636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200410098003 Active CN1290019C (en) 2004-12-01 2004-12-01 Method and apparatus for hard disk array data transfer

Country Status (1)

Country Link
CN (1) CN1290019C (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100428130C (en) * 2005-12-31 2008-10-22 英业达股份有限公司 Data automatic classification access method expanding virtual hand disk
JP4375435B2 (en) * 2007-05-23 2009-12-02 株式会社日立製作所 Hierarchical storage system for predictive data migration
CN106708433A (en) * 2016-12-06 2017-05-24 深圳市深信服电子科技有限公司 Read-write method and device for stored data

Also Published As

Publication number Publication date
CN1614573A (en) 2005-05-11

Similar Documents

Publication Publication Date Title
EP2510447B1 (en) Method and system for concurrent background and foreground operations in a non-volatile memory array
EP1576478B1 (en) Method and apparatus for grouping pages within a block
US9098395B2 (en) Logical block management method for a flash memory and control circuit storage system using the same
TWI409633B (en) Flash memory storage device, controller thereof, and method for programming data
US20080195833A1 (en) Systems, methods and computer program products for operating a data processing system in which a file system's unit of memory allocation is coordinated with a storage system's read/write operation unit
US20100042773A1 (en) Flash memory storage system and data writing method thereof
US20060112221A1 (en) Method and Related Apparatus for Data Migration Utilizing Disk Arrays
CN102810068A (en) Storage device, storage system and method of virtualizing storage device
CN102298555A (en) Modular flash management system based on Not AND (NAND) technology
CN102193869B (en) Memory management and write-in method, memory controller and storage system
CN103597461A (en) Non-volatile semiconductor storage system
US20210173574A1 (en) Allocating variable media types of memory devices in a memory system
US8914587B2 (en) Multi-threaded memory operation using block write interruption after a number or threshold of pages have been written in order to service another request
CN102890655B (en) Memory storage device, memory controller and valid data recognition method thereof
JP2011070365A (en) Memory system
CN102592670B (en) Method for writing data, Memory Controller and memorizer memory devices
WO2021080774A1 (en) Construction of a block device
CN102968385B (en) Method for writing data, Memory Controller and storage device
CN102567221B (en) Data management method, memory controller and memory storage device
CN102999437B (en) Data-moving method, Memory Controller and memorizer memory devices
TWI440044B (en) Memory management method, memory controller and memory storage system
CN102402396B (en) Combined type storage device as well as combined type storage media controller and addressing method thereof
US11550502B2 (en) Apparatus and method for controlling multi-stream program operations performed in a memory block included in a memory system
CN1290019C (en) Method and apparatus for hard disk array data transfer
WO2021080785A1 (en) Construction of a block device

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