CN100504799C - Method for snapping magnetic disc using snap index - Google Patents

Method for snapping magnetic disc using snap index Download PDF

Info

Publication number
CN100504799C
CN100504799C CNB2006101687257A CN200610168725A CN100504799C CN 100504799 C CN100504799 C CN 100504799C CN B2006101687257 A CNB2006101687257 A CN B2006101687257A CN 200610168725 A CN200610168725 A CN 200610168725A CN 100504799 C CN100504799 C CN 100504799C
Authority
CN
China
Prior art keywords
disk
data
capacity
hard disk
volume
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.)
Expired - Fee Related
Application number
CNB2006101687257A
Other languages
Chinese (zh)
Other versions
CN101206595A (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.)
Wang Juan
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to CNB2006101687257A priority Critical patent/CN100504799C/en
Publication of CN101206595A publication Critical patent/CN101206595A/en
Application granted granted Critical
Publication of CN100504799C publication Critical patent/CN100504799C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention provides a method of disk snapshot with a snapshot pointer. The method is applied to a server, when the server conducts the disk snapshot, all chunks of the hard disk are programmed into a disc volume, moreover, a first part and a second part are programmed in the hard disk, and the snapshot pointer is arranged in a kernel space of a memory, and the snapshot pointer points to the starting position of the first part; when initial data needs to be modified, the initial data is firstly copied to the chunk of the second part as backup data, then, the initial data is modified as modified data, and contrast information is written in a eager replication contrast table; when the server is about to conduct data recovery to the disc volume, the contrast information is read from the eager replication contrast table, the backup data is obtained and covered to corresponding chunk, so that the disc volume is recovered. Through the invention, the problem of abnormal collapse of an operating system caused by the exhaustion of the kernel space can be solved.

Description

Carry out the method for disk snapshot with the snapshot pointer
Technical field
The present invention is about server, especially in regard to a kind of method of carrying out disk snapshot with the snapshot pointer.
Background technology
Current general operation system all supports a kind of disk snapshot (Snapshot) technology, can be referred to as disk region shadow copy service (Volume Shadow Copy Services) again, so-called disk snapshot is the retention data technology that belongs to a kind of archives economy (file system), be different from the action that general data backup Technology Need duplicates, disk snapshot is a point at any time, the disk volume (disk volume (Volume) is meant that hard disk has the disk block (chunk) of data at present) of hard disk is carried out archives economy backup fast, and when carrying out disk snapshot, do not involve any reproduction of documents action.And the whole bibliographic structure in the data structure of the archives economy in will using at present remains.So, hard disk is set up the disk snapshot of the disk volume of different time points version with real-time ground, not only can remedy the deficiency of traditional back mechanism, in addition, even accidents such as damage or poisoning take place in hard disk, the supvr can select to damage or poison before disk snapshot, replaces original disk volume (Volume) allow damage reduce to minimum.
From the above, when hard disk conducting disk snapshot, can't actual replication actions of carrying out archives, but when the disk block of disk volume changes to some extent, raw data in the disk block of elder generation's copy diskette volume does not belong in other available disk block of disk volume in hard disk, the interior raw data of disk block of revising the disk volume again becomes the modification data, storer at server provides in the employed storage space of operating system (as: Linux) internal core (kernel) (hereinafter to be referred as kernel spacing) in addition, setting up one writes the synchronization replication table of comparisons (Copy-On-Write (is called for short: COW) Table), write raw data that the synchronization replication table of comparisons writes down each disk block and be written to information in that disk block in the hard disk.And aforementioned techniques is called synchronization replication (Copy-On-Write, COW) technology of writing.
Yet the storage space of the core of operating system is limited, and can not become big because system storage increases, the disk block of changing when the disk volume more for a long time, writing the synchronization replication table of comparisons, to take the storage space of core of operating system just big more.When the disk volume carries out disk snapshot in the different time respectively, or after the capacity of disk volume increases rapidly, kernel spacing will to write the synchronization replication table of comparisons shared by a large amount of, makes kernel spacing depleted, and then cause operating system to be collapsed unusually.Therefore, how designing and a kind ofly carry out the method for disk snapshot with the snapshot pointer, to solve above-mentioned problems effectively, is very urgent at present and an important topic that need to be resolved hurrily in fact.
Summary of the invention
Because the problems of aforementioned existing disk snapshot, the inventor is through the permanent research and experiment of making great efforts, finally development and Design goes out of the present inventionly a kind ofly to carry out the method for disk snapshot with the snapshot pointer, the phase by the present invention solve effectively kernel spacing exhaust cause the problem of the unusual collapse of operating system.
A purpose of the present invention, a kind of method of carrying out disk snapshot with the snapshot pointer is provided, this method is applied in the server, server includes a storer and a hard disk, wherein storer is cooked up at least provides the operating system internal core an employed kernel spacing, all disk block (chunk) that hard disk has data at present then are planned to a disk volume, when server carries out disk snapshot to the disk volume, in hard disk, cook up first and second portion, in kernel spacing, set up a snapshot pointer in addition, the reference position of snapshot pointed first, after this, when the raw data in the disk block of disk volume need be modified, earlier raw data is copied in the second portion as Backup Data, again the raw data of disk volume is made amendment into the modification data, the synchronization replication table of comparisons that writes in first writes contrast information again, and contrast information comprises this Backup Data address and to modification data address that should Backup Data.
Wherein, the capacity of described first is equal to the write the greatest requirements capacity of the synchronization replication table of comparisons; The said write synchronization replication table of comparisons provides a plurality of contrast information that store; The amount of capacity of described second portion, the raw data that then equals all disk block of disk volume is copied in the hard disk as the required amount of capacity of Backup Data.
For described method, wherein, described server is cooked up the step of first and second portion at hard disk, comprising:
According to the amount of capacity of described disk volume, in order to calculate the greatest requirements amount of capacity of the said write synchronization replication table of comparisons; In described hard disk, do not belong in the remaining space of described disk volume and cook up described first; Reach in the remaining space that in described hard disk, does not belong to described disk volume and described first and cook up described second portion.
Wherein, the computing method of the greatest requirements amount of capacity of the said write synchronization replication table of comparisons comprise:
Write the amount of capacity of disk block quantity * contrast information of the greatest requirements capacity=disk volume of the synchronization replication table of comparisons; And the capacity/disk block capacity of disk block quantity=disk volume.
In addition, the position of described first planning in described hard disk is before the position of described second portion in described hard disk; The part of the described first least significant end of described hard disk, described second portion part foremost directly continues.
When the disk block that has been written into described modification data in to described disk volume when described server is made amendment, directly the disk block of described modification data is made amendment.
Another object of the present invention, when server carries out the data recovery to the disk volume, read revising the contrast information of data from writing the synchronization replication table of comparisons earlier, obtain Backup Data at second portion, and Backup Data is covered in its disk block that stores originally, can recover the disk volume.
In sum, because address pointer only takies the storage area of the minimum part of kernel spacing, be stored in storage volume in the hard disk of kernel spacing and write the synchronization replication table of comparisons, it is shared to make kernel spacing no longer be written into the synchronization replication table of comparisons, can reach the purpose of the storage volume of saving kernel spacing, simultaneously, during server conducting disk snapshot, can not cause server exception, in order to reach the purpose of stablizing server.
Description of drawings
Fig. 1 is a configuration diagram of the present invention;
Fig. 2 is the action flow chart that the present invention carries out disk snapshot;
Fig. 3 is the present invention cooks up first and second portion at hard disk a action flow chart.
The main element symbol description:
Server ... ... 5 storeies ... ... 6
Kernel spacing ... 60 hard disks ... ... 7
Disk volume ... 70 firsts ... 72
Second portion ... 74
Embodiment
The present invention is described in detail below in conjunction with accompanying drawing.
The invention provides a kind of method of carrying out disk snapshot with the snapshot pointer, see also shown in Fig. 1,2, this method is applied in the server 5, this server 5 includes at least one storer 6 and at least one hard disk 7, wherein this storer 6 is cooked up a kernel spacing 60 (Kernel Space), when 5 pairs of hard disks of server 7 carry out disk snapshot, handle according to the following step:
Step 1: all disk block (chunk) that hard disk 7 has data at present are planned to a disk volume 70 (Volume);
Step 2: cook up first 72 and second portion 74 in the hard disk 7, the capacity of first 72 wherein, (Copy-On-Write (is called for short: greatest requirements capacity COW) Table) to equal to write the synchronization replication table of comparisons, write the synchronization replication table of comparisons and comprise a plurality of contrast information, each contrast information is respectively the modification data address that comprises Backup Data address and corresponding Backup Data, and the amount of capacity of second portion 74, the raw data that then equals all disk block of disk volume 70 is copied in the hard disk 7 as the required amount of capacity of Backup Data; In one embodiment of this invention, see also shown in Figure 3ly, server 5 is cooked up the step of first 72 and second portion 74 at hard disk 7, comprising:
Step 20: earlier according to the amount of capacity of disk volume 70, in order to calculate the required greatest requirements capacity that writes the synchronization replication table of comparisons of disk volume 70; And in the present invention, the calculation equation of greatest requirements capacity that writes the synchronization replication table of comparisons is as follows:
Write the amount of capacity of disk block quantity * contrast information of the greatest requirements capacity=disk volume 70 of the synchronization replication table of comparisons ... (formula 1)
The capacity of disk block quantity=disk volume 70/disk block capacity ... (formula 2)
Wherein, the expression of "/" in the formula 2 division sign.
For example, the capacity of supposing disk volume 70 is 100GB, the amount of capacity of each disk block of disk volume 70 is 64KB, the amount of capacity that writes each contrast information of synchronization replication table of comparisons record is 16byte, and the greatest requirements capacity that then writes the synchronization replication table of comparisons is (100GB/64KB) * 16byte=25MB.
Step 21: in hard disk 7, do not belong in the remaining space of disk volume 70 and cook up first 72; And
Step 22: in hard disk 7, do not belong in the remaining space of disk volume 70 and first 72 and cook up second portion 74, promptly finish.
In addition, in order to improve the speed that is read at Backup Data, in this embodiment, first 72 planning in the position of hard disk 7 at second portion 74 before the position of hard disk 7, especially, in the part of first's 72 least significant ends of hard disk 7, second portion 74 part foremost that directly continues, it is fastest that Backup Data is read.
Step 3: set up a snapshot pointer in the kernel spacing 60, the snapshot pointed writes the start address of the synchronization replication table of comparisons in hard disk 7, i.e. the start address of first 72 in hard disk 7; And
Step 4: when the raw data in any disk block of disk volume 70 need be modified, earlier raw data is copied in one of them disk block in the second portion 74 as Backup Data, again the raw data of disk volume 70 is revised and become the modification data, and the contrast information that will comprise the modification data address of Backup Data address and corresponding Backup Data writes writing in the synchronization replication table of comparisons of first 72, i.e. end.
From the above, hard disk 7 stores and writes the synchronization replication table of comparisons, because the storage volume of hard disk 7 is much larger than kernel spacing 60, therefore, hard disk 7 will can not be written into the synchronization replication table of comparisons and take, on the other hand, 60 of kernel spacings store address pointer, and address pointer only can take the storage area of minimum part usually, and it is shared to make kernel spacing 60 no longer be written into the synchronization replication table of comparisons, can reach the purpose of the storage volume of saving kernel spacing 60, simultaneously, during server 5 conducting disk snapshots, write the synchronization replication table of comparisons and write in the hard disk 7, make server 5 be difficult for taking place unusually, in order to reach the purpose of stablizing server 5.
In this embodiment, when server 5 desires have been written into the disk block of revising data in to disk volume 70 when making amendment, directly make amendment to being written into the disk block of revising data, and need not the modification data storing in second portion 74, use the Backup Data that has been written into the disk block of revising data in the retention disk volume 70, so, when server 5 desires are carried out the data recovery to disk volume 70, read revising this contrast information of data from writing the synchronization replication table of comparisons, obtain Backup Data at second portion 74, reach the disk block that Backup Data is covered these modification data, can recover disk volume 70.
The above only is a specific embodiment of the present invention, however feature of the present invention be not limited thereto, anyly be familiar with this skill person in field of the present invention, can think easily and variation or modification, all should be encompassed in the following claim of the present invention.

Claims (7)

1, a kind ofly carry out the method for disk snapshot with the snapshot pointer, be applied in the server, described server includes a storer and a hard disk, it is characterized in that, described storer is cooked up a kernel spacing, when server carries out disk snapshot to hard disk, handles according to the following step:
All disk block that described hard disk has data at present are planned to a disk volume;
Cook up a first and a second portion in the described hard disk, the capacity of described first, be equal to the write the greatest requirements capacity of the synchronization replication table of comparisons, the said write synchronization replication table of comparisons provides a plurality of contrast information that store, the amount of capacity of described second portion, the raw data that then equals all disk block of disk volume is copied in the hard disk as the required amount of capacity of Backup Data;
Set up a snapshot pointer in the described kernel spacing, the start address of the described first of described snapshot pointed in described hard disk; And
When the raw data in any disk block of described disk volume need be modified, earlier described raw data is copied in one of them disk block in the described second portion as a Backup Data, again described raw data is revised and become modification data, and, write writing in the synchronization replication table of comparisons of described first with a contrast information that comprises the modification data address of described Backup Data address and corresponding described Backup Data.
2, method according to claim 1 is characterized in that, described server is cooked up the step of first and second portion at hard disk, comprising:
According to the amount of capacity of described disk volume, in order to calculate the greatest requirements amount of capacity of the said write synchronization replication table of comparisons;
In described hard disk, do not belong in the remaining space of described disk volume and cook up described first; And
In described hard disk, do not belong in the remaining space of described disk volume and described first and cook up described second portion.
3, method according to claim 1 and 2 is characterized in that, the computing method of the greatest requirements amount of capacity of the said write synchronization replication table of comparisons comprise:
Write the amount of capacity of disk block quantity * contrast information of the greatest requirements capacity=disk volume of the synchronization replication table of comparisons; And
The capacity of disk block quantity=disk volume/disk block capacity.
4, method according to claim 2 is characterized in that, the described first position of planning in described hard disk is before the position of described second portion in described hard disk.
5, method according to claim 4 is characterized in that, the part of the described first least significant end of described hard disk, and described second portion part foremost directly continues.
6, method according to claim 1 is characterized in that, when the disk block that has been written into described modification data in to described disk volume when described server is made amendment, directly the disk block of described modification data is made amendment.
7, method according to claim 6, it is characterized in that, when described server desire is carried out the data recovery to described disk volume, read the contrast information of corresponding described modification data from the said write synchronization replication table of comparisons, obtain described Backup Data at described second portion, reach the disk block that described Backup Data is covered described modification data, can recover the disk volume.
CNB2006101687257A 2006-12-19 2006-12-19 Method for snapping magnetic disc using snap index Expired - Fee Related CN100504799C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101687257A CN100504799C (en) 2006-12-19 2006-12-19 Method for snapping magnetic disc using snap index

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101687257A CN100504799C (en) 2006-12-19 2006-12-19 Method for snapping magnetic disc using snap index

Publications (2)

Publication Number Publication Date
CN101206595A CN101206595A (en) 2008-06-25
CN100504799C true CN100504799C (en) 2009-06-24

Family

ID=39566826

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101687257A Expired - Fee Related CN100504799C (en) 2006-12-19 2006-12-19 Method for snapping magnetic disc using snap index

Country Status (1)

Country Link
CN (1) CN100504799C (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2337025A4 (en) * 2008-11-21 2013-10-30 Ibm Method for controlling overwriting of data by tape recording apparatus, program for controlling overwriting, and tape recording apparatus
CN101814044B (en) * 2010-04-19 2013-03-20 中兴通讯股份有限公司 Method and device for processing metadata
CN102456354B (en) * 2010-10-22 2015-05-20 山东新北洋信息技术股份有限公司 Magnetic information recording method, device and magnetic ticket
CN103559103B (en) * 2013-11-06 2016-08-24 华为技术有限公司 Data copy method and device
CN103838647B (en) * 2014-02-17 2018-02-06 中国科学院计算技术研究所 A kind of method and system of the data mode conversion remapped based on snapshot
CN107046811A (en) * 2015-12-03 2017-08-15 华为技术有限公司 One introduces a collection storage device sends the clone file of source file and source file to the method, source storage device and backup storage device of backup storage device
CN107704332B (en) * 2017-09-28 2021-06-15 努比亚技术有限公司 Screen freezing solution method, mobile terminal and computer readable storage medium
CN110765036B (en) * 2018-07-27 2023-11-10 伊姆西Ip控股有限责任公司 Method and device for managing metadata at a control device
CN111324295B (en) * 2018-12-17 2023-09-19 中国移动通信集团四川有限公司 Data migration method, device, equipment and medium
CN110008197B (en) * 2019-04-12 2020-07-07 苏州浪潮智能科技有限公司 Data processing method and system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN101206595A (en) 2008-06-25

Similar Documents

Publication Publication Date Title
CN100504799C (en) Method for snapping magnetic disc using snap index
US8250033B1 (en) Replication of a data set using differential snapshots
CN101777016B (en) Snapshot storage and data recovery method of continuous data protection system
US9996557B2 (en) Database storage system based on optical disk and method using the system
JP6495568B2 (en) Method, computer readable storage medium and system for performing incremental SQL server database backup
JP6033241B2 (en) Backup and restore strategies for data deduplication
CN106354582B (en) A kind of continuous data protection method
EP2494456B1 (en) Backup using metadata virtual hard drive and differential virtual hard drive
CN101777017B (en) Quick recovery method of continuous data protection system
US20080177961A1 (en) Partial Backup and Restore with Backup Versioning
CN100504800C (en) Method for snapshot of magnetic disc
US20100332446A1 (en) Storage pool scrubbing with concurrent snapshots
CN106662981A (en) Storage device, program, and information processing method
CN104156172A (en) Data management for a data storage device
CN104881371A (en) Persistent internal memory transaction processing cache management method and device
CN103765393A (en) Storage system
US11663160B2 (en) Recovering the metadata of data backed up in cloud object storage
CN103605588A (en) Disk backup method of virtue machine
CN106709014A (en) File system conversion method and apparatus
CN105094711B (en) A kind of method and device for realizing copy-on-write file system
US20220404987A1 (en) Storage system, storage control device, and storage control method
CN109164988A (en) Processor-based virtual machine snapshot method and system
CN110457163A (en) A kind of data reconstruction method, device and the storage medium of distributed block storage
KR100775141B1 (en) An implementation method of FAT file system which the journaling is applied method
CN105630692A (en) File storage system storing file directory by using MRAM

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
C41 Transfer of patent application or patent right or utility model
CB03 Change of inventor or designer information

Inventor after: Wang Juan

Inventor before: Chen Zhiwei

COR Change of bibliographic data
TR01 Transfer of patent right

Effective date of registration: 20170301

Address after: Tianjin City, Hongqiao, China Garden Water Garden 12-211-214

Patentee after: Wang Juan

Address before: Taipei City, Taiwan Chinese Shilin District Hougang Street No. 66

Patentee before: Inventec Corporation

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090624

Termination date: 20171219

CF01 Termination of patent right due to non-payment of annual fee