CN114265726A - Disk volume backup method and system with shadow readable and writable - Google Patents
Disk volume backup method and system with shadow readable and writable Download PDFInfo
- Publication number
- CN114265726A CN114265726A CN202111642654.0A CN202111642654A CN114265726A CN 114265726 A CN114265726 A CN 114265726A CN 202111642654 A CN202111642654 A CN 202111642654A CN 114265726 A CN114265726 A CN 114265726A
- Authority
- CN
- China
- Prior art keywords
- volume
- data
- snapshot
- file system
- read
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000012217 deletion Methods 0.000 claims 1
- 230000037430 deletion Effects 0.000 claims 1
- 238000001914 filtration Methods 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 2
- 239000000872 buffer Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method and a system for backing up a volume shadow readable and writable disk volume, wherein the method comprises the following steps: creating a volume snapshot point for a volume needing to be backed up; intercepting the upper layer drive write operation of the volume, reading out the old data in the storage space of the volume to be written with the data, then performing the write operation, and caching the read-out old data; creating a snapshot access object for providing snapshot data reading; generating a virtual disk, loading a file system on the virtual disk, and generating a file system object based on the volume snapshot point in the file system; deleting the files in the snapshot point-based file system object according to the user requirement; and backing up the data in the snapshot point-based file system object after the file is deleted. The method for backing up the disk volume can modify the original copy of the film with the read-only property at will, filter out redundant files and data during backing up and reduce the quantity of backed up data.
Description
Technical Field
The invention belongs to the technical field of disk backup, and particularly relates to a disk volume backup method with a readable and writable volume shadow.
Background
The existing disk backup technology is mainly performed by using a volume Shadow Copy Service (VSS) of Windows, and a disk Shadow snapshot can be made to a current physical host at a specified time point through the volume Shadow Copy Service, and then data Copy is performed on the volume Shadow to complete backup.
The Windows system shadow driver can maintain a snapshot at a certain time point, but does not meet the backup requirement of a user, and cannot be started normally in many cases. The main problems of the Windows system shadow volume driver are as follows:
1. the current volume cannot be opened without sufficient remaining space.
2. A temporary storage file may be created in the current volume so that the backup data is increased.
3. When the volume shadow is modified, the modified data can be stored in a temporary file, and the backup performance is reduced by reading and writing the volume.
4. There may be changes to the functionality of the system each time it is updated, so that our backup program needs to be modified synchronously.
5. The processing behavior of the system shadow driver on the original data cannot be controlled by a user.
In addition, what is more important, the Windows system shadow driver performs backup, and the generated shadow copy cannot be modified, and the generated shadow copy contains data which does not need to be backed up by a user, so that the data is huge and the occupied space is too much.
Disclosure of Invention
In view of this, the present invention provides a method and a system for backing up a disk volume with a readable and writable volume shadow, which delete unnecessary files in a volume shadow copy before backing up, thereby saving storage space.
In order to solve the above technical problems, the present invention provides a backup method for a disk volume with a readable and writable volume shadow, including:
creating a volume snapshot point for a volume needing to be backed up;
intercepting the upper layer drive write operation of the volume, reading out the old data in the storage space of the volume to be written with the data, then performing the write operation, and caching the read-out old data;
creating a snapshot access object for providing snapshot data reading;
generating a virtual disk, loading a file system on the virtual disk, and generating a file system object based on the volume snapshot point in the file system;
deleting the files in the snapshot point-based file system object according to the user requirement;
and backing up the data in the snapshot point-based file system object after the file is deleted.
As an improvement, the read old data is cached in a temporary file of an application layer, and cache overflow is avoided.
As a further improvement, after a file system object based on the snapshot point is generated in the virtual disk, data to be written into the virtual disk is written into the file update cache, the file update cache is read when the data in the virtual disk is read, and if the data is not in the file update cache, the snapshot access object is called for reading. The file updating cache is used for storing rewritten data, and is convenient and rapid to read and write.
As another further improvement, the virtual disk transfers read and write operations to the virtual disk to a read and write processing program of the RamDisk through the shared memory, and the read and write processing program writes data to be written into the virtual disk into a file update cache.
As an improvement, the creating a snapshot point for a volume that needs to be backed up comprises:
the backup application program sends an instruction for creating a volume snapshot point of the volume to the volume filter driver;
the volume filter driver, upon receiving the instruction, creates a volume snapshot point for the volume.
As an improvement, said intercepting an upper-layer drive write operation to the volume, reading old data in the storage space of the volume to which data is to be written, and then performing the write operation, and caching the read old data comprises:
a volume filter driver intercepts the write operation of an upper layer driver to the volume;
the volume filter driver reads out the old data in the storage space of the volume to be written with data and caches the old data in the memory or the unused storage space of the volume;
the upper layer driver writes new data in the volume storage space.
As an improvement, the creating a snapshot access object for providing snapshot data reading comprises:
the backup application program creates a snapshot access object;
and when the snapshot data is read, reading the snapshot data from a temporary file established by the backup application program or directly from the volume filter driver.
As an improvement, the generating a virtual disk, loading a file system on the virtual disk, and generating a file system object based on the volume snapshot in the file system includes:
the backup application program transmits the snapshot access object to a read-write processing program of the RamDisk;
the read-write processing program starts a RamDisk Driver to generate a virtual disk;
and loading a file system in the virtual disk, and generating a file system object based on the volume snapshot point in the file system.
Preferably, the backup application deletes the file in the snapshot point-based file system object, and the backup application backs up the data in the snapshot point-based file system object after the file is deleted.
The invention also provides a disk volume backup system with a readable and writable volume shadow, which comprises a backup application module positioned in an application layer and a volume filtering drive module positioned in a system kernel;
the roll filter drive module includes:
a volume snapshot point creating unit for creating a volume snapshot point;
the command intercepting unit is used for intercepting an upper layer drive writing command, reading out old data to be written in the volume of storage space, then performing writing operation, and caching the read-out old data;
the backup application module comprises:
the snapshot access object creating unit is used for creating a snapshot access object;
the data caching unit is used for caching data into a temporary file;
the file deleting unit is used for deleting the files in the file system;
and the data backup unit is used for carrying out data backup.
As an improvement, the backup application module further comprises a data caching unit for caching data to the temporary file.
The invention has the advantages that: the method for backing up the disk volume can modify the original copy of the film with the read-only property at will, filter out redundant files and data during backing up and reduce the quantity of backed up data.
Drawings
FIG. 1 is a flow chart of the present invention.
Fig. 2 is a schematic diagram of the structure of the present invention.
FIG. 3 is a flowchart of a Windows system file access framework.
Detailed Description
In order that those skilled in the art will better understand the technical solutions of the present invention, the present invention will be further described in detail with reference to the following embodiments.
The general framework flow of the file access of the Windows system is shown in fig. 3, and includes:
1. and calling the system read-write API by the application program to generate a request and sending the request to the file system driver.
2. The file system analyzes the content of the request, locates the content to the storage position of the file, converts the content into block reading and writing of the volume and sends the request to the volume driver.
3. The volume driver may comprise a filter driver that responds to requests layer by layer starting from the upper layer volume filter driver. And finally, the volume drive converts the read-write request to the disk and sends the read-write request to the disk.
4. And reading and writing the data on the magnetic disk by the magnetic disk, and returning results to the upper layer by layer in the original way.
The volume filtering driver in the invention refers to a driver program which can intercept and filter the upper layer read-write request of the volume, and can expand the functions of equipment or encrypt data and the like.
As shown in fig. 1, the present invention provides a method for backing up a disk volume with a volume shadow capable of being read and written, including:
s1 creating volume snapshot point for the volume needing to be backed up;
s2 intercepting the upper layer drive write operation of the volume, reading the old data in the storage space of the volume to be written with data, then performing the write operation, and caching the read old data;
s3 caching the read old data in a temporary file of an application layer;
s4 creating a snapshot access object for providing snapshot data reads;
s5 generating a virtual disk, loading a file system on the virtual disk, and generating a file system object based on the volume snapshot point in the file system;
s6, writing the data needed to be written into the virtual disk into the file update cache, and reading the file update cache when reading the data in the virtual disk, if the data is not in the file update cache, calling the snapshot access object to read.
S7, deleting the files in the file system based on the snapshot points according to the user requirements;
s8 backs up the data in the snapshot point-based file system after the file is deleted.
The following describes each step in detail.
In step S1, the method specifically includes:
s11 the backup application sends an instruction to the volume filter driver to create a volume snapshot of the volume;
the S12 volume filter driver creates a volume snapshot point for the volume upon receiving the instruction.
The user sends an instruction for creating the volume snapshot point of the volume to the volume filter driver of the disk volume needing to be backed up through the backup application program, and the volume filter driver creates the volume snapshot point of the volume after receiving the instruction. By volume snapshot is meant a fully available copy on a certain disk volume, which copy comprises an image of the corresponding data at a certain point in time (the point in time when the copy starts). And a volume snapshot point refers to the point in time.
In step S2, the method specifically includes:
and the S21 volume filtering drive refreshes the buffer and enters the working state. The purpose of refreshing the cache is to maintain the data consistency of the file system, and if part of the data in the cache is not written into the disk, the backed-up data at this point in time is incomplete.
The S22 volume filter driver intercepts write operations to the volume by the upper layer driver with the purpose of avoiding overwriting old data with new data that is written.
S23 the volume filtering driver reads out the old data in the storage space of the volume to be written with data and buffers the old data; specifically cached in memory or unused storage space of the volume.
In step S3, the backup application starts a worker thread to transfer the old data in the volume filter driver cache to the application layer, and caches the old data in the temporary file to avoid the cache overflow of the driver.
In step S4, specifically, the backup application creates a snapshot access object; and when the snapshot data is read, reading the snapshot data from a temporary file established by the backup application program or directly from the volume filter driver. The so-called snapshot access object is similar to an access interface to the volume snapshot, and the volume snapshot data can be accessed by calling the snapshot access object.
In step S5, the method specifically includes:
s51 the backup application program transmits the snapshot access object to the read-write processing program of RamDisk; RamDisk is a device type in Windows, which provides example source code. The driver may create such a virtual device.
S52, the read-write processing program starts a RamDisk Driver to generate a virtual disk;
s53 loads the file system in the virtual disk, and the operating system generates a file system object based on the volume snapshot in the file system. At this time, the file in the file system object is in a modifiable state, and the user can modify the file arbitrarily.
In step S6, the virtual disk transmits the read/write operation to the virtual disk to the read/write processing program of the RamDisk through the shared memory, and the read/write processing program writes data that needs to be written to the virtual disk into the file update cache. The virtual disk and the read-write processing program share the memory, so that data intercommunication is realized between the virtual disk and the read-write processing program. And the read-write processing program acquires the read-write operation command of the virtual disk through the shared memory. The file update cache is a space for specially storing rewritten data, and after the data is written into the file update cache, a read request for the virtual disk is preferentially read in the file update cache, so that the reading speed is improved. If the data is not in the file update cache, the snapshot access object created by the previous backup application is invoked.
In step S7, the user deletes the file in the snapshot point-based file system object through the backup application.
In step S8, specifically, the backup application program backs up the data in the snapshot point-based file system object after the file is deleted, and the backup data may be stored locally, in a network, or in a cloud.
As shown in fig. 2, the present invention further provides a disk volume backup system with a readable and writable volume shadow, which includes a backup application module located in an application layer and a volume filter driver module located in a system kernel;
the roll filter drive module includes:
a volume snapshot point creating unit for creating a volume snapshot point;
the command intercepting unit is used for intercepting an upper layer drive writing command, reading out old data to be written in the volume of storage space, then performing writing operation, and caching the read-out old data;
the backup application module comprises:
the data caching unit is used for caching data into a temporary file;
the snapshot access object creating unit is used for creating a snapshot access object;
the file deleting unit is used for deleting the files in the file system object;
and the data backup unit is used for carrying out data backup.
The above is only a preferred embodiment of the present invention, and it should be noted that the above preferred embodiment should not be considered as limiting the present invention, and the protection scope of the present invention should be subject to the scope defined by the claims. It will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the spirit and scope of the invention, and these modifications and adaptations should be considered within the scope of the invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111642654.0A CN114265726B (en) | 2021-12-29 | 2021-12-29 | Disk volume backup method and system with readable and writable shadow |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111642654.0A CN114265726B (en) | 2021-12-29 | 2021-12-29 | Disk volume backup method and system with readable and writable shadow |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114265726A true CN114265726A (en) | 2022-04-01 |
| CN114265726B CN114265726B (en) | 2025-04-15 |
Family
ID=80831699
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111642654.0A Active CN114265726B (en) | 2021-12-29 | 2021-12-29 | Disk volume backup method and system with readable and writable shadow |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114265726B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114756330A (en) * | 2022-04-28 | 2022-07-15 | 成都易我科技开发有限责任公司 | Method and system for accessing virtual machine disk and electronic equipment |
| CN115373897A (en) * | 2022-06-27 | 2022-11-22 | 四川效率源信息安全技术股份有限公司 | A method of reading volume shadow backup data |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102402471A (en) * | 2011-12-23 | 2012-04-04 | 创新科软件技术(深圳)有限公司 | Data real-time backup method and system based on storage array snapshot function |
| CN102999433A (en) * | 2012-11-21 | 2013-03-27 | 北京航空航天大学 | Redundant data deletion method and system of virtual disks |
| CN106293882A (en) * | 2016-08-12 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of virtual disk snapshot implementing method and device |
| CN108984342A (en) * | 2018-07-06 | 2018-12-11 | 无锡华云数据技术服务有限公司 | Improved streaming incremental backup method and device based on virtual disk files |
| CN113127151A (en) * | 2021-03-25 | 2021-07-16 | 山东英信计算机技术有限公司 | Real-time copying method, system and medium for data in virtualization environment |
| US11068353B1 (en) * | 2017-09-27 | 2021-07-20 | Veritas Technologies Llc | Systems and methods for selectively restoring files from virtual machine backup images |
-
2021
- 2021-12-29 CN CN202111642654.0A patent/CN114265726B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102402471A (en) * | 2011-12-23 | 2012-04-04 | 创新科软件技术(深圳)有限公司 | Data real-time backup method and system based on storage array snapshot function |
| CN102999433A (en) * | 2012-11-21 | 2013-03-27 | 北京航空航天大学 | Redundant data deletion method and system of virtual disks |
| CN106293882A (en) * | 2016-08-12 | 2017-01-04 | 浪潮(北京)电子信息产业有限公司 | A kind of virtual disk snapshot implementing method and device |
| US11068353B1 (en) * | 2017-09-27 | 2021-07-20 | Veritas Technologies Llc | Systems and methods for selectively restoring files from virtual machine backup images |
| CN108984342A (en) * | 2018-07-06 | 2018-12-11 | 无锡华云数据技术服务有限公司 | Improved streaming incremental backup method and device based on virtual disk files |
| CN113127151A (en) * | 2021-03-25 | 2021-07-16 | 山东英信计算机技术有限公司 | Real-time copying method, system and medium for data in virtualization environment |
Non-Patent Citations (1)
| Title |
|---|
| 褚福勇 等: "虚拟机备份机制研究", 计算机工程与科学, no. 09, 15 September 2009 (2009-09-15), pages 135 - 138 * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114756330A (en) * | 2022-04-28 | 2022-07-15 | 成都易我科技开发有限责任公司 | Method and system for accessing virtual machine disk and electronic equipment |
| CN115373897A (en) * | 2022-06-27 | 2022-11-22 | 四川效率源信息安全技术股份有限公司 | A method of reading volume shadow backup data |
| CN115373897B (en) * | 2022-06-27 | 2025-05-23 | 四川效率源信息安全技术股份有限公司 | A method for reading volume shadow backup data |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114265726B (en) | 2025-04-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9778860B2 (en) | Re-TRIM of free space within VHDX | |
| US6587933B2 (en) | Method, system, and program for discarding data in a storage system where updates to a primary storage device are shadowed in a secondary storage device | |
| US6694413B1 (en) | Computer system and snapshot data management method thereof | |
| CN108701048B (en) | Data loading method and device | |
| JP5346536B2 (en) | Information backup / restore processing device and information backup / restore processing system | |
| US20190102262A1 (en) | Automated continuous checkpointing | |
| US10402313B2 (en) | Method and system for accessing a storage system with multiple file systems | |
| US7610460B2 (en) | Buffer updates and data evacuation in a storage system using differential snapshots | |
| US20060047926A1 (en) | Managing multiple snapshot copies of data | |
| US11030092B2 (en) | Access request processing method and apparatus, and computer system | |
| CN102511044A (en) | A method and device for deleting data | |
| US7673096B2 (en) | Control apparatus for controlling virtual storage | |
| JP2004127294A (en) | Virtual storage system and its operation method | |
| JP4222917B2 (en) | Virtual storage system and operation method thereof | |
| CN114265726B (en) | Disk volume backup method and system with readable and writable shadow | |
| JP2007249573A (en) | Storage system for issuing optimum I / O command to automatically expandable volume and control method thereof | |
| CN101968721A (en) | Method to speed up access to an external storage device and external storage device | |
| JPWO2010055937A1 (en) | Computer system, data storage method and program | |
| US20190286369A1 (en) | TECHNIQUES FOR REDUCING WRITE AMPLIFICATION ON SOLID STATE STORAGE DEVICES (SSDs) | |
| JPH07191811A (en) | Magnetic disk drive migration method | |
| CN117170582A (en) | Method, device, equipment and storage medium for implementing redirection-on-write snapshot | |
| CN116225334A (en) | A cold and hot data storage method, device and medium | |
| JP2008090378A (en) | Hybrid file system, operating system, cache control method, and recording medium | |
| JP4394467B2 (en) | Storage system, server apparatus, and preceding copy data generation method | |
| US20210157498A1 (en) | Caching method for hybrid cloud storage running dev/test on public cloud |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |