CN102646079A - Disk data protection method oriented to Linux operating system - Google Patents
Disk data protection method oriented to Linux operating system Download PDFInfo
- Publication number
- CN102646079A CN102646079A CN2012101212272A CN201210121227A CN102646079A CN 102646079 A CN102646079 A CN 102646079A CN 2012101212272 A CN2012101212272 A CN 2012101212272A CN 201210121227 A CN201210121227 A CN 201210121227A CN 102646079 A CN102646079 A CN 102646079A
- Authority
- CN
- China
- Prior art keywords
- block
- num
- bitmap
- data
- piece
- 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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a disk data protection method oriented to a Linux operating system. The technical scheme comprises modifying four functions of a loop device including adding DSP_init () at the beginning of loop_init, adding DSP_receive () at the beginning of lo_receive, adding DSP_send () at the beginning of lo_send, and adding DSP_exit () at the beginning of loop_exit; generating loop. ko; loading loop. ko, and initializing DSP_init (); if the user requests for reading disk data, modifying pos by the DSP_receive (); if the user requests for writing disk data, modifying pos by the DSP_send (); and if the user requests for exiting, unloading by the DSP_exit (). The invention can realize transparent protection on disk data.
Description
Technical field
The present invention relates to computer file system and field of storage, refer in particular to a kind of hard disk data protection method towards the class (SuSE) Linux OS.
Background technology
In the operating system of main flow a few days ago, Windows operating system has occupied most of market.But close source property, the security of Windows system also bring serious day by day problem.The class (SuSE) Linux OS, because its high-performance, the characteristics of high security and open source obtain use more and more widely in the world.Especially in key areas relevant with national security such as government, military projects, various countries will adopt autonomous controlled operating system as national important strategic planned project, and the user of domestic employing class linux system is also more and more.China has also developed autonomous controlled homemade operating system based on the class (SuSE) Linux OS, like kylin, and red flag, acceptance of the bid etc.
The data in magnetic disk defencive function is the important component part that improves operating system security.Based on Windows operating system, the product that carries out data security protecting is mainly PowerShadow, and this system can realize the safeguard protection to data in the hard disk, but it is a commercial product, and core technology is covert.And, because the fundamental difference of operating system framework and realization, based on the data security protection method of Windows operating system can't type of being applied to (SuSE) Linux OS on.Towards the class linux system, also not seeing at present has disclosed data security protection method.Therefore, along with the extensive utilization of class linux system, research has important significance for theories and practical value based on the data security protection method of class linux system.
Class (SuSE) Linux OS structure is as shown in Figure 1.With the relevant part of data in magnetic disk protection is file system interface, file system module, block device driver module.User's data in magnetic disk operation gets into operating system nucleus through calling file system interface, is intercepted and captured by the correspondent file system module, and file system module calls corresponding block device driver module again and carries out the data in magnetic disk operation, and the result is returned to the user.
The main flow file system that the class (SuSE) Linux OS uses at present is Ext2, Ext3, and Ext4, these three kinds of file system have kept favorable compatibility, and method of the present invention is directly applied for this three kinds of file system with can not adding modification.These file system abbreviate the Extx file system as.
Fig. 2 top is divided into the magnetic disk structural drawing of Extx file system.The Extx file system is basic read-write and allocation unit with piece, and first in the disk partition does not receive the Extx file system management as the bootstrap block reservation, and the remainder in the disk partition is divided into N equal-sized group by the Extx file system management.
Each piece group comprises superblock, group descriptor table, bitmap block, i node bitmap, i node table, six parts in data field shown in Fig. 2 lower part:
Superblock takies the space of a piece, describes the information of whole file system, and the superblock content in the 1-N piece group is identical; The number that comprises i node in the file system, the size of each i node structure, file system total block data; The free block number; Block size, contained number of each piece group, the contained i node of each piece group number etc.Wherein, the i node is called inode in english literature, is used to describe the metadata information of a file.
The group descriptor table is made up of the piece group descriptor, and the content of the group descriptor table in the 1-N piece group is identical.Each piece group descriptor is described the information of a piece group, takies 32 bytes.The piece group descriptor quantity that comprises in the group descriptor table is counted N with the piece group in this disk system and is equated.The information that each piece group descriptor is described comprises the start address of bitmap block in this piece group, the start address of i node bitmap and i node table start address, and unit is piece number; In addition; Also comprise piece number idle in this piece group, the idle i node number in this piece group, catalogue number in this piece group.
Bitmap block is described the operating position of piece in this piece group, and each bit (bit) is represented a piece in this piece group, and the value of bit is that the corresponding piece of 1 expression uses, is that 0 this piece free time of expression is available.
I node bitmap accounts for a piece, and wherein each bit representes whether an i node is idle available.The value of bit is that the corresponding i node of 1 expression uses, is that the corresponding i node free time of 0 expression is available.
The i node table comprises all i nodes in the piece group of place.Because file be except data need be stored, some descriptors also need storage, file type (routine, catalogue, Symbolic Links etc.) for example, and authority, file size, establishment/modification/access times etc., these information exist in the i node.Each i node takies 128 bytes.All i nodes in all corresponding i node of each file, piece group are formed i node tables.Data in the i node table are also referred to as the metadata of file.
The data field is used for the store files data.
In the class (SuSE) Linux OS; The flow process of disk read-write is as shown in Figure 3; The user's data access request gets into operating system nucleus through calling file system interface; Intercepted and captured by the Extx file system module, the Extx file system module calls corresponding block device driver module again and carries out the data in magnetic disk operation, and the result is returned to the user.This method is because the data of user on can the direct control disk, and safety that can't protected data possibly cause loss of data, system failure, the generation of situation such as information leakage under malicious attack.
Loop equipment, full name are Loopback equipment, dummy block will equipment in type of the being linux system kernel.It can set up related with a concrete physical disk block device.Set up after the association, Loop equipment it seems to file system, is exactly the disk block equipment of a standard, can format, traditional disk read-write etc.The user can at first be intercepted and captured by the driver of Loop equipment the data access request of Loop equipment, and the driver of its related concrete physical disk of this routine call removes to carry out actual read-write operation then.Thereby to the Loop operation of equipment, actual is operation to its related physical disk block device.Like this, Loop equipment can be intercepted and captured all physical disk operation of equipment related with it, upper layer application is shielded the details of concrete physical disk drives.
In the driver code of Loop equipment; To call the loop_init function during device loads; By loop_init function initialization apparatus, will call loop_exit function, free system resources during the equipment unloading; Read operation function to the bottom physical disk of association is lo_receive, is lo_send to the write operation function of bottom physical disk.
It is loop device descriptors that the lo_recive function comprises three parameter: lo, describes the loop device-dependent message; Bio describes the buffer location of store data in the internal memory; Pos describes the position of data in disk that will read.The lo_recive function will read pos indication position from disk data be filled into the core buffer that bio describes.
The lo_send function carries out disk write operation, and comprising three parameter: lo equally is the loop device descriptor; Bio describes the buffer location of store data in the internal memory; Pos representes the disk position that data will write.The lo_send function writes the data in the core buffer of bio description the position of pos indication in the disk.
Therefore; If utilize Loop equipment; Loop equipment and the physical disk that will protect are set up related, modification Loop device driver is before the read-write operation of Loop equipment to the bottom physical disk; Retouching operation to the disk legacy data carries out transparent redirection as required, then can realize the safeguard protection to data in magnetic disk.At present also do not have open source literature to relate to and utilize Loop equipment to carry out the method for data in magnetic disk protection.
Summary of the invention
The technical matters that the present invention will solve is the protection that in the class linux system, realizes the disk legacy data.
Technical scheme of the present invention is:
The first step, the loop_init of modification Loop equipment, lo_receive, lo_send and loop_exit function, the Loop device driver that will pass through modification is referred to as the data security protecting module, abbreviates DSP (Data Security Protection) module as.Amending method is:
Begin the place at the loop_init function and add function DSP_init (), by the primary data of DSP_init () initialization DSP module.
Begin the place at the lo_receive function and add function DSP_receive (), the parameter p os by DSP_receive () revises lo_receive as required makes pos point to the data position after being redirected.
Begin the place at the lo_send function and add function DSP_send (), the parameter p os by DSP_send () revises lo_send as required makes pos point to untapped disk space, to avoid destroying data with existing.
Begin the place at the loop_exit function and add function DSP_exit (), discharge the memory source that produces in DSP module initialization and the program run by DSP_exit ().
Second step, with amended loop_init, lo_receive, lo_send and loop_exit function compiling link generate new loop device driver module loop.ko.
The 3rd step loaded loop device driver module loop.ko, called initialization function loop_init, and this function call DSP_init () carries out following initialization:
3.1 make up a linear linked list blocklist; Doublet (old_block_num of each element storage among the blocklist; New_block_num), old_block_num is used to write down the piece number of initial disk requests, and new_block_num is used to write down the new piece number after being redirected.DSP_init () is initialized as empty table with blocklist;
3.2 superblock, the group descriptor table of reading disk subregion file system are buffered in them in the internal memory.Superblock and group descriptor table information according to buffer memory obtain following data:
3.2.1 obtain the number of free block the 1-N piece group from the group descriptor table, the number of free block in the 1-N piece group be stored among the array free_block_count [] number of free block in m piece group of free_block_count [m] storage, 1≤m≤N.
Count block_count 3.2.2 obtain the piece of each piece group from superblock, the piece number of each piece group equates;
3.2.3 obtain the starting block block_bitmap_start [] of the bitmap block of 1-N piece group from the group descriptor table, the starting block of bitmap block number in m piece group of block_bitmap_start [m] storage, 1≤m≤N;
3.2.4 obtain the starting block inode_table_start [] of the i node table of 1-N piece group from the group descriptor table, the starting block of i node table number in m piece group of inode_table_start [m] storage, 1≤m≤N;
3.2.5 from the block size block_size of superblock acquisition 1-N piece group, unit is a byte, the block size of each piece group equates;
Count inode_count 3.2.6 obtain the contained i node of each piece group from superblock, the contained i node of each piece group number equates;
3.2.7 obtain the starting block inode_bitmap_start [] of the i node bitmap of 1-N piece group from the group descriptor table, the starting block of i node bitmap number in m piece group of inode_bitmap_start [m] storage, 1≤m≤N;
3.2.8 obtain file system total block data total_block_count from superblock;
3.3 calculate the size of the bitmap block of 1-N piece group, the size of i node table, the number of piece group:
3.3.1 the size of the bitmap block of m piece group:
Block_bitmap_size [m]=(inode_bitmap_start [m]-block_bitmap_start [m]) * block_size; Inode_bitmap_start [m] is the starting block number of the i node bitmap of piece group m; Block_bitmap_start [m] is the starting block number of the bitmap block of m piece group; Block_size is a block size, and unit is a byte;
3.3.2 the big or small inode_table_size of the i node table of piece group:
Inode_table_size=inode_count * 128/block_size, symbol "/" expression division, 128 is each i node size, unit is a byte, the equal and opposite in direction of the i node table of each piece group;
3.3.3 the number of piece group: group_count=total_block_count/block_count;
3.4 according to the bitmap block starting block block_bitmap_start [] of 1-N piece group, and the big or small block_bitmap_size [] of bitmap block reads the bitmap block block_bitmap [] of 1-N piece group from disk;
[3.5loop_init] function initialization apparatus, this step is the same with the loop_init function initialization apparatus process of the said existing Loop equipment of background technology.The 4th step, wait for the user's data access request, if data access request is the reading disk data, carried out for the 5th step; If user's request carried out for the 6th step for writing data in magnetic disk.If user's request carried out for the 7th step for withdrawing from the disk protect module.
In the 5th step, lo_receive starts, and calling DSP_receive () is to make amendment in the disk position of this data access request to the parameter p os of lo_receive, and method is:
5.1 calculate the disk block that will read number: request_block_num=
expression rounds under the x.
5.2 with request_block_num inquiry linked list blocklist, if the old_block_num in all doublet of blocklist all do not equate with request_block_num, show that then this piece is not redirected, need not revise pos, carry out 5.3.If there is (old_block_num; New_block_num); Make old_block_num equal request_block_num, then the current disk position pos that will read is revised as new_block_num * block_size+pos%block_size, wherein % is complementation.
5.3lo_recive the data that function will read pos indication position from disk are filled in this data access request that bio describes the buffer zone of store data in the internal memory; Said bio is a parameter of lo_recive function; Give the bio assignment when class linux system kernel starts the lo_recive function, changeed for the 4th step.
In the 6th step, lo_send starts, and calls the parameter p os of DSP_send () to lo_send, and promptly make amendment in the disk position of this data access request, and method is:
6.2 with request block num inquiry linked list blocklist; If have doublet (old_block_num in the blocklist table; New_block_num); Make old_block_num equal request_block_num, then the current disk position pos that will write is revised as new_block_num * block_size+pos%block_size, change 6.7; If the old_block_num in the blocklist table in all doublet does not all equate with request_block_num, then carry out 6.3.
Whether be positioned at the data field 6.3 judge the corresponding data block of request_block_num, method is:
6.3.1 calculate the piece group number at the corresponding data block place of request_block_num:
6.3.2 the computing block group number is the data field starting block number of the piece group of group_num:
data_start=inode_table_start[group_num]+inode_table_size;
If 6.3.3 request_block_num<data_start; Show that the corresponding data block of request_block_num is positioned at file system metadata district before, data field; Be that the corresponding data block of request_block_num is not positioned at the data field, otherwise show that the corresponding data block of request_block_num is positioned at the data field;
6.4 if the corresponding data block of request_block_num is positioned at the data field, change 6.6; If the data block that request_block_num is corresponding is not positioned at the data field, change 6.5;
6.5request_block_num corresponding data block is positioned at meta-data region, these regional information are must be protected, and the write operation transparent redirection to of the data block that request_block_num is corresponding is the data block of usefulness not; Concrete grammar is: call function findfree (); Seek a future use block new_block_num, if findfree () returns mistake, showing has not currently had free block and can use; Making the lo_send function make mistakes withdraws from; No longer carry out follow-up write operation, changeed for the 4th step, otherwise change 6.7.Findfree () functional procedure is following:
6.5.1 make k=-1;
6.5.2 make k=m+1; If k >=group_count, group_count are piece group number, then function reports an error and withdraws from; Otherwise whether the value of inspection free_block_count [m] is judged k piece group and is also had free block to use; If free_block_count [k]==0 then changes 6.5.2, otherwise change 6.5.3;
6.5.3 loop variable i=0 is set;
6.5.4 make the data of i bit of the bitmap block of k piece group of block_bitmap [k] [i] expression,, represent that the piece of correspondence is vacant if block_bitmap [k] [i] is 0; Judge again whether the corresponding piece of block_bitmap [k] [i] is positioned at the data field; If this piece is positioned at the data field, the value of then revising block_bitmap [k] [i] is 1, and the corresponding piece of expression takies; And the value of free_block_count [k] subtracted 1, return the represented piece new_block_num of this bit; If block_bitmap [k] [i] be not 0 or the corresponding piece of block_bitmap [k] [i] be not positioned at the data field, i=i+1, if i<block_bitmap_size [k] * 8, wherein 8 bit numbers that comprise for each byte change 6.5.4, otherwise commentaries on classics 6.5.2;
6.6 the bitmap block block_bitmap [group_num] of inquiry request_block_num place piece group; If this piece is vacant; The value of then revising among the block_bitmap [group_num] bit that should piece is 1, and the corresponding piece of expression takies, and the value of free_block_count [group_num] is subtracted 1; Make new_block_num=request_block_num, change 6.7; Otherwise, represent that this piece is one and has taken piece, the data of this piece are must be protected; Call function findfree () seeks a free block new_block_num, if findfree () returns mistake, showing has not currently had free block and can use; Make the lo_send function make mistakes and withdraw from, no longer carry out follow-up write operation, changeed for the 4th step; If findfree () has found free block, change 6.7;
6.7 with (request_block_num new_block_num) joins among the chained list blocklist, and the current disk position pos that will write is revised as new_block_num * block_size+pos%block_size;
6.8lo_send the data in the core buffer that function is described bio write the position of pos indication in the disk, change for the 4th step, said bio is a parameter of lo_send function, gives the bio assignment when a type linux system kernel starts the lo_send function; In the 7th step, loop_exit starts Unload module, calls DSP_exit () module is operated as follows:
7.1DSP_exit () function discharges the memory source that produces in DSP module initialization and the program run, prevents the internal memory leakage;
7.2 continue to carry out the loop_exit function, to the unloading of Loop equipment, this step is the same to Loop equipment uninstall process with the loop_exit function of the said existing Loop equipment of background technology.Adopt the present invention can reach following technique effect:
The present invention can carry out transparency protected to data in magnetic disk; After adopting the present invention, the user can carry out any read-write operation to local hard drive under the situation that the perception data security protection module does not exist, and all are newly-increased to the disk legacy data; Revise; Deletion action all by the vacant space of transparent redirection to the disk, can not exert an influence to original data in magnetic disk, and these cease to be in force automatically after operating in restarting operating systems or the unloading of data security protecting module.For example, if the user has deleted file because of carelessness, or viral trojan horse program malice deleted data, and after the unloading of data security protecting module, these data are with as excellent as before.If viral wooden horse has been invaded system, or the rogue software that is difficult to unload has been installed, after the unloading of data security protecting module, these softwares all will not exist, and system will be returned to and load disk protect system clean state before last time.Therefore, all virus, trojan horse program, rogue softwares all can't be encroached on the data on the hard disk.The present invention can be used for personal computer online, the Internet bar, and the unit computer house can streamlining management, has wide practical value.
Description of drawings
Fig. 1: concern synoptic diagram between said existing type each kernel interface of (SuSE) Linux OS of background technology and the kernel module.
Fig. 2: the magnetic disk structural drawing of the said existing Extx class file of background technology system.
Fig. 3: the said existing type of (SuSE) Linux OS of background technology is to the process flow diagram of magnetic disc data accessing.
Fig. 4: adopt the present invention to add after the disk protect module type (SuSE) Linux OS to the process flow diagram of magnetic disc data accessing.
Fig. 5: overview flow chart of the present invention.
Embodiment
Fig. 4 adopts the present invention to add the process flow diagram of disk protect module (DSP module) back type (SuSE) Linux OS to magnetic disc data accessing.The DSP module loading is in the driver code of Loop equipment.The user's data access request gets into operating system nucleus through calling file system interface; Intercept and capture by the Extx file system module; The Extx file system module calls the Loop device driver module that has the DSP module again; Call related bottom physical disk device driver module by the Loop device driver module that has the DSP module and carry out the data in magnetic disk operation, and the result is returned to the user.
Fig. 5 is an overview flow chart of the present invention.
The first step, the loop_init of modification Loop equipment, lo_receive, lo_send and loop_exit function, the Loop device driver that will pass through modification is referred to as the data security protecting module, abbreviates DSP (Data Security Protection) module as.
Second step, with amended loop_init, lo_receive, lo_send and the compiling of loop_exit function generate new loop device driver module loop.ko.Begin the place at the loop_init function and add function DSP_init (); Begin the place at the lo_receive function and add function DSP_receive (); Begin the place at the lo_send function and add function DSP_send (), begin the place at the loop_exit function and add function DSP_exit ().
The 3rd step loaded the Loop device driver module, and loop_init calls the initialization that DSP_init () carries out the DSP module before initialization apparatus by the initialization function.
In the 4th step, wait for user's request.If data access request is the reading disk data, carried out for the 5th step; If user's request carried out for the 6th step for writing data in magnetic disk; If user's request carried out for the 7th step for withdrawing from the disk protect module.
In the 5th step, lo_receive starts, and calls DSP_receive () pos is made amendment.
In the 6th step, lo_send starts, and calls DSP_send () pos is made amendment.
In the 7th step, loop_exit starts, and call DSP_exit () and discharge the memory source that produces in DSP module initialization and the program run, and by loop_exit function unloading Loop equipment.
Claims (3)
1. hard disk data protection method towards the class (SuSE) Linux OS is characterized in that may further comprise the steps:
The first step is revised the loop_nit of Loop equipment, lo_receive, and lo_send and loop_exit function, it is the DSP module that the Loop device driver that will pass through modification is referred to as the data security protecting module, amending method is:
Begin the place at the loop_nit function and add function DSP_nit (), by the primary data of DSP_nit initialization DSP module;
Begin the place at the lo_receive function and add function DSP_receive (), the parameter p os by DSP_receive () revises lo_receive as required makes pos point to the data position after being redirected;
Begin the place at the lo_send function and add function DSP_send (), the parameter p os by DSP_send () revises lo_send as required makes pos point to untapped disk space;
Begin the place at the loop_exit function and add function DSP_exit (), discharge the memory source that produces in DSP module initialization and the program run by DSP_exit ();
Second step, with amended loop_nit, lo_receive, lo_send and loop_exit function compiling link generate new Loop device driver module loop.ko;
The 3rd step loaded Loop device driver module loop.ko, called initialization function loop_nit, and this function call DSP_nit () carries out following initialization:
3.1 make up a linear linked list blocklist; Doublet (old_block_num of each element storage among the blocklist; New_block_num); Old_block_num is used to write down the piece number of initial disk requests, and new_block_num is used to write down the new piece number after being redirected, and DSP_nit () is initialized as empty table with blocklist;
3.2 superblock, the group descriptor table of reading disk subregion file system are buffered in them in the internal memory, superblock and group descriptor table information according to buffer memory obtain following data:
3.2.1 the number of free block from group descriptor table acquisition 1-N piece group; The number of free block in the 1-N piece group is stored among the array free_block_count []; The number of free block in m piece group of free_block_count [m] storage, 1≤m≤N, N are positive integer;
Count block_count 3.2.2 obtain the piece of each piece group from superblock, the piece number of each piece group equates;
3.2.3 obtain the starting block block_bitmap_start [] of the bitmap block of 1-N piece group from the group descriptor table, the starting block of bitmap block number in m piece group of block_bitmap_start [m] storage;
3.2.4 obtain the starting block inode_table_start [] of the i node table of 1-N piece group from the group descriptor table, the starting block of i node table number in m piece group of inode_table_start [m] storage;
3.2.5 from the block size block_size of superblock acquisition 1-N piece group, unit is a byte;
Count inode_count 3.2.6 obtain the contained i node of each piece group from superblock;
3.2.7 obtain the starting block inode_bitmap_start [] of the i node bitmap of 1-N piece group from the group descriptor table, the starting block of i node bitmap number in m piece group of inode_bitmap_start [m] storage;
3.2.8 obtain file system total block data total_block_count from superblock;
3.3 calculate the size of the bitmap block of 1-N piece group, the size of i node table, the number of piece group:
3.3.1 the size of the bitmap block of m piece group:
Block_bitmap_size [m]=(inode_bitmap_start [m]-block_bitmap_start [m]) * block_size; Inode_bitmap_start [m] is the starting block number of the i node bitmap of m piece group; Block_bitmap_start [m] is the starting block number of the bitmap block of m piece group; Block_size is a block size, and unit is a byte;
3.3.2 the big or small inode_table_size of the i node table of piece group:
Inode_table_size=inode_count * 128/block_size, symbol "/" expression division, 128 is each i node size, unit is a byte;
3.3.3 the number of piece group: group_count=total_block_count/block_count;
3.4 according to the bitmap block starting block block_bitmap_start [] of 1-N piece group, and the big or small block_bitmap_size [] of bitmap block reads the bitmap block block_bitmap [] of 1-N piece group from disk;
[3.5loop_nit] function initialization apparatus;
The 4th step, wait for the user's data access request, if data access request is the reading disk data, carried out for the 5th step; If user's request carried out for the 6th step for writing data in magnetic disk; If user's request carried out for the 7th step for withdrawing from the disk protect module;
In the 5th step, lo_receive starts, and calling DSP_receive () is to make amendment in the disk position of this data access request to the parameter p os of lo_receive, and method is:
5.1 calculate the disk block that will read number: request_block_num=
expression rounds under the x.
5.2 with request_block_num inquiry linked list blocklist, if the old_block_num in all doublet of blocklist all do not equate with request_block_num, show that then this piece is not redirected, need not revise pos, carry out 5.3; If there is (old_block_num; New_block_num); Make old_block_num equal request_block_num, then the current disk position pos that will read is revised as new_block_num * block_size+pos%block_size, wherein % is complementation;
5.3lo_recive the data that function will read pos indication position from disk are filled in this data access request that bio describes the buffer zone of store data in the internal memory; Said bio is a parameter of lo_recive function; Give the bio assignment when class linux system kernel starts the lo_recive function, changeed for the 4th step;
In the 6th step, lo_send starts, and calls the parameter p os of DSP_send () to lo_send, and promptly make amendment in the disk position of this data access request, and method is:
6.2 with request_block_num inquiry linked list blocklist; If have doublet (old_block_num in the blocklist table; New_block_num); Make old_block_num equal request_block_num, then the current disk position pos that will write is revised as new_block_num * block_size+pos%block_size, change 6.7; If the old_block_num in the blocklist table in all doublet does not all equate with request_block_num, then carry out 6.3;
Whether be positioned at the data field 6.3 judge the corresponding data block of request_block_num;
6.4 if the corresponding data block of request_block_num is positioned at the data field, change 6.6; If the data block that request_block_num is corresponding is not positioned at the data field, change 6.5;
6.5 the write operation transparent redirection to of the data block that request_block_num is corresponding is the data block of usefulness not; Method is: seek a free block new_block_num; If current do not had free block and can use, make the lo_send function make mistakes and withdraw from, no longer carry out follow-up write operation; Changeed for the 4th step, otherwise change 6.7;
6.6 the bitmap block blockbitmap [group_num] of inquiry request_block_num place piece group; If this piece is vacant; The value of then revising among the block_bitmap [group_num] bit that should piece is 1; And the value of free_block_count [group_num] subtracted 1, and make new_block_num=request_block_num, change 6.7; If this piece is then sought a free block new_block_num for taking piece, if current do not had free block and can use, make the lo_send function make mistakes and withdraw from, no longer carry out follow-up write operation, changeed for the 4th step, if found free block, change 6.7;
6.7 with (request_block_num new_block_num) joins among the chained list blocklist, and the current disk position pos that will write is revised as new_block_num * block_size+pos%block_size;
6.8lo_send the data in the core buffer that function is described bio write the position of pos indication in the disk, change for the 4th step, said bio is a parameter of lo_send function, gives the bio assignment when a type linux system kernel starts the lo_send function;
In the 7th step, loop_exit starts Unload module, calls DSP_exit () module is operated as follows:
7.1DSP_exit () function discharges the memory headroom that produces in DSP module initialization and the program run;
7.2 continue to carry out the loop_exit function, Loop equipment unloaded.
2. the hard disk data protection method towards the class (SuSE) Linux OS as claimed in claim 1 is characterized in that the method whether corresponding data block of the said request_block_num of judgement is positioned at the data field is:
Step 2.1 is calculated the piece group number at the corresponding data block place of request_block_num:
group_num=[request_block_num/block_count];
Step 2.2 computing block group number is the data field starting block number of the piece group of group_num:
data_start=inode_table_start[group_num]+inode_table_size;
If step 2.3 request_block_num<data_start shows that the corresponding data block of request_block_num is positioned at file system metadata district before, data field, otherwise shows that the corresponding data block of request_block_num is positioned at the data field.
3. the hard disk data protection method towards the class (SuSE) Linux OS as claimed in claim 1 is characterized in that the method for a free block new_block_num of said searching is call function findfree (), and findfree () functional procedure is following:
Step 3.1 makes k=-1;
Step 3.2 makes k=k+1; If k >=group_count, group_count are piece group number, then function reports an error and withdraws from; Otherwise whether the value of inspection free_block_count [m] is judged k piece group and is also had free block to use; If free_block_count [k]=0 changes step 3.2, otherwise change step 3.3;
Step 3.3 is provided with loop variable i=0;
Step 3.4 makes the data of i bit of the bitmap block of k piece group of block_bitmap [k] [i] expression, if block_bitmap [k] [i] is 0, representes that the piece of correspondence is vacant; Judge whether the corresponding piece of block_bitmap [k] [i] is positioned at the data field; If be positioned at the data field, the value of then revising block_bitmap [k] [i] is 1, and the corresponding piece of expression takies; The value of free_block_count [k] is subtracted 1, return the represented piece new_block_num of this bit; If block_bitmap [k] [i] be not 0 or the corresponding piece of block_bitmap [k] [i] be not positioned at the data field, i=i+1, if i<block_bitmap_size [k] * 8, wherein 8 bit numbers that comprise for each byte change step 3.4, otherwise commentaries on classics step 3.2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210121227.2A CN102646079B (en) | 2012-04-23 | 2012-04-23 | Disk data protection method oriented to Linux operating system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210121227.2A CN102646079B (en) | 2012-04-23 | 2012-04-23 | Disk data protection method oriented to Linux operating system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102646079A true CN102646079A (en) | 2012-08-22 |
CN102646079B CN102646079B (en) | 2014-07-16 |
Family
ID=46658907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210121227.2A Expired - Fee Related CN102646079B (en) | 2012-04-23 | 2012-04-23 | Disk data protection method oriented to Linux operating system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102646079B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294958A (en) * | 2013-05-21 | 2013-09-11 | 中国人民解放军国防科学技术大学 | Kernel-level virtual polymerization and parallel encryption method for class-oriented Linux system |
CN103309773A (en) * | 2013-07-03 | 2013-09-18 | 厦门市美亚柏科信息股份有限公司 | Data recovery method of RAID0 under EXT3 file system |
CN104536903A (en) * | 2014-12-25 | 2015-04-22 | 华中科技大学 | Mixed storage method and system for conducting classified storage according to data attributes |
CN107148622A (en) * | 2014-09-23 | 2017-09-08 | 甲骨文国际公司 | Intelligent flash memory high-speed cache recorder |
CN110633173A (en) * | 2019-09-30 | 2019-12-31 | 郑州信大捷安信息技术股份有限公司 | Write filtering system and method based on Linux system disk |
CN111190550A (en) * | 2019-12-31 | 2020-05-22 | 深圳市安云信息科技有限公司 | Metadata acceleration method and device and storage equipment |
WO2023165567A1 (en) * | 2022-03-03 | 2023-09-07 | 中兴通讯股份有限公司 | File processing method, electronic device, and computer storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080082769A1 (en) * | 2006-10-03 | 2008-04-03 | Bull S.A.S. | Mass storage system and method |
CN101246458A (en) * | 2008-02-29 | 2008-08-20 | 中国科学院计算技术研究所 | Hard disk data protection method and system |
CN101901313A (en) * | 2010-06-10 | 2010-12-01 | 中科方德软件有限公司 | Linux file protection system and method |
-
2012
- 2012-04-23 CN CN201210121227.2A patent/CN102646079B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080082769A1 (en) * | 2006-10-03 | 2008-04-03 | Bull S.A.S. | Mass storage system and method |
CN101246458A (en) * | 2008-02-29 | 2008-08-20 | 中国科学院计算技术研究所 | Hard disk data protection method and system |
CN101901313A (en) * | 2010-06-10 | 2010-12-01 | 中科方德软件有限公司 | Linux file protection system and method |
Non-Patent Citations (1)
Title |
---|
FANGYI JIANG, ET AL.: "A Hardware-in-the-loop Simulation System of Diesel", 《POWER AND ENERGY ENGINEERING CONFERENCE, 2009. APPEEC 2009. ASIA-PACIFIC》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294958A (en) * | 2013-05-21 | 2013-09-11 | 中国人民解放军国防科学技术大学 | Kernel-level virtual polymerization and parallel encryption method for class-oriented Linux system |
CN103294958B (en) * | 2013-05-21 | 2015-07-22 | 中国人民解放军国防科学技术大学 | Kernel-level virtual polymerization and parallel encryption method for class-oriented Linux system |
CN103309773B (en) * | 2013-07-03 | 2016-08-10 | 厦门市美亚柏科信息股份有限公司 | The data reconstruction method of the RAID0 under EXT3 file system |
CN103309773A (en) * | 2013-07-03 | 2013-09-18 | 厦门市美亚柏科信息股份有限公司 | Data recovery method of RAID0 under EXT3 file system |
CN107148622B (en) * | 2014-09-23 | 2021-02-02 | 甲骨文国际公司 | Intelligent flash memory high-speed cache recorder |
CN107148622A (en) * | 2014-09-23 | 2017-09-08 | 甲骨文国际公司 | Intelligent flash memory high-speed cache recorder |
CN104536903B (en) * | 2014-12-25 | 2018-02-23 | 华中科技大学 | A kind of mixing storage method and system stored classifiedly by data attribute |
CN104536903A (en) * | 2014-12-25 | 2015-04-22 | 华中科技大学 | Mixed storage method and system for conducting classified storage according to data attributes |
CN110633173A (en) * | 2019-09-30 | 2019-12-31 | 郑州信大捷安信息技术股份有限公司 | Write filtering system and method based on Linux system disk |
CN110633173B (en) * | 2019-09-30 | 2022-12-23 | 郑州信大捷安信息技术股份有限公司 | Write filtering system and method based on Linux system disk |
CN111190550A (en) * | 2019-12-31 | 2020-05-22 | 深圳市安云信息科技有限公司 | Metadata acceleration method and device and storage equipment |
CN111190550B (en) * | 2019-12-31 | 2024-03-29 | 深圳市安云信息科技有限公司 | Metadata acceleration method and device and storage equipment |
WO2023165567A1 (en) * | 2022-03-03 | 2023-09-07 | 中兴通讯股份有限公司 | File processing method, electronic device, and computer storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102646079B (en) | 2014-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102646079B (en) | Disk data protection method oriented to Linux operating system | |
US10140461B2 (en) | Reducing resource consumption associated with storage and operation of containers | |
JP6362316B2 (en) | Method, system and computer program product for hybrid table implementation using buffer pool as resident in-memory storage for memory resident data | |
CN109906433A (en) | For the storage isolation of container | |
KR101806499B1 (en) | Method for managing files and apparatus using the same | |
CN110018998A (en) | A kind of file management method, system and electronic equipment and storage medium | |
US20060259854A1 (en) | Structuring an electronic document for efficient identification and use of document parts | |
CN107479922A (en) | A kind of flash data management method, device and computer-readable recording medium | |
US20090254585A1 (en) | Method for Associating Administrative Policies with User-Definable Groups of Files | |
US20230177009A1 (en) | Techniques for handling letter case in file systems | |
CN108268609A (en) | A kind of foundation of file path, access method and device | |
US8433873B2 (en) | Disposition instructions for extended access commands | |
CN106775501A (en) | Elimination of Data Redundancy method and system based on nonvolatile memory equipment | |
CN115357940A (en) | Data processing method and device, storage medium and electronic equipment | |
CN107577492A (en) | The NVM block device drives method and system of accelerating file system read-write | |
CN103049546B (en) | The method and apparatus of a kind of management, access system daily record | |
US10698865B2 (en) | Management of B-tree leaf nodes with variable size values | |
US12118245B2 (en) | File system improvements for zoned storage device operations | |
CN101324849A (en) | Method for integrating DOS operating system by BIOS chip | |
Schroeder | Performance of the GE-645 associative memory while Multics is in operation | |
CN113986858A (en) | Linux compatible android system shared file operation method and device | |
CN105243090A (en) | Exclusive file acquisition method and system | |
US11977785B2 (en) | Non-volatile memory device-assisted live migration of virtual machine data | |
Zhang et al. | Towards enumeration of NTFS using USN journals under UEFI | |
CN106484379A (en) | A kind of processing method and processing device of application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140716 Termination date: 20200423 |