CN104199750A - File recovery method and device of linux system - Google Patents

File recovery method and device of linux system Download PDF

Info

Publication number
CN104199750A
CN104199750A CN 201410425645 CN201410425645A CN104199750A CN 104199750 A CN104199750 A CN 104199750A CN 201410425645 CN201410425645 CN 201410425645 CN 201410425645 A CN201410425645 A CN 201410425645A CN 104199750 A CN104199750 A CN 104199750A
Authority
CN
China
Prior art keywords
file
system
iinux
partition
inode
Prior art date
Application number
CN 201410425645
Other languages
Chinese (zh)
Other versions
CN104199750B (en
Inventor
张新亮
Original Assignee
上海天脉聚源文化传媒有限公司
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 上海天脉聚源文化传媒有限公司 filed Critical 上海天脉聚源文化传媒有限公司
Priority to CN201410425645.XA priority Critical patent/CN104199750B/en
Publication of CN104199750A publication Critical patent/CN104199750A/en
Application granted granted Critical
Publication of CN104199750B publication Critical patent/CN104199750B/en

Links

Abstract

The invention discloses a file recovery method and device of a linux system. The file recovery method and device of the linux system are used for recovering Ext4 files which are deleted through rm by mistake on a linux server, and avoiding enormous losses caused due to the fact that important data of the server are lost. The method includes the steps that after file data of an Ext4 file system are deleted by mistake, a disk partition where the file data which are deleted by mistake are located is recorded as a disk partition to be recovered; a root directory of the linux system is switched to; the position of the disk partition to be recovered is sought for in a directory tree to obtain position information; the disk partition to be recovered is unloaded according to the position information; an inode value is check to confirm that the file data which are deleted by mistake are located in the root directory of the linux system at present; a disk traversal tool is downloaded and installed; the disk partition to be recovered is traversed, a list of all files with invalid inode information is obtained, and the file data which are deleted by mistake are found out; the inode information corresponding to the file data which are deleted by mistake is changed to be valid.

Description

—种I inux系统的文件恢复方法及装置 - kind of file system I inux recovery method and apparatus

技术领域 FIELD

[0001] 本发明涉及计算机技术领域,特别涉一种Iinux系统的文件恢复方法及装置。 [0001] The present invention relates to the field of computer technology, particularly to one kind Iinux system file recovery method and apparatus.

背景技术 Background technique

[0002] Linux是一套免费使用和自由传播的类Unix (尤尼斯)操作系统,是一个多用户、多任务、支持多线程和多CPU的操作系统。 [0002] Linux is a free Unix-use and free dissemination of (Younis) operating system, is a multi-user, multi-tasking, multi-threading and multi-CPU support for the operating system. 它支持32位和64位硬件。 It supports 32-bit and 64-bit hardware. Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。 Linux has inherited the Unix design idea to the network as the core, is a stable performance multi-user network operating system.

[0003] Linux的基本思想有两点:第一,一切都是文件;第二,每个软件都有确定的用途。 [0003] Linux basic idea of ​​two things: first, everything is a file; second, every software has identified uses. 其中第一条详细来讲就是系统中的所有都归结为一个文件,包括命令、硬件和软件设备、操作系统、进程等等对于操作系统内核而言,都被视为拥有各自特性或类型的文件。 The first of these is detailed in terms of all the system comes down to a file, including commands, hardware and software equipment, operating systems, processes, etc. for the operating system kernel, the file is considered to have their own characteristics or type of .

[0004] Linux 文件系统有Ext 2、Ext 3、Ext 4 三种。 [0004] Linux file system Ext 2, Ext 3, Ext 4 three. 其中,Ext4(The fourth extendedfile system,第四扩展文件系统)是一种针对Ext 3系统的扩展日志式文件系统,是专门为Linux开发的原始的扩展文件系统(ext或extfs)的第四版。 Which, Ext4 (The fourth extendedfile system, the fourth extended file system) is an extended log file system for Ext 3 system, developed specifically for the original Linux extended file system (ext or extfs) fourth edition.

[0005] Linux文件系统中,文件由inode ( —种数据结构,包含有文件的所有信息)进行唯一标识。 [0005] Linux file system, the file inode (- kind of data structure that contains all of the information has a file) uniquely identified. 每个文件有inode和block(块)组成,inode是文件系统组成的最基本单元,它保存着文件的基本属性(大小、权限、属主组等)和存放的位置信息。 Each file has inode and Block (Block) composition, inode file is the basic unit of the system components, which holds the basic attributes (size, permissions, owner, group, etc.), and file location information stored. 而block用来存储数据。 The block used to store data. 类似key-value (线索-值)存储系统,inode就是key, block对应value,通过key查找key对应的value。 Similar key-value (cue - value) storage system, inode is the key, block corresponding to the value, find the key value through the corresponding key. 类似python ( —种解释型、面向对象、动态数据类型的高级程序设计语目)的字典。 Similar python (- explanations, object-oriented, dynamic data type of high-level programming language project) dictionary. ,

[0006] Linux服务器上通过图像界面删除的软件一般在回收站里可恢复,而通过命令行用“rm-rf*”命令删除的数据很难恢复。 [0006] on a Linux server to delete the image interface software is generally recoverable from the recycle bin, and through the command-line command to delete the data difficult to recover with "rm-rf *". Ext2文件格式的磁盘通常可以通过“debugfs工具”来恢复,Ext3文件格式的磁盘数据可以通过“ext3rescue工具”来恢复,但因为Ext4格式的磁盘结构,不能直接用之前的恢复工具,目前恢复Ext4格式磁盘数据的恢复非常困难。 Ext2 file format disks can usually be restored by "debugfs tool" disk data Ext3 file formats can be restored by "ext3rescue tool", but because the disk structure Ext4 format, can not be directly used before recovery tool, currently restored Ext4 format disk data recovery very difficult.

发明内容 SUMMARY

[0007] 本发明提供一种Iinux系统的文件恢复方法及装置,用以恢复在Iinux服务器上用rm误删除的Ext4文件,避免丢失服务器重要数据造成巨大损失。 [0007] The present invention provides a system Iinux file recovery method and apparatus for restoring a server on Iinux Ext4 rm accidentally deleted file, the server avoid loss of important data caused huge losses.

[0008] 本发明提供一种Iinux系统的文件恢复方法,用于Ext4文件系统,包括: [0008] The present invention provides a system Iinux file recovery method for Ext4 file system, comprising:

[0009] 发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; [0009] found that Ext4 file system data file is accidentally deleted, the disk partition accidentally deleted files where the data to be recorded as a recovery partition;

[0010] 切换到Iinux系统的根目录下; [0010] Iinux switch to the root system;

[0011] 在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; [0011] Finding the location of the partition to be recovered in the directory tree Iinux system to obtain location information;

[0012] 根据所述位置信息,卸载所述待恢复磁盘分区; [0012] According to the position information, unloading the partition to be recovered;

[0013] 通过查看inode值确认当前处于Iinux系统的根目录下; [0013] confirmed by looking at the value of the current inode in the root directory Iinux system;

[0014] 下载并安装磁盘遍历工具; [0014] Download and install the disk traversing the tool;

[0015] 通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; [0015] tools to traverse the disk traversing the partition to be recovered to obtain a list of all the files inode information of failure, find the list of the file data according to the file have been erroneously erased;

[0016] 将所述被误删除的文件数据对应的inode信息修改为有效。 [0016] The accidentally deleted file data corresponding to the inode information modification is valid.

[0017] 优选的,上述的方法中,在将所述被误删除的文件数据对应的inode信息修改为有效的步骤之后,还包括: [0017] Preferably, in the method, after the data have been erroneously erased file corresponding to the inode information modification step to be valid, further comprising:

[0018] 通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 Digest tool [0018] message and the verification document by computing the checksum being accidentally deleted files, to check whether a successful recovery.

[0019] 优选的,上述的方法中,所述计算和校验文件报文摘要的工具为“md5sum”命令。 [0019] Preferably, in the method, the calculating and verifying files message digest tool "md5sum" command.

[0020] 优选的,上述的方法中,所述通过查看inode值确认当前处于Iinux系统的根目录下的步骤中,如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 [0020] Preferably, in the method, the inode value confirmed by looking at the current step at the root of Iinux system, if the inode value is 2, it is confirmed in the root directory of the current Iinux system.

[0021] 本发明还提供一种Iinux系统的文件恢复装置,用于Ext4文件系统,包括: [0021] The present invention also provides a system Iinux file recovery means for Ext4 file system, comprising:

[0022] 记录单元,用于:发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; [0022] The recording unit, configured to: discover Ext4 file system file data from being inadvertently erased, the partition data being accidentally deleted files to be restored where the recording disk partition;

[0023] 切换单元,用于:切换到Iinux系统的根目录下; [0023] a switching unit, configured to: switch to the root directory Iinux system;

[0024] 位置信息单元,用于:在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; [0024] The position information unit, configured to: find the location of the partition to be recovered in the directory tree Iinux system to obtain location information;

[0025] 卸载单元,用于:根据所述位置信息,卸载所述待恢复磁盘分区; [0025] The unloading unit, configured to: according to the location information, unloading the partition to be recovered;

[0026] 确认单元,用于:通过查看inode值确认当前处于Iinux系统的根目录下; [0026] confirmation unit, configured to: be confirmed by checking the value of the current inode in the root directory Iinux system;

[0027] 安装单元,用于:下载并安装磁盘遍历工具; [0027] The mounting unit, configured to: download and install the disk traversing the tool;

[0028] 遍历单元,用于:通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; [0028] traversal unit, configured to: traversing through the disk tool traversing the partition to be recovered to obtain a list of all the files inode information of failure, find the list of the file data according to the file have been erroneously erased;

[0029] 修改单元,用于:将所述被误删除的文件数据对应的inode信息修改为有效。 [0029] The modification unit, configured to: modify the effective accidentally deleted file data corresponding to the inode information.

[0030] 优选的,上述的装置中,还包括: [0030] Preferably, said apparatus further comprising:

[0031] 校验单元,用于:通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 [0031] checking unit, configured to: the checksum being accidentally deleted files to a tool message digest by calculating a checksum file and check for successful recovery.

[0032] 优选的,上述的装置中,所述计算和校验文件报文摘要的工具为“md5sum”命令。 [0032] Preferably, in the apparatus, the computing and verification document message digest tool "md5sum" command.

[0033] 优选的,上述的装置中,所述确认单元具体用于:如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 [0033] Preferably, in the apparatus, the confirmation unit is configured to: if the inode value is 2, it is confirmed in the root directory of the current Iinux system.

[0034] 优选的,上述的装置中,所述安装单元包括: [0034] Preferably, in the apparatus, the mounting unit comprises:

[0035] 网络适配器,用于连接互联网; [0035] The network adapter configured to connect to the Internet;

[0036] 搜索单元,用于在互联网上搜索并下载所述磁盘遍历工具。 [0036] The search unit for searching on the Internet and downloading the disk traversing tool.

[0037] 优选的,上述的装置中,所述安装单元还包括: [0037] Preferably, in the apparatus, said mounting means further comprises:

[0038] 存储单元,用于预先存储所述磁盘遍历工具或者预先存储所述磁盘遍历工具的下载地址。 [0038] a storage unit operable to store the disk or the disk traversing means to traverse the tool stored in advance in the Download.

[0039] 本发明实施例具有以下技术效果: [0039] Example embodiments of the present invention has the following technical effects:

[0040] I)本发明实施例中,在发现误删除后,及时切换到根目录下,并卸载所述待恢复磁盘分区,从而防止误删除文件被覆盖,能有效恢复在Iinux服务器上用rm误删除的Ext4文件,避免丢失服务器重要数据造成巨大损失。 Embodiment [0040] I) of the present invention, after the discovery of accidentally deleted, promptly switched to the root directory, and unloading the partition to be recovered, thereby preventing erroneous erasing files from being overwritten, it can be effectively restored by rm on the server Iinux Ext4 file accidentally deleted, to avoid the loss of important data server caused huge losses.

[0041] 本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。 [0041] Other features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or learned by practice of the present invention. 本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。 The objectives and other advantages of the invention may be realized and attained by the written description, claims, and drawings structure particularly pointed out.

[0042] 下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。 [0042] The following drawings and embodiments, detailed description of the further aspect of the present invention.

附图说明 BRIEF DESCRIPTION

[0043] 附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。 [0043] The accompanying drawings provide a further understanding of the present invention, and constitute part of this specification, the embodiments of the invention, serve to explain the invention, not to limit the present invention. 在附图中: In the drawings:

[0044] 图1为本发明实施例的文件恢复方法的流程图; [0044] FIG. 1 is a flowchart example of file recovery method embodiment of the invention;

[0045] 图2为本发明实施例的文件恢复装置的示意图。 Schematic file [0045] FIG. 2 embodiment of the invention the recovery means.

具体实施方式 Detailed ways

[0046] 以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。 [0046] Hereinafter, the preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention and are not intended to limit the present invention.

[0047] Linux系统中,一般“根”目录的inode值为2,一个分区挂载到一个目录下时,这个“根”目录的inode值为2,首先把丢失数据的磁盘分区挂载到/mnt目录下,避免数据被覆盖,Linux下删除文件并不是真实的删除磁盘分区中的文件,而是将文件的inode节点中的扇区指针清除,同时释放这些数据对应的数据块,当释放的数据块被系统重新分配时,那些被删除的数据就会被覆盖,所以误删除数据后,应马上卸载文件所在的分区。 [0047] Linux system, generally is inode number "root" directory 2, when a partition is mounted to a directory, the "root" directory is inode number 2, the missing data is first mounted to the disk partition / under mnt directory, prevents data from being overwritten, deleted files under Linux is not a real disk partition to delete a file, but the file's inode node pointer sector clear, while the release of the data corresponding to the data block, when released when data blocks are re-distribution system that deleted data is overwritten, so after accidentally deleted data, you should immediately uninstall the partition file.

[0048] 图1为本发明实施例的文件恢复方法的流程图,如图1所示,一种Iinux系统的文件恢复方法,用于Ext4文件系统,其包括: A flowchart of file recovery method [0048] Figure 1 embodiment of the present invention, shown in Figure 1, one kind of file system recovery Iinux method for Ext4 file system, comprising:

[0049] 发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; [0049] found that Ext4 file system data file is accidentally deleted, the disk partition accidentally deleted files where the data to be recorded as a recovery partition;

[0050] 切换到Iinux系统的根目录下; [0050] Iinux switch to the root system;

[0051] 在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; [0051] Finding the location of the partition to be recovered in the directory tree Iinux system to obtain location information;

[0052] 根据所述位置信息,卸载所述待恢复磁盘分区; [0052] According to the position information, unloading the partition to be recovered;

[0053] 通过查看inode值确认当前处于Iinux系统的根目录下; [0053] confirmed by looking at the value of the current inode in the root directory Iinux system;

[0054] 下载并安装磁盘遍历工具; [0054] Download and install the disk traversing the tool;

[0055] 通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; [0055] tools to traverse the disk traversing the partition to be recovered to obtain a list of all the files inode information of failure, find the list of the file data according to the file have been erroneously erased;

[0056] 将所述被误删除的文件数据对应的inode信息修改为有效。 [0056] The accidentally deleted file data corresponding to the inode information modification is valid.

[0057] 可见,本发明实施例中,在发现误删除后,及时切换到根目录下,并卸载所述待恢复磁盘分区,从而防止误删除文件被覆盖,能有效恢复在Iinux服务器上用rm误删除的Ext4文件,避免丢失服务器重要数据造成巨大损失。 [0057] visible, embodiments of the present invention, after the discovery of accidentally deleted, promptly switched to the root directory, and unloading the partition to be recovered, thereby preventing erroneous erasing files from being overwritten, it can be effectively restored by rm on the server Iinux Ext4 file accidentally deleted, to avoid the loss of important data server caused huge losses.

[0058] 在本发明的一个实施例中,在将所述被误删除的文件数据对应的inode信息修改为有效的步骤之后,还包括: [0058] In one embodiment of the present invention, after the data being accidentally deleted files corresponding inode information modification step to be valid, further comprising:

[0059] 通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 Digest tool [0059] message and the verification document by computing the checksum being accidentally deleted files, to check whether a successful recovery. 从而能够得到是否恢复成功的准确信息。 It is possible to obtain accurate information about whether the recovery success.

[0060] 在本发明的一个实施例中,所述计算和校验文件报文摘要的工具为“md5sum”命令。 [0060] In one embodiment of the present invention, the computing and verification document message digest tool "md5sum" command.

[0061] 在本发明的一个实施例中,所述通过查看inode值确认当前处于Iinux系统的根目录下的步骤中,如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 [0061] In one embodiment of the present invention, the step of confirming that you are at the root of the system by Iinux view inode value, if the inode value is 2, it is confirmed in the root directory of the current Iinux system.

[0062] 图2为本发明实施例的文件恢复装置的示意图,如图2所示,一种Iinux系统的文件恢复装置,用于Ext4文件系统,其包括: [0062] FIG. 2 is a schematic embodiment of a file recovery apparatus of the present invention, shown in Figure 2, the file system is one kind Iinux recovery means for Ext4 file system, comprising:

[0063] 记录单元201,用于:发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; [0063] The recording unit 201, configured to: discover Ext4 file system file data from being inadvertently erased, the partition data being accidentally deleted files to be restored where the recording disk partition;

[0064] 切换单元202,用于:切换到Iinux系统的根目录下; [0064] The switching unit 202 is configured: to switch to the root system Iinux;

[0065] 位置信息单元203,用于:在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; [0065] The position information unit 203, configured to: find the location of the partition to be recovered to obtain the location information in the directory tree Iinux system;

[0066] 卸载单元204,用于:根据所述位置信息,卸载所述待恢复磁盘分区; [0066] The unloading unit 204, configured to: according to the location information, unloading the partition to be recovered;

[0067] 确认单元205,用于:通过查看inode值确认当前处于Iinux系统的根目录下; [0067] The confirmation unit 205, configured to: be confirmed by checking the value of the current inode in the root directory Iinux system;

[0068] 安装单元206,用于:下载并安装磁盘遍历工具; [0068] The mounting unit 206, configured to: download and install the disk traversing the tool;

[0069] 遍历单元207,用于:通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; [0069] traversal unit 207, configured to: traversing the partition to be recovered to obtain a list of all the files inode information tool failure by traversing the disk, the data of the list of found accidentally deleted file according to the file;

[0070] 修改单元208,用于:将所述被误删除的文件数据对应的inode信息修改为有效。 [0070] The modification unit 208, configured to: modify the effective accidentally deleted file data corresponding to the inode information.

[0071] 在本发明的一个实施例中,还包括:校验单元,用于:通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 [0071] In one embodiment of the present invention, further comprising: a check unit, configured to: the checksum being accidentally deleted files to a tool message digest by calculating a checksum file and check for successful recovery.

[0072] 其中,所述计算和校验文件报文摘要的工具为“md5sum”命令。 [0072] wherein said computing and verification document message digest tool "md5sum" command. 所述确认单元具体用于:如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 The acknowledgment unit is specifically configured to: if the inode value is 2, it is confirmed in the root directory of the current Iinux system.

[0073] 在本发明的一个实施例中,所述安装单元包括: [0073] In one embodiment of the present invention, the mounting unit comprises:

[0074] 网络适配器,用于连接互联网; [0074] The network adapter configured to connect to the Internet;

[0075] 搜索单元,用于在互联网上搜索并下载所述磁盘遍历工具。 [0075] The search unit for searching on the Internet and downloading the disk traversing tool. 搜索单元可以为具有搜索功能的插件。 Search for the plug unit may have a search function.

[0076] 所述安装单元还包括:存储单元,用于预先存储所述磁盘遍历工具或者预先存储所述磁盘遍历工具的下载地址。 [0076] The mounting unit further comprises: a storage means for storing the traversing disk or magnetic tool is used to traverse the tool stored in advance in the Download. 通过这种方式,可以预先存储磁盘遍历工具,用到的时候直接安装就可以了。 In this way, you can pre-stored disk traversing the tool, when used directly installed on it. 也可以预先存储下载位置,免去了搜索的过程。 Download location can be stored in advance, eliminating the need for the search process.

[0077] 由上可知,本发明实施例具有以下优势: [0077] From the above, embodiments of the present invention has the following advantages:

[0078] I)本发明实施例中,在发现误删除后,及时切换到根目录下,并卸载所述待恢复磁盘分区,从而防止误删除文件被覆盖,能有效恢复在Iinux服务器上用rm误删除的Ext4文件,避免丢失服务器重要数据造成巨大损失。 Embodiment [0078] I) of the present invention, after the discovery of accidentally deleted, promptly switched to the root directory, and unloading the partition to be recovered, thereby preventing erroneous erasing files from being overwritten, it can be effectively restored by rm on the server Iinux Ext4 file accidentally deleted, to avoid the loss of important data server caused huge losses.

[0079] 本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。 [0079] skilled in the art should understand that the embodiments of the present invention may provide a method, system, or computer program product. 因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。 Thus, embodiments of the present invention may be employed entirely hardware embodiment, an entirely software embodiment, or an embodiment in conjunction with the form of software and hardware aspects. 而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。 Further, in the present invention may comprise one or more of which computer usable storage medium having computer-usable program code (including but not limited to disk storage, and optical storage) in the form of a computer program product implemented on.

[0080] 本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。 [0080] The present invention has been described in accordance with the method of Example of the present invention, apparatus (systems) and computer program products flowchart and / or block diagrams described. 应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。 It should be understood and implemented by computer program instructions and block, and the flowchart / or block diagrams each process and / or flowchart illustrations and / or block diagrams of processes and / or blocks. 可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。 These computer program instructions may be provided to a processor a general purpose computer, special purpose computer, embedded processor or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus generating in a device for implementing the flow chart or more flows and / or block diagram block or blocks in a specified functions.

[0081] 这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。 [0081] These computer program instructions may also be stored in a computer can direct a computer or other programmable data processing apparatus to function in a particular manner readable memory produce an article of manufacture such that the storage instruction means comprises a memory in the computer-readable instructions the instruction means implemented in a flowchart or more flows and / or block diagram block or blocks in a specified function.

[0082] 这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。 [0082] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps on the computer or other programmable apparatus to produce a computer implemented so that the computer or other programmable apparatus execute instructions to provide processes for implementing a process or flows and / or block diagram block or blocks a function specified step.

[0083] 显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。 [0083] Obviously, those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. 这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 Thus, if these modifications and variations of the present invention fall within the claims of the invention and the scope of equivalents thereof, the present invention intends to include these modifications and variations.

Claims (10)

1.一种Iinux系统的文件恢复方法,用于Ext4文件系统,其特征在于,包括: 发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; 切换到Iinux系统的根目录下; 在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; 根据所述位置信息,卸载所述待恢复磁盘分区; 通过查看inode值确认当前处于Iinux系统的根目录下; 下载并安装磁盘遍历工具; 通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; 将所述被误删除的文件数据对应的inode信息修改为有效。 A Iinux file system recovery method for Ext4 file system, characterized by comprising: a data file is found to have been erroneously erased Ext4 file system, the recording disk partition where the data is accidentally deleted files to be restored to the disk partition; Iinux switch to the root system; find the location of the partition to be recovered to obtain the location information in the directory tree Iinux system; according to the location information, unloading the partition to be recovered; values ​​by viewing the inode confirm currently in the root directory of Iinux system; download and install the disk traversing the tool; traversing through the disk traversing the tool to be restored partition, get a list of all the file inode information failed, according to the list of files found on the mistaken deleted file data; said data being accidentally deleted files inode information modification corresponding valid.
2.如权利要求1所述的方法,其特征在于,在将所述被误删除的文件数据对应的inode信息修改为有效的步骤之后,还包括: 通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 2. The method according to claim 1, wherein, after the data have been erroneously erased file corresponding to the inode information modification step to be valid, further comprising: a digest of the message by calculating a tool and verification document the accidentally deleted file verification, check for a successful recovery.
3.如权利要求2所述的方法,其特征在于,所述计算和校验文件报文摘要的工具为“md5sum” 命令。 The method according to claim 2, wherein said calculation and verification document message digest tool "md5sum" command.
4.如权利要求2所述的方法,其特征在于,所述通过查看inode值确认当前处于Iinux系统的根目录下的步骤中,如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 4. The method according to claim 2, characterized in that, by viewing the inode values ​​to confirm the current step in the root directory Iinux system, if the inode value is 2, it is confirmed at the root of the current system Iinux Under contents.
5.一种Iinux系统的文件恢复装置,用于Ext4文件系统,其特征在于,包括: 记录单元,用于:发现Ext4文件系统的文件数据被误删除,将被误删除的文件数据所在的磁盘分区记录为待恢复磁盘分区; 切换单元,用于:切换到Iinux系统的根目录下; 位置信息单元,用于:在Iinux系统的目录树中查找所述待恢复磁盘分区的位置,获得位置信息; 卸载单元,用于:根据所述位置信息,卸载所述待恢复磁盘分区; 确认单元,用于:通过查看inode值确认当前处于Iinux系统的根目录下; 安装单元,用于:下载并安装磁盘遍历工具; 遍历单元,用于:通过所述磁盘遍历工具遍历所述待恢复磁盘分区,获得所有inode信息失效的文件列表,根据所述文件列表找到所述被误删除的文件数据; 修改单元,用于:将所述被误删除的文件数据对应的inode信息修改为有效。 A Iinux file system recovery means for Ext4 file system, characterized by comprising: a recording unit, configured to: discover Ext4 file system file data have been erroneously erased, the disk will be accidentally deleted file data resides is recorded as the partition to be recovered partition; a switching unit, configured to: switch to the root system Iinux; location information unit, configured to: find the location of the partition to be recovered in the directory tree Iinux system, position information is obtained ; unloading unit, configured to: according to the location information, unloading the partition to be recovered; confirmation unit, configured to: be confirmed by checking the value of the current inode in the root directory Iinux system; mounting unit, configured to: download and install disk tool traversal; traversal unit, configured to: traversing through the disk tool traversing the partition to be recovered to obtain a list of all the files inode information of failure, find the list of the file data according to the file is accidentally deleted; modification unit for: the modification of the valid data being accidentally deleted file corresponding to the inode information.
6.如权利要求5所述的装置,其特征在于,还包括: 校验单元,用于:通过计算和校验文件报文摘要的工具对所述被误删除的文件进行校验,检查是否恢复成功。 6. The apparatus according to claim 5, characterized in that, further comprising: a check unit, configured to: the checksum being accidentally deleted files to a tool message digest by calculating a checksum and file check whether successful recovery.
7.如权利要求6所述的装置,其特征在于,所述计算和校验文件报文摘要的工具为“md5sum” 命令。 7. The apparatus according to claim 6, wherein said message digest is calculated, and the tool for the verification document is "md5sum" command.
8.如权利要求6所述的装置,其特征在于,所述确认单元具体用于:如果所述inode值为2,则确认当前处于Iinux系统的根目录下。 8. The apparatus according to claim 6, wherein said confirmation unit is configured to: if the inode value is 2, it is confirmed in the root directory of the current Iinux system.
9.如权利要求5所述的装置,其特征在于,所述安装单元包括: 网络适配器,用于连接互联网; 搜索单元,用于在互联网上搜索并下载所述磁盘遍历工具。 9. The apparatus according to claim 5, wherein said mounting means comprises: a network adapter for connection to the Internet; search unit configured to search and download the disk traversing the tool on the Internet.
10.如权利要求9所述的装置,其特征在于,所述安装单元还包括: 存储单元,用于预先存储所述磁盘遍历工具或者预先存储所述磁盘遍历工具的下载地址。 10. The apparatus according to claim 9, wherein said mounting means further comprises: a storage means for storing the traversing disk or magnetic tool is used to traverse the tool stored in advance in the Download.
CN201410425645.XA 2014-08-26 2014-08-26 A file that linux system recovery method and apparatus CN104199750B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410425645.XA CN104199750B (en) 2014-08-26 2014-08-26 A file that linux system recovery method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410425645.XA CN104199750B (en) 2014-08-26 2014-08-26 A file that linux system recovery method and apparatus

Publications (2)

Publication Number Publication Date
CN104199750A true CN104199750A (en) 2014-12-10
CN104199750B CN104199750B (en) 2017-07-28

Family

ID=52085047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410425645.XA CN104199750B (en) 2014-08-26 2014-08-26 A file that linux system recovery method and apparatus

Country Status (1)

Country Link
CN (1) CN104199750B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850470A (en) * 2015-05-12 2015-08-19 浪潮电子信息产业股份有限公司 Method for fast recovering mis-deleted data under linux system
CN105068889A (en) * 2015-08-03 2015-11-18 四川效率源信息安全技术有限责任公司 Method for recovering completely deleted files in Ext3/Ext4
CN105095026A (en) * 2015-08-31 2015-11-25 小米科技有限责任公司 Superblock repair method and apparatus for EXT file system and intelligent device
CN105095025A (en) * 2015-08-28 2015-11-25 小米科技有限责任公司 Method and apparatus for recovering deleted file in ext file system
CN105183586A (en) * 2015-08-31 2015-12-23 小米科技有限责任公司 Method and apparatus for restoring accidentally deleted file in EXT file system and intelligent device
CN105204959A (en) * 2015-08-28 2015-12-30 小米科技有限责任公司 Method and device for restoring deleted files in ext file system
CN105701146A (en) * 2015-12-28 2016-06-22 小米科技有限责任公司 Directory creating method and apparatus
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Application method and system of recycle bin of distributed cluster
CN105701146B (en) * 2015-12-28 2019-07-05 小米科技有限责任公司 The method and apparatus to create directory

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6615365B1 (en) * 2000-03-11 2003-09-02 Powerquest Corporation Storing a computer disk image within an imaged partition
CN101937377A (en) * 2009-06-29 2011-01-05 百度在线网络技术(北京)有限公司 Data recovery method and device
CN102135926A (en) * 2011-03-18 2011-07-27 浪潮电子信息产业股份有限公司 Data storing method capable of protecting hard disc from clearing or low level
CN102289524A (en) * 2011-09-26 2011-12-21 深圳市万兴软件有限公司 A data recovery method and system for
CN102495812A (en) * 2011-12-15 2012-06-13 江苏中科梦兰电子科技有限公司 Hard disk data protection and recovery method of Linux platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6615365B1 (en) * 2000-03-11 2003-09-02 Powerquest Corporation Storing a computer disk image within an imaged partition
CN101937377A (en) * 2009-06-29 2011-01-05 百度在线网络技术(北京)有限公司 Data recovery method and device
CN102135926A (en) * 2011-03-18 2011-07-27 浪潮电子信息产业股份有限公司 Data storing method capable of protecting hard disc from clearing or low level
CN102289524A (en) * 2011-09-26 2011-12-21 深圳市万兴软件有限公司 A data recovery method and system for
CN102495812A (en) * 2011-12-15 2012-06-13 江苏中科梦兰电子科技有限公司 Hard disk data protection and recovery method of Linux platform

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850470A (en) * 2015-05-12 2015-08-19 浪潮电子信息产业股份有限公司 Method for fast recovering mis-deleted data under linux system
CN105068889A (en) * 2015-08-03 2015-11-18 四川效率源信息安全技术有限责任公司 Method for recovering completely deleted files in Ext3/Ext4
CN105068889B (en) * 2015-08-03 2018-05-25 四川效率源信息安全技术股份有限公司 Recovery Ext3 / Ext4 method has been thoroughly delete files
CN105095025A (en) * 2015-08-28 2015-11-25 小米科技有限责任公司 Method and apparatus for recovering deleted file in ext file system
CN105204959A (en) * 2015-08-28 2015-12-30 小米科技有限责任公司 Method and device for restoring deleted files in ext file system
CN105204959B (en) * 2015-08-28 2018-11-30 小米科技有限责任公司 Ext recover deleted files in the file system method and apparatus
CN105183586A (en) * 2015-08-31 2015-12-23 小米科技有限责任公司 Method and apparatus for restoring accidentally deleted file in EXT file system and intelligent device
CN105095026A (en) * 2015-08-31 2015-11-25 小米科技有限责任公司 Superblock repair method and apparatus for EXT file system and intelligent device
CN105701146A (en) * 2015-12-28 2016-06-22 小米科技有限责任公司 Directory creating method and apparatus
CN105701146B (en) * 2015-12-28 2019-07-05 小米科技有限责任公司 The method and apparatus to create directory
CN107239521A (en) * 2017-05-26 2017-10-10 郑州云海信息技术有限公司 Application method and system of recycle bin of distributed cluster

Also Published As

Publication number Publication date
CN104199750B (en) 2017-07-28

Similar Documents

Publication Publication Date Title
US8566821B2 (en) Cloning virtual machines
US8271751B2 (en) Systems and methods for reliably managing files in a computer system
US8151247B2 (en) Test data management
US7703090B2 (en) Patch un-installation
US8370593B2 (en) Method and apparatus to manage groups for deduplication
JP2019096355A (en) Method and apparatus for logical volume maintenance
US10282112B2 (en) Network optimized deduplication of virtual machine snapshots
US9507670B2 (en) Selective processing of file system objects for image level backups
US9298392B2 (en) System and method for full virtual machine backup using storage system functionality
US20100299666A1 (en) Live Migration of Virtual Machines In a Computing environment
JP5642198B2 (en) Systems and methods for removing non-reference data segment from the deduplication data system
CN102918487B (en) System and method for garbage collection system to duplicate data
US8140907B2 (en) Accelerated virtual environments deployment troubleshooting based on two level file system signature
US7606842B2 (en) Method of merging a clone file system with an original file system
US10114574B1 (en) Optimizing storage allocation in a storage system
US9032387B1 (en) Software distribution framework
CN101031907B (en) Index processing
US20160098191A1 (en) Optimizing replication by distinguishing user and system write activity
US9104331B2 (en) System and method for incremental virtual machine backup using storage system functionality
JP2016533586A (en) System and method for virtual machine conversion
US7523452B1 (en) Method and apparatus for creating and using a download package to modify software configuration of a storage system
US10114630B2 (en) Management of software and operating system updates required for the process of creating a virtual machine facsimile of an existing physical or virtual machine
CN1936844A (en) Method and system for updating software
CN104781791A (en) Universal pluggable cloud disaster recovery system
CN101243395A (en) Archiving data in a virtual application environment

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01