CN109828866A - A kind of XFS file fragmentation restoration methods and device - Google Patents
A kind of XFS file fragmentation restoration methods and device Download PDFInfo
- Publication number
- CN109828866A CN109828866A CN201910076494.4A CN201910076494A CN109828866A CN 109828866 A CN109828866 A CN 109828866A CN 201910076494 A CN201910076494 A CN 201910076494A CN 109828866 A CN109828866 A CN 109828866A
- Authority
- CN
- China
- Prior art keywords
- file
- fragment
- file fragmentation
- data block
- xfs
- 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
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of XFS file fragmentation restoration methods and device.This method comprises: step 1, using the catalog manager of XFS file system obtaining the document directory structure of disk;Step 2 determines file fragmentation and fragment type in each disk partition according to the information entropy for each data block extracted in each disk partition, and the fragment type includes text fragment and images fragment;Step 3, the initial logical address that the file fragmentation is obtained in file linked list;Step 4 carries out splicing recovery to XFS file fragmentation according to the initial logical address of the file fragmentation, fragment type and the document directory structure.The device includes: that catalogue obtains module, fragment extraction module, address lookup module and splicing recovery module.The present invention quickly determines file fragmentation and its initial logical address by the catalog manager and space manager for utilizing XFS file system, to carry out splicing recovery to each file fragmentation.
Description
Technical field
The present invention relates to technical field of data storage more particularly to a kind of XFS file fragmentation restoration methods and devices.
Background technique
XFS be directed to earliest IRIX operating system exploitation, be a high performance log type file system, can power-off with
And guarantee the consistency of file system data in the case where operating system collapse.It is one 64 file system, later into
Row increase income and be transplanted in (SuSE) Linux OS, at present CentOS 7 using XFS+LVM as default file system,
XFS is preferable for the readwrite performance of big file, great retractility.File fragmentation is because file is by distributed and saved to entire disk
Different places, rather than be serially stored in and formed in the continuous cluster of disk.With the continuous development of data recovery technique,
It is improved day by day based on data in magnetic disk logical layer recovery technology, but huge chosen in logical layer recovery technology there are one at present
War, that is, when deleting file there are when the state of multistage fragment, data recombination recovery will become very difficult.
Patent application 201610625795.4 discloses a kind of recombination restoration methods based on XFS file system data, should
Application carries out lookup data by positioning the file linked list that XFS is generated in storing data file, mainly comprises the steps that
(1) it loads and parses disk sector information;(2) matching files list structure;(3) resolution file link structure;(4) reading pair
Answer block address data;(5) new file is recombinated, the fragment weight that XFS file system is realized in (2)-(5) traversal hard disk sector is finally repeated
Group.But this application needs to match whether each piece meet multiple file linked list structures one by one when searching data, processes
Journey is complex;When hard disc data capacity is larger, then efficiency is lower when restoring file fragmentation for this application.
Summary of the invention
It is existing in the prior art above-mentioned since, the present invention provides a kind of XFS document method and system to solve the problems, such as, lead to
It crosses and quickly determines file fragmentation using the catalog manager and space manager of XFS file system and each file fragmentation is spelled
Connect recovery.
The present invention provides a kind of XFS file fragmentation restoration methods, this method comprises:
Step 1 obtains the document directory structure of disk using the catalog manager of XFS file system;
Step 2 determines each disk partition according to the information entropy for each data block extracted in each disk partition
Interior file fragmentation and fragment type, the fragment type include text fragment and images fragment;
Step 3, the initial logical address that the file fragmentation is obtained in file linked list;
Step 4, according to the initial logical address of the file fragmentation, fragment type and the document directory structure to XFS
File fragmentation carries out splicing recovery.
Further, the step 2 specifically:
Step 2.1, the information entropy H (n) that data block n is calculated according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
If step 2.2, information entropy H (n) are greater than the entropy threshold value of setting, determine data block n for file fragmentation;
Step 2.3, according to the entropy section of the text fragment of setting and the entropy section of images fragment, determine the file
The fragment type of fragment.
Further, the step 4 specifically:
Step 4.1 traverses document directory structure according to the fragment type, determines target mesh corresponding with file fragmentation
Record;
Step 4.2, determined using space manager according to the target directory XFS file each data block size sum number
According to block sequence;
Step 4.3, according to the initial logical address of file fragmentation, the size of each data block and data block order to XFS text
Part fragment carries out splicing recovery.
On the other hand, the present invention provides a kind of XFS file fragmentation recovery device, which includes:
Catalogue obtains module, obtains the document directory structure of disk using the catalog manager of XFS file system;
Fragment extraction module determines each magnetic according to the information entropy for each data block extracted in each disk partition
File fragmentation and fragment type in disk subregion, the fragment type include text fragment and images fragment;
Address lookup module obtains the initial logical address of the file fragmentation in file linked list;
Splice recovery module, according to the initial logical address of the file fragmentation, fragment type and the file directory knot
Structure carries out splicing recovery to XFS file fragmentation.
Further, the fragment extraction module specifically includes:
Entropy computational submodule calculates the information entropy H (n) of data block n according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
Comparative sub-module determines data block n for file fragmentation if information entropy H (n) is greater than the entropy threshold value of setting;
Fragment type decision sub-module, according to the entropy section in the entropy section of the text fragment of setting and images fragment,
Determine the fragment type of the file fragmentation.
Further, the splicing recovery module specifically includes:
Directory traversal submodule traverses document directory structure according to the fragment type and determines mesh corresponding with file fragmentation
Heading record;
Sorting sub-module determines the size of each data block of XFS file using space manager according to the target directory
And data block order;
Restore submodule, according to the initial logical address of file fragmentation, the size of each data block and data block order to XFS
File fragmentation carries out splicing recovery.
Beneficial effects of the present invention:
A kind of XFS file fragmentation restoration methods provided by the invention and device, by utilizing freed data blocks and occupied
Comentropy value difference between data block (i.e. file fragmentation) is different, extracts the file fragmentation of each disk partition;Then further
Using the different characteristic of the information entropy of files in different types, the fragment type of file fragmentation is distinguished, in this way, traversing
When document directory structure, traversal range can be reduced according to fragment type, is improved efficiency;Followed by space manager according to inquiry
To target directory determine that the data block of data block size of XFS file puts in order;It finally combines and is obtained in file linked list
Initial logical address splicing recovery is carried out to XFS file.Data handling procedure of the invention is simple, can fast implement all texts
The data of part fragment are restored.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of XFS file fragmentation restoration methods provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of XFS file fragmentation recovery device provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of fragment extraction module provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of splicing recovery module provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention
Figure, technical solution in the embodiment of the present invention are explicitly described, it is clear that described embodiment is a part of the invention
Embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making wound
Every other embodiment obtained under the premise of the property made labour, shall fall within the protection scope of the present invention.
Fig. 1 is a kind of flow diagram of XFS file fragmentation restoration methods provided in an embodiment of the present invention.As shown in Figure 1,
Method includes the following steps:
S101, the document directory structure of disk is obtained using the catalog manager of XFS file system;
Specifically, XFS file system can be regarded as by following module composition: hard disk driver, delays volume manager
It deposits, task manager, space manager, I/O manager, catalog manager and system are called and VNODE interface.Wherein catalogue
Manager is responsible for managing the name space of XFS file system.Therefore, it can use and stored on the catalog manager acquisition disk
Document directory structure.
S102, it is determined in each disk partition according to the information entropy for each data block extracted in each disk partition
File fragmentation and fragment type, the fragment type includes text fragment and images fragment;
Specifically, according to information entropy principle: when the order state of system is consistent, data are more concentrated, and entropy is smaller,
Data are more dispersed, and entropy is bigger.When data volume is consistent, system is more orderly, and entropy is lower;System is more chaotic or disperses, entropy
It is worth higher.Therefore, the entropy of freed data blocks is maximum, and the entropy of text fragment is smaller, and the entropy of images fragment is then minimum.
As an embodiment, the step S102 specifically:
S1021, the information entropy H (n) that data block n is calculated according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
If S1022, information entropy H (n) are greater than the entropy threshold value of setting, determine data block n for file fragmentation;
S1023, according to the entropy section of the text fragment of setting and the entropy section of images fragment, determine that the file is broken
The fragment type of piece.
S103, the initial logical address that the file fragmentation is obtained in file linked list;
S104, according to the initial logical address of the file fragmentation and the document directory structure to XFS file fragmentation into
Row splicing restores.
Specifically, as an embodiment, the step S104 specifically:
S1041, document directory structure is traversed according to the fragment type, determines target directory corresponding with file fragmentation;
S1042, determined using space manager according to the target directory XFS file each data block size and data
Block sequence;
Specifically, space manager is responsible for the distribution and release of the free space of XFS file system, and passes through traversal target
Catalogue can take out a sequential entry information about data block.It therefore can general space manager and target mesh
Record determines the storage state of file for needing to restore, for example, each data block about file to be restored data block size and
Front and back logical connection sequence between each data block.
S1043, according to the initial logical address of file fragmentation, the size of each data block and data block order to XFS file
Fragment carries out splicing recovery.
A kind of XFS file fragmentation restoration methods provided by the invention, by utilizing freed data blocks and occupied data block
Comentropy value difference between (i.e. file fragmentation) is different, extracts the file fragmentation of each disk partition;Then further using not
The different characteristic of the information entropy of same type file, distinguishes the fragment type of file fragmentation, in this way, in traversal file mesh
When directory structures, traversal range can be reduced according to fragment type, is improved efficiency;Followed by space manager according to the mesh inquired
Heading, which is recorded, determines that the data block of the data block size of XFS file puts in order;Finally combine the starting obtained in file linked list
Logical address carries out splicing recovery to XFS file.Data handling procedure of the invention is simple, can fast implement All Files fragment
Data restore.
Fig. 2 is a kind of structural schematic diagram of XFS file fragmentation recovery device provided in an embodiment of the present invention.As shown in Fig. 2,
The device includes: that catalogue obtains module 201, fragment extraction module 202, address lookup module 203 and splicing recovery module 204.
Wherein:
Catalogue obtains module 201 and obtains the document directory structure of disk using the catalog manager of XFS file system;Fragment
Extraction module 202 determines in each disk partition according to the information entropy for each data block extracted in each disk partition
File fragmentation and fragment type, the fragment type include text fragment and images fragment;Address lookup module 203 is used in text
The initial logical address of the file fragmentation is obtained in part chained list;Splice recovery module 204 according to the starting of the file fragmentation
Logical address and the document directory structure carry out splicing recovery to XFS file fragmentation.
Specifically, as shown in figure 3, as an embodiment, the fragment extraction module 202 specifically includes: entropy
Computational submodule 2021, Comparative sub-module 2022 and fragment type decision sub-module 2023.Wherein:
Entropy computational submodule 2021 calculates the information entropy H (n) of data block n according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
If 2022 information entropy H (n) of Comparative sub-module is greater than the entropy threshold value of setting, determine data block n for file fragmentation;Fragment class
Type decision sub-module 2023 determines the file according to the entropy section of the text fragment of setting and the entropy section of images fragment
The fragment type of fragment.
As shown in figure 4, as an embodiment, the splicing recovery module 204 specifically includes: directory traversal submodule
Block 2041, sorting sub-module 2042 and recovery submodule 2043.Wherein:
Directory traversal submodule 2041 is corresponding with file fragmentation according to fragment type traversal document directory structure determination
Target directory;Sorting sub-module 2042 determines each data block of XFS file using space manager according to the target directory
Size and data block order;Restore submodule 2043 according to the initial logical address of file fragmentation, the size of each data block and
Data block order carries out splicing recovery to XFS file fragmentation.
It should be noted that a kind of XFS file fragmentation recovery device provided in an embodiment of the present invention is above-mentioned in order to realize
Method, function specifically refers to above method embodiment, and details are not described herein again.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (6)
1. a kind of XFS file fragmentation restoration methods characterized by comprising
Step 1 obtains the document directory structure of disk using the catalog manager of XFS file system;
Step 2 determines in each disk partition according to the information entropy for each data block extracted in each disk partition
File fragmentation and fragment type, the fragment type include text fragment and images fragment;
Step 3, the initial logical address that the file fragmentation is obtained in file linked list;
Step 4, according to the initial logical address of the file fragmentation, fragment type and the document directory structure to XFS file
Fragment carries out splicing recovery.
2. the method according to claim 1, wherein the step 2 specifically:
Step 2.1, the information entropy H (n) that data block n is calculated according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
If step 2.2, information entropy H (n) are greater than the entropy threshold value of setting, determine data block n for file fragmentation;
Step 2.3, according to the entropy section of the text fragment of setting and the entropy section of images fragment, determine the file fragmentation
Fragment type.
3. the method according to claim 1, wherein the step 4 specifically:
Step 4.1 traverses document directory structure according to the fragment type, determines target directory corresponding with file fragmentation;
Step 4.2, determined using space manager according to the target directory XFS file each data block size and data block
Sequentially;
It is step 4.3, broken to XFS file according to the initial logical address of file fragmentation, the size of each data block and data block order
Piece carries out splicing recovery.
4. a kind of XFS file fragmentation recovery device characterized by comprising
Catalogue obtains module, obtains the document directory structure of disk using the catalog manager of XFS file system;
Fragment extraction module determines each disk point according to the information entropy for each data block extracted in each disk partition
File fragmentation and fragment type in area, the fragment type include text fragment and images fragment;
Address lookup module, for obtaining the initial logical address of the file fragmentation in file linked list;
Splice recovery module, according to the initial logical address of the file fragmentation, fragment type and the document directory structure pair
XFS file fragmentation carries out splicing recovery.
5. device according to claim 4, which is characterized in that the fragment extraction module specifically includes:
Entropy computational submodule calculates the information entropy H (n) of data block n according to formula (1):
Wherein, L indicates that the byte number that data block n includes, p (i) indicate the probability in file fragmentation when byte l value i.
Comparative sub-module determines data block n for file fragmentation if information entropy H (n) is greater than the entropy threshold value of setting;
Fragment type decision sub-module is determined according to the entropy section in the entropy section of the text fragment of setting and images fragment
The fragment type of the file fragmentation.
6. device according to claim 4, which is characterized in that the splicing recovery module specifically includes:
Directory traversal submodule traverses document directory structure according to the fragment type and determines target mesh corresponding with file fragmentation
Record;
Sorting sub-module determines the size sum number of each data block of XFS file using space manager according to the target directory
According to block sequence;
Restore submodule, according to the initial logical address of file fragmentation, the size of each data block and data block order to XFS file
Fragment carries out splicing recovery.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910076494.4A CN109828866B (en) | 2019-01-26 | 2019-01-26 | XFS file fragment recovery method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910076494.4A CN109828866B (en) | 2019-01-26 | 2019-01-26 | XFS file fragment recovery method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109828866A true CN109828866A (en) | 2019-05-31 |
CN109828866B CN109828866B (en) | 2023-04-14 |
Family
ID=66862436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910076494.4A Active CN109828866B (en) | 2019-01-26 | 2019-01-26 | XFS file fragment recovery method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109828866B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6173291B1 (en) * | 1997-09-26 | 2001-01-09 | Powerquest Corporation | Method and apparatus for recovering data from damaged or corrupted file storage media |
EP1103894A2 (en) * | 1999-11-17 | 2001-05-30 | Finaldata Inc. | Fragmented data recovery method |
CN102622302A (en) * | 2011-01-26 | 2012-08-01 | 中国科学院高能物理研究所 | Recognition method for fragment data type |
CN106155845A (en) * | 2016-08-02 | 2016-11-23 | 四川效率源信息安全技术股份有限公司 | A kind of restructuring restoration methods based on XFS file system data |
-
2019
- 2019-01-26 CN CN201910076494.4A patent/CN109828866B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6173291B1 (en) * | 1997-09-26 | 2001-01-09 | Powerquest Corporation | Method and apparatus for recovering data from damaged or corrupted file storage media |
EP1103894A2 (en) * | 1999-11-17 | 2001-05-30 | Finaldata Inc. | Fragmented data recovery method |
CN102622302A (en) * | 2011-01-26 | 2012-08-01 | 中国科学院高能物理研究所 | Recognition method for fragment data type |
CN106155845A (en) * | 2016-08-02 | 2016-11-23 | 四川效率源信息安全技术股份有限公司 | A kind of restructuring restoration methods based on XFS file system data |
Non-Patent Citations (2)
Title |
---|
朱润: "多媒体文件数据雕刻关键技术研究", 《中国优秀博硕士(硕士)学位论文全文数据库信息科技辑》 * |
魏薇等: "XFS日志文件系统的关键技术研究", 《XFS日志文件系统的关键技术研究》 * |
Also Published As
Publication number | Publication date |
---|---|
CN109828866B (en) | 2023-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9575983B2 (en) | Calculating deduplication digests for a synthetic backup by a deduplication storage system | |
EP4270209A2 (en) | Deduplicated merged indexed object storage file system | |
US9141633B1 (en) | Special markers to optimize access control list (ACL) data for deduplication | |
US7567188B1 (en) | Policy based tiered data deduplication strategy | |
US8200633B2 (en) | Database backup and restore with integrated index reorganization | |
US9778996B1 (en) | File system version set infrastructure | |
EP2363815B1 (en) | System for permanent file deletion | |
US20190361850A1 (en) | Information processing system and information processing apparatus | |
CN110221782A (en) | Video file processing method and processing device | |
US10628298B1 (en) | Resumable garbage collection | |
CN102508913A (en) | Cloud computing system with data cube storage index structure | |
CN110399096B (en) | Method, device and equipment for deleting metadata cache of distributed file system again | |
US11093453B1 (en) | System and method for asynchronous cleaning of data objects on cloud partition in a file system with deduplication | |
US9021230B2 (en) | Storage device | |
US11074222B2 (en) | Lockless management of deduplicated data using reference tags | |
CN112749144B (en) | System and method for storing persistent file based on blockchain | |
CN106980618A (en) | File memory method and system based on MongoDB distributed type assemblies frameworks | |
US10169357B2 (en) | Methods and systems for data cleanup using physical image of files on storage devices | |
US11263091B2 (en) | Using inode entries to mirror data operations across data storage sites | |
CN109388335A (en) | A kind of date storage method and system | |
CN109828866A (en) | A kind of XFS file fragmentation restoration methods and device | |
CN110896408B (en) | Data processing method and server cluster | |
US9575679B2 (en) | Storage system in which connected data is divided | |
US20230229628A1 (en) | Content-addressed storage using content-defined trees | |
CN109521957A (en) | A kind of data processing method and device |
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 |