CN117555727A - Method for quickly backing up FAT32 file system - Google Patents

Method for quickly backing up FAT32 file system Download PDF

Info

Publication number
CN117555727A
CN117555727A CN202311419481.5A CN202311419481A CN117555727A CN 117555727 A CN117555727 A CN 117555727A CN 202311419481 A CN202311419481 A CN 202311419481A CN 117555727 A CN117555727 A CN 117555727A
Authority
CN
China
Prior art keywords
block
bitmap
file system
backup
fat32 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
CN202311419481.5A
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.)
Chengdu Aomei Technology Co ltd
Original Assignee
Chengdu Aomei Technology Co ltd
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 Chengdu Aomei Technology Co ltd filed Critical Chengdu Aomei Technology Co ltd
Priority to CN202311419481.5A priority Critical patent/CN117555727A/en
Publication of CN117555727A publication Critical patent/CN117555727A/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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

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 discloses a method for quickly backing up FAT32 file system, which comprises the following steps: step S1, creating a snapshot for a backup object through a volume filtering driving system; step S2, obtaining the total sector number of the FAT32 file system; step S3, obtaining the total index number according to the total sector number and the block size of the system; s4, judging the total number of indexes and the maximum index number allowed by the system; step S5, reading bitmap data of the FAT32 file system from the snapshot, and calculating the bitmap according to the number of sectors which can be accommodated by the block; s6, reconstructing a bitmap B2 divided by blocks according to bitmap information included in each block calculated in the step S5; and S7, carrying out data backup on each block according to the bitmap B2 marked in the step S6 and divided by the block. By the method, the FAT32 file system backup can be realized rapidly, accurately and reliably, the backup efficiency and the data integrity are improved, and the beneficial effects are provided for the safety protection and the recovery of the data.

Description

Method for quickly backing up FAT32 file system
Technical Field
The invention belongs to the technical field of computer data backup, and particularly relates to a method for quickly backing up a FAT32 file system.
Background
Because the data volume of the current generation increases faster, a large amount of data can be produced by a plurality of enterprises and individuals, no matter the enterprises or the individuals have the data backup requirement, but the data generally has the characteristic of repeatability, and more storage space is occupied if the data is completely backed up each time, so the invention provides a scheme for the complete backup and the incremental backup of the FAT32 file system, and simultaneously, the requirement on the storage space is reduced by compressing and increasing the data, and the backup speed can be greatly increased.
In the prior art, for example, publication No.: the invention of "CN111414280A" is described in the following: the method comprises the steps of reading a special file $bitmap in an NTFS volume, judging the validity of a data block with given offset according to the content of the $bitmap file, and copying only the valid data block in the backup process, so that the quick mirroring of the NTFS volume is realized without losing normal files.
In the prior art, there are special files that are relied upon: this scheme relies on the special file $bitmap in the NTFS volume to determine the validity of the data block. If Bitmap is used to determine the validity of the data block. If the Bitmap file itself is damaged or wrong, the validity of the data block cannot be accurately judged, so that the problem that a normal file is lost or an invalid data block is copied in the backup process may be caused.
Disclosure of Invention
The invention aims to provide a method for quickly backing up a FAT32 file system, which solves the problems of large storage space and long backup time required by the FAT32 file system and backup data because the data volume of individuals and enterprises is increased quickly and the data backup requirements are met in the prior art.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for quickly backing up FAT32 file systems, comprising the steps of:
step S1, creating a snapshot for a backup object through a volume filtering driving system;
s2, reading DBR of the FAT32 file system from the snapshot, and acquiring the total sector number of the FAT32 file system through the DBR of the FAT32 file system;
step S3, calculating according to the total sector number of the FAT32 file system and the block size of the system to obtain the total index number;
s4, judging the total number of indexes and the maximum index number allowed by the system; if the total index number is larger than the maximum index number allowed by the system, the size of each block is adjusted and then recalculated; if not, continuing;
step S5, reading bitmap data of the FAT32 file system from the snapshot, and calculating the bitmap according to the number of sectors which can be accommodated by the block according to the number of sectors which are contained in each block calculated in the previous step;
s6, reconstructing a bitmap B2 divided by blocks according to bitmap information included in each block calculated in the step S5, and re-marking the bitmap B2 divided by blocks according to the use condition of the FAT32 file system after the division by blocks to confirm the blocks needing backup;
step S7, carrying out data backup on each block according to the bitmap B2 marked in the step S6 and divided by the block; skipping if the bitmap B2 divided by blocks is 0; if the bitmap B2 divided by the blocks is 1, the original bitmap information B1 of the FAT32 corresponding to the block is calculated, the used clusters are obtained from the original bitmap B1, and the used clusters are read according to the used condition of the blocks in the original bitmap B1; writing the index information of each recorded block and the data of each block to be backed up into a cache; and writing the mirror image file after the cache is fully written until the backup is completed and writing the index information into the mirror image file.
According to the above technical solution, the total number of indexes = total size of partitions/block size of system.
According to the above technical solution, in step S4, the maximum index number is determined according to the size of the current single index and the proportion of the memory to be occupied, so as to ensure that the total number of indexes is within the allowed maximum index number range, thereby ensuring the stability of the system.
According to the above technical solution, in step S6, the labeling is specifically:
dividing the original bitmap B1 of the FAT32 file system by the byte number of each block, checking whether B1 in the original bitmap of the FAT32 contained in each block has a value other than 0, if B1 in the original bitmap has a value other than 0, indicating that the area indicated by B1 in the original bitmap has a used sector, setting B1 in the original bitmap indicating the block to 1, indicating that the block has been used, and backing up the block when backing up.
According to the above technical solution, in step S7, after the data of the block is read into the buffer, hash, compress, and encrypt operations are performed on the block.
According to the above technical solution, the index information includes a bitmap of the block, hash, a start sector, a compressed size, and an actual size.
Compared with the prior art, the invention has the following beneficial effects:
quick backup: the method can quickly backup the FAT32 file system by creating a snapshot and dividing the FAT32 file system in a block mode. Compared with the traditional file-by-file backup, the backup time and resource consumption can be greatly reduced by the block backup, and the backup efficiency is improved.
Accurate backup: by reading DBR and bitmap data of FAT32 file system, the structure and service condition of the file system can be accurately obtained. The used clusters and data can be accurately backed up by block backup, unnecessary idle clusters and invalid data are avoided to be backed up, and the storage space is saved.
Adjusting the size of the block: in step S4, if the total number of indexes exceeds the maximum number of indexes allowed by the system, it may be recalculated by adjusting the size of each block. Therefore, the backup process can be optimized according to the requirements and the limitations of the system, and the feasibility and the compatibility of the backup are ensured.
Data integrity: by backing up and recording index information of each block by block, the integrity and consistency of the backed up data can be ensured. In the backup process, data reading and writing can be performed on each block, the backup data is ensured to be consistent with the original data, and errors possibly occurring in the backup process can be detected and repaired.
Flexibility and scalability: the method can be flexibly adjusted and expanded according to the requirement. By adjusting the block size and the backup policy, the FAT32 file system with different sizes and types can be adapted. Meanwhile, proper storage equipment and backup strategies can be selected according to actual requirements, and the backup requirements of different scenes are met.
In summary, by the method, the FAT32 file system backup can be realized rapidly, accurately and reliably, the backup efficiency and the data integrity are improved, and the beneficial effects are provided for the safety protection and recovery of the data.
Drawings
FIG. 1 is a backup flow chart of the present invention;
FIG. 2 is a block diagram I of the present invention;
FIG. 3 is a block diagram of the second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
As shown in fig. 1, a method for quickly backing up a FAT32 file system is characterized in that: the method comprises the following steps:
step S1, creating a snapshot for a backup object through a volume filtering driving system;
s2, reading DBR of the FAT32 file system from the snapshot, and acquiring the total sector number of the FAT32 file system through the DBR of the FAT32 file system;
step S3, calculating according to the total sector number of the FAT32 file system and the block size of the system to obtain the total index number;
s4, judging the total number of indexes and the maximum index number allowed by the system; if the total index number is larger than the maximum index number allowed by the system, the size of each block is adjusted and then recalculated; if not, continuing;
step S5, reading bitmap data of the FAT32 file system from the snapshot, calculating the bitmap according to the number of sectors contained in each block calculated in the previous step (one data block usually contains a plurality of sectors, each block usually has a default value, and if the index calculated by using the default value exceeds the maximum index number, adjusting the size of the default value of the data block), and calculating the bitmap according to the number of sectors which can be contained in the block;
step S6, reconstructing a bitmap B2 divided by blocks according to bitmap information (namely, the minimum storage unit of the partition is a cluster, each cluster corresponds to a bitmap with one bit, a plurality of clusters are divided into a storage block, so that one block comprises bitmaps of a plurality of clusters) included in each block calculated in the step S5, and re-marking the bitmap B2 divided by blocks according to the use condition of the FAT32 file system according to the original bitmap B1 divided by blocks, so as to confirm the blocks needing backup;
step S7, carrying out data backup on each block according to the bitmap B2 marked in the step S6 and divided by the block; skipping if the bitmap B2 divided by blocks is 0; if the bitmap B2 divided by the blocks is 1, the original bitmap information B1 of the FAT32 corresponding to the block is calculated, the used clusters are obtained from the original bitmap B1, and the used clusters are read according to the used condition of the blocks in the original bitmap B1; writing the index information of each recorded block and the data of each block to be backed up into a cache; and writing the mirror image file after the cache is fully written until the backup is completed and writing the index information into the mirror image file.
By the method, the FAT32 file system can be quickly backed up, and the following beneficial effects are obtained:
quick backup: the method can quickly backup the FAT32 file system by creating a snapshot and dividing the FAT32 file system in a block mode. Compared with the traditional file-by-file backup, the backup time and resource consumption can be greatly reduced by the block backup, and the backup efficiency is improved.
Accurate backup: by reading DBR and bitmap data of FAT32 file system, the structure and service condition of the file system can be accurately obtained. The used clusters and data can be accurately backed up by block backup, unnecessary idle clusters and invalid data are avoided to be backed up, and the storage space is saved.
Adjusting the size of the block: in step S4, if the total number of indexes exceeds the maximum number of indexes allowed by the system, it may be recalculated by adjusting the size of each block. Therefore, the backup process can be optimized according to the requirements and the limitations of the system, and the feasibility and the compatibility of the backup are ensured.
Data integrity: by backing up and recording index information of each block by block, the integrity and consistency of the backed up data can be ensured. In the backup process, data reading and writing can be performed on each block, the backup data is ensured to be consistent with the original data, and errors possibly occurring in the backup process can be detected and repaired.
Flexibility and scalability: the method can be flexibly adjusted and expanded according to the requirement. By adjusting the block size and the backup policy, the FAT32 file system with different sizes and types can be adapted. Meanwhile, proper storage equipment and backup strategies can be selected according to actual requirements, and the backup requirements of different scenes are met.
In summary, by the method, the FAT32 file system backup can be realized rapidly, accurately and reliably, the backup efficiency and the data integrity are improved, and the beneficial effects are provided for the safety protection and recovery of the data.
Example two
The invention is characterized in that: the full back-up FAT32 file system includes the steps of:
in order to ensure consistency of data backed up by the backup system, a snapshot is created for the backup object by the volume filtering driving system, then the DBR of the FAT32 file system is read from the snapshot, and the total sector number of the file system is obtained from the DBR of the FAT32 file system.
Calculating according to the total sector number of the file system and the default block size of the system to obtain the total index number; total number of indexes = total size of partition/default block size, and if the total number of indexes is greater than the maximum number of indexes allowed by the system, the block size is re-calculated after each block is adjusted.
The maximum index number is determined according to the size of the current single index and the proportion of the memory to be occupied, the maximum memory total ratio of the maximum index number is generally controlled within 2GB, and if the maximum memory total ratio exceeds the maximum memory total ratio, a secondary index is required to be used, so that the total index number is ensured to be controlled within the maximum index number range allowed by the system, and the stability of the system is ensured.
The bitmap data of the FAT32 file system is read from the snapshot, and the bitmap is calculated according to the number of sectors contained in each block calculated in the previous step, for example: if the number of sectors per cluster of FAT32 is 8, 512/8=64 can be calculated, which means that each block can accommodate 64 clusters, and since the bitmap is represented by bytes, one byte can represent 8 clusters, each block contains a bitmap of 64/8=8 bytes.
Reconstructing a bitmap in units of blocks according to bitmap information of how many bytes each block calculated in the previous step comprises; as shown in fig. 1, the original bitmap is a cluster represented by one bit, N clusters now after reorganization represent a block by using 1 bit, the FAT32 file system original bitmap is repartitioned according to the block, and the bitmap divided by blocks (the bitmap divided by blocks is represented by B2) is repartitioned according to the use condition after the FAT32 file system original bitmap is divided by the block, the marking logic divides the FAT32 file system original bitmap by the number of bytes of each block, then checks whether the FAT32 original bitmap contained in each block has a value other than 0, if the bitmap has a value other than 0, the bitmap representing the block represents the area with a used sector, so the bitmap representing the block also needs to be set to 1 to represent that the block has been used, and the backup of the block is required when backup is performed.
The system performs data backup on each block according to the block bitmap B2 generated in the last step, skips if the bitmap is 0, calculates the original bitmap information B1 of the FAT32 corresponding to the block if the bitmap is 1, acquires the used cluster from the original bitmap B1, reads the data of the used sector cluster according to the used condition in the original bitmap, as shown in fig. 3, only the first cluster in the first block is used, but the first block is marked as used, but only the first cluster in the first block is actually used, so that only the first cluster needs to be read, after the data of one block is read into a cache, hash, compression and encryption operation are performed on the block, the bitmap of the block, the Hash, the initial sector, the compressed size and the actual size are recorded into index records, and the index information of each block and the data of each block needing backup are written into the cache; and writing the mirror image file after the cache is fully written until the backup is completed and writing the index information into the mirror image file.
Example III
The present embodiment provides another method of the FAT32 file system, incremental backups of the FAT32 file system.
The following is the step of backing up the FAT32 file system in increments:
1. the program locates the folder where the mirror image file is located according to the task information or obtains the basic information of the backup task according to the position of the mirror image file, if all the mirror image files of the task are obtained through the task, firstly obtaining the name and GUID information of the task from the task file, then enumerating the storage path of the mirror image file pointed by the task, and screening the mirror image file with the mirror image information the same as the name and GUID in the task by enumerating all the mirror image files. If all the image files of the task of the image are obtained from the image files, the name and GU ID information of the task are needed to be obtained from the image, and then all the image files belonging to the same task with the image files are obtained by enumerating all the image files under the folder where the image files are located.
2. The program stores the information of all the image files associated with the task, and sorts the image files according to the version number of each image file, and the program obtains the information of the last backup from the latest full or incremental backup, wherein the information comprises the volume of the last backup, encryption information, compression level and index information of each volume, if the index information is smaller than 2GB, the information is directly loaded into a memory, and if the index information is larger than 2GB, only the index information of the index is loaded.
3. And (3) the program starts to check whether a backup source exists according to the volume information obtained in the step (2), if not, the backup is stopped, if so, a snapshot is created for the volume needing to be backed up so as to ensure the consistency of data, DBR information of the file system is read from the snapshot, and the total sector number of the file system is obtained from the DBR information.
4. Reconstructing a new bitmap of the volume according to the information of the block size in the backup image, judging each bit in the reconstructed bitmap information, if the bit is not 0, reading data according to the real bitmap information B1, carrying out Hash check on the read data, carrying out a Hash algorithm on the read data block to obtain a Hash value, comparing the Hash value with the Hash value of the data of the previous backup, and if the Hash value does not change, indicating that the data of the data block does not change, wherein only the position information of the index of the real data is needed to be recorded in the new index information of the data. If the Hash value is changed compared with the Hash of the original block of data, the data is changed, the data is required to be stored in an image file, the current information of the block of data is required to be recorded in new index information, the index information is written into the image file to be stored until the last data block of the whole volume is backed up, as shown in fig. 2, the first block is consistent in two times of backup, only the position of the original index is required to be recorded, and the third block is required to be recorded because the current data is changed, so that the Hash is also changed, and the changed data block and the new index information are required to be recorded.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: the foregoing description is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art, although the present invention has been described in detail with reference to the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A method for quickly backing up FAT32 file system, characterized by: the method comprises the following steps:
step S1, creating a snapshot for a backup object through a volume filtering driving system;
s2, reading DBR of the FAT32 file system from the snapshot, and acquiring the total sector number of the FAT32 file system through the DBR of the FAT32 file system;
step S3, calculating according to the total sector number of the FAT32 file system and the block size of the system to obtain the total index number;
s4, judging the total number of indexes and the maximum index number allowed by the system; if the total index number is larger than the maximum index number allowed by the system, the size of each block is adjusted and then recalculated; if not, continuing;
step S5, reading bitmap data of the FAT32 file system from the snapshot, and calculating the bitmap according to the number of sectors which can be accommodated by the block according to the number of sectors which are contained in each block calculated in the previous step;
s6, reconstructing a bitmap B2 divided by blocks according to bitmap information included in each block calculated in the step S5, and re-marking the bitmap B2 divided by blocks according to the use condition of the FAT32 file system after the division by blocks to confirm the blocks needing backup;
step S7, carrying out data backup on each block according to the bitmap B2 marked in the step S6 and divided by the block; skipping if the bitmap B2 divided by blocks is 0; if the bitmap B2 divided by the blocks is 1, the original bitmap information B1 of the FAT32 corresponding to the block is calculated, the used clusters are obtained from the original bitmap B1, and the used clusters are read according to the used condition of the blocks in the original bitmap B1; writing the index information of each recorded block and the data of each block to be backed up into a cache; and writing the mirror image file after the cache is fully written until the backup is completed and writing the index information into the mirror image file.
2. A method for quickly backing up a FAT32 file system according to claim 1, wherein: total number of indexes = total size of partition/block size of system.
3. A method for quickly backing up a FAT32 file system according to claim 1, wherein: in step S4, the maximum index number is determined according to the size of the current single index and the proportion of the memory to be occupied, so as to ensure that the total number of indexes is within the allowed maximum index number range, thereby ensuring the stability of the system.
4. A method for quickly backing up a FAT32 file system according to claim 1, wherein: in step S6, the labeling specifically includes:
dividing the original bitmap B1 of the FAT32 file system by the byte number of each block, checking whether B1 in the original bitmap of the FAT32 contained in each block has a value other than 0, if B1 in the original bitmap has a value other than 0, indicating that the area indicated by B1 in the original bitmap has a used sector, setting B1 in the original bitmap indicating the block to 1, indicating that the block has been used, and backing up the block when backing up.
5. A method for quickly backing up a FAT32 file system according to claim 1, wherein: in step S7, after the data of the block is read to the buffer, hash, compress, and encrypt operations are performed on the block.
6. A method for quickly backing up a FAT32 file system according to claim 1, wherein: the index information includes a bitmap of the block, hash, a start sector, a compressed size, and an actual size.
CN202311419481.5A 2023-10-30 2023-10-30 Method for quickly backing up FAT32 file system Pending CN117555727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311419481.5A CN117555727A (en) 2023-10-30 2023-10-30 Method for quickly backing up FAT32 file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311419481.5A CN117555727A (en) 2023-10-30 2023-10-30 Method for quickly backing up FAT32 file system

Publications (1)

Publication Number Publication Date
CN117555727A true CN117555727A (en) 2024-02-13

Family

ID=89817641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311419481.5A Pending CN117555727A (en) 2023-10-30 2023-10-30 Method for quickly backing up FAT32 file system

Country Status (1)

Country Link
CN (1) CN117555727A (en)

Similar Documents

Publication Publication Date Title
US9904601B2 (en) Synchronization of storage using comparisons of fingerprints of blocks
US7421551B2 (en) Fast verification of computer backup data
US8150851B2 (en) Data processing apparatus and method of processing data
US8832045B2 (en) Data compression and storage techniques
US7860843B2 (en) Data compression and storage techniques
US7197665B2 (en) Physical incremental backup using snapshots
US6208999B1 (en) Recoverable computer file system with a signature area containing file integrity information located in the storage blocks
US7831789B1 (en) Method and system for fast incremental backup using comparison of descriptors
AU700681B2 (en) A method of operating a computer system
US8572331B2 (en) Method for reliably updating a data group in a read-before-write data replication environment using a comparison file
US20070112895A1 (en) Block-based incremental backup
US8818950B2 (en) Method and apparatus for localized protected imaging of a file system
US7681001B2 (en) Storage system
US6636941B1 (en) Enhanced stable disk storage
US20080177961A1 (en) Partial Backup and Restore with Backup Versioning
KR20070003579A (en) File system storing transaction recordes in flash-like media
CA2825885C (en) Storage system and information processing method
US7689877B2 (en) Method and system using checksums to repair data
CN112612576B (en) Virtual machine backup method and device, electronic equipment and storage medium
CN112380071B (en) Method for quickly backing up NTFS file system
CN103838645A (en) Remote difference synthesis backup method based on Hash
CN111143116A (en) Method and device for processing bad blocks of disk
US20120131063A1 (en) Method for reliable and efficient filesystem metadata conversion
EP1470484B1 (en) Method and system for providing direct access recovery using seekable tape device
CN112463434B (en) Data reconstruction method, device and equipment based on erasure codes and storage medium

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