CN101819544A - Hard disk data protection and method of reducing based on dynamic data area - Google Patents

Hard disk data protection and method of reducing based on dynamic data area Download PDF

Info

Publication number
CN101819544A
CN101819544A CN201010116062A CN201010116062A CN101819544A CN 101819544 A CN101819544 A CN 101819544A CN 201010116062 A CN201010116062 A CN 201010116062A CN 201010116062 A CN201010116062 A CN 201010116062A CN 101819544 A CN101819544 A CN 101819544A
Authority
CN
China
Prior art keywords
protection
data
map
state
hard disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201010116062A
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201010116062A priority Critical patent/CN101819544A/en
Publication of CN101819544A publication Critical patent/CN101819544A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a kind of hard disk data protection and method of reducing based on dynamic data area; the data management area of this method and map section can dynamic growth, overcome traditional shortcoming of overflowing and can't realize multiple spot protection and reduction based on data field in the static data area method easily.Creating on the basis, dynamic protection card management data district, providing single-point protection and reduction implementation method.On the basis of single restoration point,, provided the implementation method of creating new restoration point according to state transition rules.On the basis of many restoration points,, realized the protection and the method for reducing of any a plurality of restoration points by introducing Copy on write, append the state chain, increasing operations such as shining upon, shine upon pen travel, mapping block copy and free block copy.

Description

Hard disk data protection and method of reducing based on dynamic data area
Technical field
The present invention relates to the computer data guard method, particularly a kind of hard disk data protection and method of reducing based on dynamic data area.
Background technology
Along with the development of infotech, computer utility spreads in all trades and professions, and system and data safety problem become increasingly conspicuous.Misoperation, artificial destruction, computer virus etc. all can cause the phenomenon of system crash and loss of data.In this case, many data protection measures occurred, hard disk protecting card (reduction card) as a kind of active data guard method, has obtained numerous pc users' welcome.
Hard disk protection needs to set up restoration point before being stuck in protected data, and the groundwork of setting up restoration point is that the operating position of sector in each subregion of recording disk forms sector state table.After restoration point is set up; the interception computing machine is to the access of hard disk; the write operation that drops in the protection domain is redirected to map section; revise in the state table corresponding state simultaneously and these mapping relations are recorded in the mapping table; after this to the read-write operation of the sector of mapped mistake, it is redirected to corresponding map section according to mapping table.The key of data protection is by map operation, makes writing of protected data is mapped to map section, former data has been played the effect of protection.Restoring function is by suitable state table, mapping table and sector operation, makes hard disc data from file system hierarchy, returns to the state when setting up restoration point.Protection card writes back function in addition except restoring function, and the data that this function will be mapped to other places really write back to its original position.If can only set up a restoration point on computers, be called and realized the single-point reduction, if can set up more than one restoration point, then be called and realized multipoint restoring.
From the description of top as seen, except the data of computing machine itself, the protection retrieving algorithm of protection card needs additional space to be used to preserve sector state table, mapping table and mapping (enum) data.Sector state table and mapping table are called the management data of protection card, and its storage area is called the management data district of protection card.Management data and mapping (enum) data are called the protection card data, and its storage area is called the protection card data field.The method that present protection card adopts be hard disk end mark off certain space as the protection card data field.The capacity of this data field generally is made as the 5%-20% of hard-disk capacity, mostly adopts subzone hiding or HPA (Host Protected Area) technology that it is protected.This protection card data field is called static protection card data field.It has following shortcoming:
1) finite capacity of protection card data field (claims this situation to overflow for the protection card data field) when the protection card data exceed protection card data field capacity, even also have a large amount of free spaces on the hard disk, the protection card program also has to make blue screen or restart processing.It is too big that the capacity of static protection card data field can not be established again, such as on a 80G hard disk, and the capacity of protection card data field is made as 20% of hard-disk capacity, and the user will find that the actual space available of own hard disk has only 64G.
2) the protection card data field is static the setting, in case can't realize the dynamic growth of protection card data field capacity after setting, when the hard disc data operational ton is big, hard disk sector shines upon for a long time, occurs the situation that overflow the data field easily.
3) static protection card data field can't dynamic growth, lacks enough spaces and is used to hold more protection card data, thereby a restoration point can only be set, and can't realize multipoint restoring.
4) because the protection card data field is static the setting; for the computing machine that has installed operating system; in order to find an enough big static region; it need reset last subregion of user's hard disk usually; thereby cause losing of data on this subregion; for many users, this is unacceptable.
Summary of the invention
For overcoming the shortcoming of existing protection card protection retrieving algorithm, the present invention has provided based on the hard disk data protection of dynamic protection card data field and has protected and method of reducing with method of reducing and at multiple spot on basis, dynamic protection card data field.
The establishment of dynamic protection Ka Guanlishuojuqu: scanning DISK to Image; it is fast that hard disk is with N (the N value is 2 integer power) sector that unit is divided into data; by the Study document system; obtain the fast situation that takies of each data; form state table; three kinds of original states are arranged: (1) Free, free block: unappropriated free block on the hard disk this moment in the state table.(2) Occupied takies piece: occupied but piece that need not protect on the hard disk.(3) Protect, protection piece: occupied and need the piece of protection on the hard disk.Become mapping table according to sector piece number form, the size of supposing state table is S s, the size of mapping table is S m, from after scanning mode table forward, find out continuous free space greater than S s+ S mHard disk areas, this piece hard disk areas is protection card management data district, be not destroyed for guaranteeing the management data district, need will be guard mode Protect2 to the status indication that drops on the sector piece in this zone in the state table.Processing when protecting is the same to Protect2 with Protect, and when difference was restoring operation, the Protect data block did not allow data to write back, and Protect2 then allows data to write back.After this, when protection card software needed map operation, mapping block was from also being by searching the free block the state table, and then dynamic assignment is come from the hard disk free space.As seen the state table of protection card, mapping table and map section all are dynamic assignment, and it does not need fdisk is reset, and need not hide the capacity of hard disk yet.In operational process,, just blue screen can not occur or restart as long as hard disk also has free space.
The realization of multiple spot protection retrieving algorithm: traditional protection card retrieving algorithm can't realize that the main cause of multipoint restoring is that static protection card data field capacity can't dynamic growth.After adopting dynamic protection card data field,, any a plurality of restoration point can be set if hard-disk capacity allows.The state table of first restoration point is to obtain by the file system of analyzing each subregion of hard disk, and the state table of restoration point after this then is to obtain by the state table of analyzing previous restoration point.When Protect piece and Protect2 piece are carried out write operation, can be mapped to map section, simultaneously these mapping relations of record in mapping table.When creating new restoration point, do not go to pot in order to guarantee the data under the old restoration point environment, need to create new mapping relations, suppose the original A->B that is mapped as, we need apply for a free block C again, and the copying data of B piece to the C piece, and is replaced A->B with A->C.This way has two shortcomings:
1), then to spend the long time just can finish the setting of new restoration point if mapping relations are many in the mapping table.
2) in new restoration point, some mapping block may not have write activity, and the B piece has not only been wasted the time to the copy of C piece, has also wasted the space of a data block.
For this reason, the present invention has adopted Copy on write (COW, Copy On Write) technology, the copy of data block is postponed till carried out when data block carried out actual write operation again.
Compare with the single-point situation, multiple spot protection brings great convenience with reduction, and its where the shoe pinches is, under the multiple spot situation, should guarantee that old software environment is still available, guarantees that again it can not destroyed and can recover as before.Mention in background technology, the function that writes back of protection card is that the data that will be mapped to other places really write back to its original position.Under the situation of multiple spot, this processing is wrong, because it can cause old restoration point to have reduced as before.The present invention appends the state chain, increases operations such as shining upon, shine upon pen travel, mapping block copy and free block copy by introducing, can realize the protection and the retrieving algorithm of any a plurality of restoration points.
Description of drawings
Fig. 1 is single-point protection and reducing condition transition diagram.
Fig. 2 state chain synoptic diagram
Fig. 3 appends state chain operation chart
Fig. 4 increases the map operation synoptic diagram
Fig. 5 shines upon the pen travel operation chart
Fig. 6 mapping block copy function synoptic diagram
The free block copy operation chart of Fig. 7
Embodiment
The establishment of dynamic protection Ka Guanlishuojuqu: total sector number of supposing hard disk is HD_Sectors, and the fast size of each data is N (the N value is 2 integer power) sector, then hard disk can be divided into
Figure GDA0000019780920000041
Piece.The state of each piece is described with a byte, and then the size of a state table is a M byte.The size of virgin state table and current state table is S s=2M byte.Mapping table M item, every is 4 bytes, its value representation mapping block number (the mapping item sequence number itself is mapped number), size is S s=4M byte.Suppose that every sector is the L byte, the sector number that takies of state table and mapping table is so
Figure GDA0000019780920000042
The piece number that takies is
Figure GDA0000019780920000043
The scanning DISK to Image, the Study document system obtains the situation that takies of each data block, and three kinds of original states of data block are Free, Occupied and Protect, and the state value of each piece is inserted in the virgin state table.From after scan original shape state table forward; find out the zone that continuous free block piece number equals Blocks; this piece zone is used to preserve protection card management data district (state table and mapping table), for for protection management data field is not destroyed, the state of these free blocks is changed Protect2 by Free.The Protect2 state also is a kind of initial guard mode, and the processing when protecting is the same with the Protect state for it, and is different when difference is to reduce.The value of virgin state table copy is a to the current state table, just finished the building work of dynamic protection Ka Guanlishuojuqu in the continuous free block that deposits in the value of two parts of state tables in the hard disk then to be found.
The realization of single-point protection: protection is to finish by the read-write operation that changes hard disk.After dynamic protection Ka Guanlishuojuqu creates and finishes; interrupt by BIOS 13H number at DOS; under WINDOWS/LINUX/UNIX operating system, pass through the accessing operation of device driver Hook hard disk to the sector; for destination sector; which data block he falls into to calculate it; from state table, take out the state of data block,, carry out different actions according to the state of data block.Below in conjunction with Fig. 1, provide detailed description.The state of ellipse representation data block among the figure, what indicate in the ellipse is its state value.The arc of band arrow is represented the transfer of state, and the letter representation on the arc causes the operation of state transitions, and r (read) expression is read, and w (write) expression is write, the restoring operation of R (restore) expression protection card, and W (write-back) represents the back operations of writing of protection card.The piece of supposing the data correspondence in the read-write operation is A, and the following read-write of describing various status blocks is handled.
1) for the Occupied piece, read-write operation all is direct clearance.
2) for the Protect piece, then directly let pass if read, if write operation, then at first by free block B of state table application, change the state of A piece into Protect_map by Protect, change the state of B into Image by Free, data are write the B piece, and in mapping table, write down the mapping relations of A->B.If the length of the discontented piece of the data length of write operation is then read and is write the B piece again after the data of A piece and write operation data merge.
3) state Protect2 aims at dynamic protection Ka Guanlishuojuqu and establishes, and its protection action is the same with state Protect.
4) for the Free piece, if read then directly to let pass, if write, then the state with the A piece changes Occupied into by Free, the write operation of letting pass then.
5) for Protect_map, Protect2_map and Image_map piece take out the B piece from mapping table, will read and write and all be redirected to the B piece.Action when Protect_map and Protect2_map difference are to reduce is different.
6) for the Image piece, then directly let pass if read, if write operation, then at first by free block B of state table application, change the state of A piece into Image_map by Image, change the state of B into Image by Free, data are write the B piece, and in mapping table, write down the mapping relations of A->B.If the length of the discontented piece of the data length of write operation is then read and is write the B piece again after the data of A piece and write operation data merge.
Single-point reduction and the realization that writes back: as seen by the description of top; there are three kinds of status data block to need protection; they are Protect pieces; Protect2 piece and Image piece can produce mapping relations A->B to the write operation of these data blocks, to writing then of Image piece can be on mapping relations can formation state chain; as shown in Figure 2; rectangular tables is shown data block among the figure, and what indicate in the rectangle is its state value, and the line of band arrow is represented mapping relations.The first-in-chain(FIC) of state chain has only two states Protect_map and Protect2_map.Reduction is by traveling through this two states chain with writing back, and the node in the chain is adopted suitable finishing dealing with:
1) for the chain that begins with Protect_map, restoring operation is: travel through this chain, except that first-in-chain(FIC), to each chain node, take out mapping relations A->B from mapping table, carry out the copy of data block B to data block A.For writing back operations, also to carry out the copy of data block B to data block A to first-in-chain(FIC).
2) for the chain that begins with Protect2_map, reduce and write back and be operating as: travel through this chain,, from mapping table, take out mapping relations A->B, carry out the copy of data block B to data block A to each chain node.
For the chain that begins with Protect2_map, it is the same reducing with writing back operations, also will carry out the copy of data block B to data block A to first-in-chain(FIC).Reason is for operating system, and what the Protect2 piece took is the free area of hard disk, for the management data district that protects protection card is not destroyed, it is made as guard mode.When carrying out restoring operation, allow mappedly to return, otherwise in file system, the inconsistent phenomenon of data can occur with other local copying data.Reduction and write back operations and finish after, dynamic protection card management data district might be destroyed, so need regenerate the management data district.
Table 1 data block state exchange relation
Previous restoration point data block state Newly-built restoration point data block state
??Free ??Free
??Occupied ??Occupied
??Protect ??Protect
??Protect2 ??Protec2
??Protect_map ??Protect_map_cow
??Protect2_map ??Protect2_map_cow
??Image_map ??Image_map
??Image ??Image
??Protect_map_cow ??Protect_map_cow
??Protect2_map_cow ??Protect2_map_cow
The generation of multipoint restoring point: the state table of first restoration point is to obtain by the file system of analyzing each subregion of hard disk, and the state table of second restoration point then is to obtain by the state table of analyzing first restoration point.In single-point protection and reduction, data block has 8 kinds of states, is respectively: Free, Occupied, Protect, Protect2, Protect_map, Protect2_map, Image_map, Image.In new guard mode; protected data Protect piece, Protect2 piece and Image originally still will obtain protection soon; mapping relations Image_map originally will keep; mapping relations Protect_map originally and Protect2_map then will change; the present invention has introduced the method for Copy on write; when being set, new restoration point do not carry out the copy work of data block; in mapping table, keep original mapping relations, in state table, change Protect_map and Protect2_map into Protect_map_cow and Protect2_map_cow respectively.The copy of data block postponed till carry out again when Protect_map_cow piece and Protect2_map_cow piece carried out write operation.Owing to increased two states Protect_map_cow and Protect2_map_cow in second restoration point, data block always has 10 kinds of states.The transformational relation of state is as shown in table 1.After obtaining state table, on the basis of new state table, create dynamic protection Ka Guanlishuojuqu, the mapping table of previous restoration point is copied to current mapping table, just finished the building work of new restoration point.
The realization of multiple spot protection: to state is the data block of Protect_map_cow and Protect2_map_cow; from mapping table, take out mapping relations A->B; when carrying out read operation; it is fast that it is redirected to B; when they are carried out write operation, carry out the Copy on write action: apply for a free block C, change the state of piece C into Occupied by Free; Protect_map_cow changes Protect_map into, and Protect2_map_cow changes Protect2_map into.Be written to the C piece after the data of B piece and data to be written are merged, in mapping table, A->B changed into A->C (because A has pointed to C, thereby may produce be the state chain of first-in-chain(FIC)) with Image_map.For the data block of other eight kinds of states, be the same during the operation merchandiser point of read-write.
Multipoint restoring and the realization that writes back: suppose that current restoration point is a n restoration point, revert to m restoration point (m≤n).Under the situation of multiple spot, having more three kinds is the state chain of first-in-chain(FIC) with Protect_map_cow, Protect2_map_cow and Image_map respectively, has five kinds of state chains.Reduction is by traveling through this five kinds of state chains with writing back, and the node in the chain is adopted suitable finishing dealing with.
If m=1, for the chain that begins with Image_map, reduce and being operating as when writing back: traveling through this chain, is the node of Image_map to each state, takes out mapping relations A->B from mapping table, carries out the copy of data block B to data block A.For with other four kinds of chains that state begins, it is the same with the chain that begins with Image_map to write back operations, and restoring operation then skips over the copying data action of first-in-chain(FIC).Reduction and write back action and finish after, need to analyze hard disk, create first restoration point again.
If the data before m the restoration point because after will guaranteeing reduction of data and writing, can not be destroyed in m>1, will complexity in the processing many.
1), reduces and being operating as when writing back: judge whether this chain is present in the oldState table for the chain that begins with Image_map.
If a) exist, whether the length of judging this chain than the length of old chain, if, then data block new in the chain is appended in the old chain, as shown in Figure 3, be positioned at the oldState chain of top among the figure, what be positioned at the below is the current state chain.State with the B piece in the oldState table changes Image_map into, changes the state of C piece into Image.In old mapping table, record mapping relations B->C.Claim this being operating as to append the operation of state chain.
B) if there is no, then traveling through this chain, is the node of Image_map to each state, from mapping table, take out mapping relations A->B, carry out the copy of data block B, and change Image_map into Occupied, also change corresponding state in the oldState table into Occupied simultaneously to data block A.
2) chain that begins for Protect_map and Protect_map_cow, restoring operation is: travel through this chain, to each state is the node of Image_map, from mapping table, take out mapping relations A->B, carry out the copy of data block B to data block A, and change Image_map into Occupied, also change corresponding state in the oldState table into Occupied simultaneously.
3) chain that begins for Protect_map, the difference of writing back operations and restoring operation is the processing for first-in-chain(FIC).The state of this data block is relevant during with m restoration point to the processing of first-in-chain(FIC).According to table 1 data block state exchange relation as can be known, the current state of data block is Protect_map or Protect_map_cow, and it may be one of Protect, Protect_map and Protect_map_cow at the state (oldState) of m-1 restoration point.
A) oldState is Protect or Protect_map_cow, as shown in Figure 4, in the oldState table, changes the state of A into Protect_map, changes the state of B into Image.Mapping relations A->B is recorded in the old mapping table.Claim this increase map operation that is operating as.
B) oldState is Protect_map, and have two kinds of disposal routes this moment, and first method in the oldState table, changes the state of B into Occupied by Image as shown in Figure 5, and in old mapping table, A->B changes A->B2 into mapping relations.Claim this mapping pen travel operation that is operating as.Second method as shown in Figure 6, with the copying data of B2 piece to the B piece.Claim this operation map block copy operation.First method does not need copying data, saves time, and second method makes data in magnetic disk compacter.
4) chain that begins for Protect_map_cow, it is similar with the chain that begins with Protect_map to write back operations, relevant with oldState to the processing to first-in-chain(FIC):
A) oldState is Protect, and with reference to Fig. 4, carrying out increases map operation.
B) oldState is Protect_map_cow, if B=B2 with reference to Fig. 3, carries out and appends the operation of state chain.Otherwise with reference to Fig. 4, carrying out increases map operation.
C) oldState is Protect_map, if B=B2 with reference to Fig. 3, carries out and appends the operation of state chain.If B ≠ B2 with reference to Fig. 5 and Fig. 6, can select to shine upon pen travel operation or mapping block copy function.
5) for the chain that begins with Protect2_map and Protect2_map_cow, it is the same reducing with writing back operations, and its oldState may be one of Free, Protect2, Protect2_map and Protect2_map_cow.When oldState was Protect2, Protect2_map or Protect2_map_cow, the back operations of writing of processing and the chain that begins with Protect_map and Protect_map_cow was similar, repeats no more.When oldState is Free, as shown in Figure 7, change oldState into Occupied by Free, with the copying data of B2 piece to the A piece.Claim this free block copy operation that is operating as.
The reduction and write back the action finish after, on the basis of m-1 restoration point, create m restoration point again.

Claims (6)

1. hard disk data protection and method of reducing, it is characterized in that: protection card management data district is dynamic the generation.
2. protection as claimed in claim 1 and method of reducing, its feature also is: multiple spot protection and method of reducing on basis, dynamic protection card management data district.
3. protection as claimed in claim 1 and method of reducing, its feature also is: undertaken by same way as to the protection of protection card management data with to the protection of the protected data on the hard disk.
4. multiple spot protection as claimed in claim 2 and method of reducing; its feature is that also the state table of first restoration point is to obtain by the file system of analyzing each subregion of hard disk, and the state table of restoration point after this then is to obtain by the state table of analyzing previous restoration point.
5. multiple spot protection as claimed in claim 2 and method of reducing, its feature also is, by introducing the Copy on write technology, does not need to carry out copying data work when new restoration point is set.
6. multiple spot protection as claimed in claim 2 and method of reducing, its feature also is to comprise following operation: append the operation of state chain, increase map operation, the operation of mapping pen travel, mapping block copy function, the operation of free block copy.
CN201010116062A 2010-03-02 2010-03-02 Hard disk data protection and method of reducing based on dynamic data area Pending CN101819544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010116062A CN101819544A (en) 2010-03-02 2010-03-02 Hard disk data protection and method of reducing based on dynamic data area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010116062A CN101819544A (en) 2010-03-02 2010-03-02 Hard disk data protection and method of reducing based on dynamic data area

Publications (1)

Publication Number Publication Date
CN101819544A true CN101819544A (en) 2010-09-01

Family

ID=42654657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010116062A Pending CN101819544A (en) 2010-03-02 2010-03-02 Hard disk data protection and method of reducing based on dynamic data area

Country Status (1)

Country Link
CN (1) CN101819544A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609335A (en) * 2012-01-12 2012-07-25 浪潮(北京)电子信息产业有限公司 Device and method for protecting metadata by copy-on-write

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609335A (en) * 2012-01-12 2012-07-25 浪潮(北京)电子信息产业有限公司 Device and method for protecting metadata by copy-on-write
CN102609335B (en) * 2012-01-12 2014-07-02 浪潮(北京)电子信息产业有限公司 Device and method for protecting metadata by copy-on-write

Similar Documents

Publication Publication Date Title
US10331349B2 (en) Shrinking virtual hard disk image
JP3878412B2 (en) How to save, use and recover data
JP5881859B2 (en) Storage device
JP5346536B2 (en) Information backup / restore processing device and information backup / restore processing system
CN107423233B (en) Writable snapshot implementation method and device
WO2016086819A1 (en) Method and apparatus for writing data into shingled magnetic record smr hard disk
CN102722536B (en) Method and device for realizing snapshot based on distributed file system
JP6044181B2 (en) Information processing method, program and apparatus for garbage collection
CN106527992A (en) Method and device for destroying data in storage equipment
CN104007993A (en) Method and device for eliminating sensitive data of Linux system memory
CN106445421A (en) Storage system data migration method and system
CN100369000C (en) A computer hardware data multi-timepoint fast storing and recovery method
KR101996641B1 (en) Apparatus and method for memory overlay
CN104376099A (en) Flash-memory-based file system implementation method and device
CN102609371B (en) System protecting method based on data security
CN106528703A (en) Deduplication mode switching method and apparatus
CN1160731C (en) Hard disk data protection method for computer
CN102508743A (en) Multi-point backup and real-time protection method for Linux file system
US7734887B1 (en) Relocation tracking during write operation
Lee et al. Efficient logging of metadata using NVRAM for NAND flash based file system
CN101819544A (en) Hard disk data protection and method of reducing based on dynamic data area
CN100447758C (en) Snapshot management method for logic disk
WO2011120335A1 (en) Method, device and computer for data operation
CN107608825A (en) A kind of method and device of cloud backup snapshot data
CN107423165A (en) A kind of data snapshot head writes copy method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20100901