CN117370071A - Disk backup method based on partition characteristics - Google Patents

Disk backup method based on partition characteristics Download PDF

Info

Publication number
CN117370071A
CN117370071A CN202311076788.XA CN202311076788A CN117370071A CN 117370071 A CN117370071 A CN 117370071A CN 202311076788 A CN202311076788 A CN 202311076788A CN 117370071 A CN117370071 A CN 117370071A
Authority
CN
China
Prior art keywords
partition
backup
data
disk
file
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
CN202311076788.XA
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.)
Inesa R&d Center
Original Assignee
Inesa R&d Center
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 Inesa R&d Center filed Critical Inesa R&d Center
Priority to CN202311076788.XA priority Critical patent/CN117370071A/en
Publication of CN117370071A publication Critical patent/CN117370071A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a disk backup method based on partition characteristics, which comprises the following steps: scanning a target to be backed up of a disk, and dividing the target to be backed up into a partition table, a partition type and partition data; classifying partition types and partition data; recording information of the partition table, the partition type and the partition data to form a mark table; based on the mark table, the partition type and the classification result of the partition data, carrying out backup by adopting different backup modes to generate a backup file; checking the backup file and generating a check code file; and packaging the backup file and the corresponding check code file to generate a final backup file. Compared with the prior art, the invention has the advantages of ensuring the complete backup of the whole disk content, saving the storage space and time and the like.

Description

Disk backup method based on partition characteristics
Technical Field
The invention relates to the field of data backup and recovery, in particular to a disk backup method based on partition characteristics.
Background
Disk backup refers to the process of copying data in a hard disk to another location to prevent loss or corruption of data. Currently, there are two main types of disk backup techniques in common use: disk mirror backup and file system backup. Disk image backup refers to the creation of an image of a hard disk by storing all the data in the hard disk, including partition tables, operating systems, applications, and settings, in a compressed format as a single file. File system backup refers to copying files or folders in a hard disk to another location according to the original structure and format. A data block is a basic unit for storing file or directory data in a file system, and is typically a logical block composed of a plurality of sectors (minimum unit of disk reading and writing). The size of the data blocks is determined by the type and configuration of the file system, and different file systems may have different data block sizes. A disk partition with a file system may have its data blocks in three states:
a) The allocated and used data blocks (valid data), i.e., data blocks storing file or directory data being used by the file system, i.e., valid data;
b) Allocated but not cleared data blocks (dirty data), i.e., data blocks that store deleted file or directory data in the file system, but are not covered or reclaimed;
c) Unallocated data blocks (unused), i.e., data blocks allocated to a file system but not used, do not store any valid file or directory data.
The disk mirror image backup can backup the content of the whole hard disk, is convenient for recovering the whole system when the hard disk fails or is damaged, but needs to backup all sectors, and occupies a large amount of storage space and time. The file system backup technology can only backup the effective data blocks of the file system, so that a large amount of storage space and time are saved, but the use scene is narrow, the disk partition information cannot be backed up, and the bare equipment partition cannot be backed up. Therefore, the existing disk backup technology has respective advantages and disadvantages, and cannot meet the backup requirements of different types of partitions and data.
Disclosure of Invention
The invention aims to provide a disk backup method based on partition characteristics, which saves storage space under the condition of completely backing up the whole hard disk content.
The aim of the invention can be achieved by the following technical scheme:
a disk backup method based on partition characteristics comprises the following steps:
scanning a target to be backed up of a disk, and dividing the target to be backed up into a partition table, a partition type and partition data;
classifying the partition type and the partition data;
recording information of the partition table, the partition type and the partition data to form a mark table;
based on the marking table, partition types and classification results of partition data, carrying out backup by adopting different backup modes to generate backup files;
checking the backup file and generating a check code file;
and packaging the backup file and the corresponding check code file to generate a final backup file.
Further, a scanner is adopted to scan the target to be backed up of the magnetic disk.
Further, the classification result of the partition type is a bare device partition, a data partition and a data-free partition.
Further, the bare device partition adopts a disk mirror image backup mode.
Further, the data partition adopts a file system backup mode.
Further, the data partition is not backed up.
Further, the classification result of the partition data is effective data, dirty data and unused data, wherein the effective data adopts a file system backup mode, and the dirty data and the unused data are not backed up.
Further, a verifier is adopted to verify the backup file.
Further, the method also comprises the step of cleaning all files except the final backup file, and releasing the disk space occupied in the backup process.
Further, the tag table is manually confirmed or modified.
Compared with the prior art, the invention has the following beneficial effects:
(1) The invention divides the object to be backed up of the disk into the partition table, the partition type and the partition data, and divides the partition type and the partition data so as to backup according to the partition according to the division result, thereby achieving the effect of saving backup time and space.
(2) The invention adopts mirror image backup, system backup and skip backup modes aiming at the bare equipment partition, the data partition and the data partition, the integrity and the safety of data can be ensured by using the disk mirror image backup, the data quantity can be reduced and the speed can be improved by using the file system backup, thereby taking the advantages of the disk mirror image backup and the file system backup into consideration, improving the backup speed and saving the space.
(3) The invention can flexibly recover different types of data so as to meet different requirements of users.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of the embodiment of the invention adopting different backup modes for different partitions;
FIG. 3 is a schematic diagram of a backup recovery operation according to an embodiment of the present invention.
Detailed Description
The invention will now be described in detail with reference to the drawings and specific examples. The present embodiment is implemented on the premise of the technical scheme of the present invention, and a detailed implementation manner and a specific operation process are given, but the protection scope of the present invention is not limited to the following examples.
The embodiment provides a disk backup method based on partition characteristics, as shown in fig. 1, the method includes the following steps:
s1, scanning a target to be backed up of a disk, and dividing the target to be backed up into a partition table, a partition type and partition data.
In this embodiment, a scanner is used to scan the target to be backed up.
S2, classifying the partition types and the partition data.
This step further classifies partition types, including bare device partition, data partition, no data partition.
For the types of bare device partitions and data partitions, the partition data is further classified, including valid data, dirty data and unused, so that different backup modes are used for the different classified partitions in subsequent steps.
And S3, recording information of the partition table, the partition type and the partition data to form a mark table.
And recording the partition table, the partition type and the partition data information obtained by scanning by the scanner to form a mark table. The marking list is displayed to the operation user, and the content is confirmed to be correct or modified pertinently by manual work.
And S4, backing up by adopting different backup modes based on the marking table, the partition type and the classification result of the partition data, and generating a backup file.
In the backup process, the mark table is used for tracking the execution condition of the backup operation and recording the positions and states of the backed-up data and the data to be backed-up. The mark table records the start point and the end point of backup, and when the data needs to be restored, the data needing to be restored is quickly positioned according to the backup range recorded by the mark table. The mark table can also record the position and state of the target to be backed up, and the data to be backed up is determined according to the mark table in the backup process, and the backup operation is performed according to the set backup mode.
Different backup modes are used for different partition types and partition data, as shown in fig. 2, in this embodiment, a mirror backup mode is used for a bare device partition; the file system backup mode is used for the data partition, only effective data is backed up, the backup speed can be improved, and the backup space occupation is reduced; and for the data-free partition, skipping the backup of the partition, and only backing up the partition table information, wherein the backup time and space are nearly 0. The larger the space of this partition, the more backup time and storage space saved. For all partitions of the partition data classified as dirty data and unused data, no backup operation is performed.
And (3) finishing the backup of each area according to the backup mode, synchronously recording the backup state and the progress information in the recording table, and correspondingly packaging the two to form a backup file.
In order to illustrate that the example shortens the backup time and reduces the backup space, the total size of the disk partition is set as D (unit: GB). The partition has used a total sector size of W (unit: GB) and a total effective data size of E (unit: GB). The disk reading rate is R (unit: GB/S), the disk writing rate is S (unit: GB/S), the compression ratio is C, and the data compression rate is T (unit: GB/S), then the disk mirror image backup time is B (unit: S).
The conventional disk mirror backup time is b=d/r+w×c/s+w/T, the storage space required for backup data is w×c, and the backup time required for this embodiment is a=e/r+e×c/s+e/T, and the storage space required for backup data is e×c. Therefore, the backup time saved in this embodiment is B-a= (D-E)/r+ (W-E) C/s+ (W-E)/T, and the saved storage space is (W-E) C.
S5, checking the backup file and generating a check code file.
And the verifier verifies the files generated by the backup of each part and generates corresponding verification code files.
And S6, packaging the backup file and the corresponding check code file to generate a final backup file.
And packaging all backups and checks generated by the backup machine and the checker to generate a final backup file.
The embodiment further comprises cleaning all files except the final backup file, and releasing the disk space occupied in the backup process.
In order to verify the validity of the method, the embodiment uses hardware monitoring alarm to learn that a 2TB disk is about to fail as a background for verification in the distributed storage ceph. The structure of the magnetic disk is two partitions, wherein the size of partition 1 is 10GB, and the type is bare equipment; partition 2 is 1.99TB in size and is a data partition of type. Partition 1 actually uses a 10GB size and partition 2 actually uses a 1TB size. The hard disk data is maintained, the hard disk data is kicked out of a cluster, and the effective data size of the data partition is calculated according to the read-write speed of the disk to be 100MB/s, the data compression rate to be 20% and the data compression speed to be 80MB/s at present:
according to the conventional backup method, the required backup time is 10×1000/100+10×20%/100+10×1000/80+1.99×1000/100+1×1000×1000×20%/100+1×1000×1000/80= 34645s, and the backup file size is (10×1000+1.99×1000×1000) ×20% =200000 MB;
in the backup manner of this embodiment, the required backup time is 10×1000/100+10×1000×20%/100+10×1000/80+200/100+200×20%/100+200/80=249.9 s, and the backup file size is (10×1000+200) ×20% =2040 MB.
As shown in fig. 3, a backup file recovery operation using the disk backup method of this example is shown, specifically:
firstly unpacking the final backup file, and unpacking the data files (including the partition table file, the mark table and the backup data file) and the check code file; the verification data file is adopted for content comparison, so that the integrity of the data file is ensured; recovering a disk partition table by using a partition table file in the data file; partition recovery is performed in different ways depending on the contents of the tag table: and the method for recovering the mirror image is used for the bare equipment partition, the file system is used for recovering the data partition, and the recovery operation of the backup file is finally completed without any operation for the data partition.
The above functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The scheme in the embodiment of the invention can be realized by adopting various computer languages, such as object-oriented programming language Java, an transliteration script language JavaScript and the like.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A disk backup method based on partition characteristics is characterized by comprising the following steps:
scanning a target to be backed up of a disk, and dividing the target to be backed up into a partition table, a partition type and partition data;
classifying the partition type and the partition data;
recording information of the partition table, the partition type and the partition data to form a mark table;
based on the marking table, partition types and classification results of partition data, carrying out backup by adopting different backup modes to generate backup files;
checking the backup file and generating a check code file;
and packaging the backup file and the corresponding check code file to generate a final backup file.
2. The method for disk backup based on partition characteristics according to claim 1, wherein a scanner is used to scan the target to be backed up of the disk.
3. The method for disk backup based on partition characteristics according to claim 1, wherein the classification result of the partition type is a bare device partition, a data partition, and a data-free partition.
4. The method for disk backup based on partition characteristics according to claim 3, wherein the bare device partition adopts a disk mirror backup mode.
5. The method for disk backup based on partition characteristics according to claim 3, wherein the data partition adopts a file system backup mode.
6. A method of disk backup based on partition characteristics as recited in claim 3 wherein the non-data partition does not perform a backup.
7. The method for disk backup based on partition characteristics according to claim 1, wherein the classification result of the partition data is valid data, dirty data and unused data, the valid data adopts a file system backup mode, and the dirty data and the unused data are not backed up.
8. The method for disk backup based on partition characteristics according to claim 1, wherein a verifier is used to verify the backup file.
9. The method of claim 1, further comprising cleaning all files except the final backup file to free up disk space occupied during backup.
10. The method of claim 1, wherein the mark table is manually identified or modified.
CN202311076788.XA 2023-08-24 2023-08-24 Disk backup method based on partition characteristics Pending CN117370071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311076788.XA CN117370071A (en) 2023-08-24 2023-08-24 Disk backup method based on partition characteristics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311076788.XA CN117370071A (en) 2023-08-24 2023-08-24 Disk backup method based on partition characteristics

Publications (1)

Publication Number Publication Date
CN117370071A true CN117370071A (en) 2024-01-09

Family

ID=89388077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311076788.XA Pending CN117370071A (en) 2023-08-24 2023-08-24 Disk backup method based on partition characteristics

Country Status (1)

Country Link
CN (1) CN117370071A (en)

Similar Documents

Publication Publication Date Title
KR100510808B1 (en) A log-structured write cache for data storage devices and systems
CN110187999B (en) Address mapping data backup method and device
US6542975B1 (en) Method and system for backing up data over a plurality of volumes
US5086502A (en) Method of operating a data processing system
US7640412B2 (en) Techniques for improving the reliability of file systems
US7631158B2 (en) Disk snapshot method using a copy-on-write table in a user space
US8332581B2 (en) Stale track initialization in a storage controller
US8606751B1 (en) System and method for backup by inode number
DE112006003260T5 (en) Method for dynamically exposing backup and restore drives
US10572335B2 (en) Metadata recovery method and apparatus
RU2007103336A (en) RECORDING MEDIA, RECORDING / PLAYBACK DEVICE AND RECORDING / PLAYBACK METHOD
US20140365824A1 (en) Method for recovering hard disk data, server and distributed storage system
US6718466B1 (en) Data medium with restorable original base data content, and method for its production
US7234078B2 (en) Data recovery method and data recording apparatus
CN105354109A (en) Backup method and apparatus for video monitoring index data
EP0483174B1 (en) A method of operating a data processing system
CN116483284B (en) Method, device, medium and electronic equipment for reading and writing virtual hard disk
CN102508743A (en) Multi-point backup and real-time protection method for Linux file system
WO2009110665A1 (en) Information storage medium for recording data according to journaling file system, and method of and apparatus for writing/recovering data using journaling file system
CN117370071A (en) Disk backup method based on partition characteristics
US7529973B2 (en) Method of and apparatus for taking back-up and checking alteration of data, and computer product
CN111399774B (en) Data processing method and device based on snapshot under distributed storage system
CN113868018A (en) Data storage method and device and data recovery method
CN112286720A (en) Method for extracting deleted data after TRIM command is started by solid state disk controlled by SM2246EN
CN110688257A (en) Method, device and equipment for repairing local metadata of full flash memory array

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication