热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

EXT3文件系统中误删文件的恢复方法

之前的文章中说明了当用rm-rf误删除文件后的恢复方法,使用这种方法是有前提条件的,必须保证Oracle实例没有关闭,Oracle的相关

之前的文章中说明了当用rm -rf误删除文件后的恢复方法,使用这种方法是有前提条件的,必须保证Oracle实例没有关闭,Oracle的相关

之前的文章中说明了当用rm -rf误删除文件后的恢复方法,使用这种方法是有前提条件的,必须保证Oracle实例没有关闭,Oracle的相关进程还在运行。而当Oracle进程已经关闭后,就无法再通过利用ora_进程跟踪文件句柄进行恢复了,那么还有办法对误删除的文件进行恢复吗?

rm-rf 误操作的恢复过程

Linux EXT3文件系统下成功恢复误删的文件

下面介绍一种用第三方软件进行恢复的方法:

--首先确保已经安装了e2fsprogs包
[root@ora10g ext3grep-0.10.2]# rpm -qa | grep e2fsprogs
e2fsprogs-1.39-20.el5
e2fsprogs-devel-1.39-20.el5
e2fsprogs-libs-1.39-20.el5

--软件下载:

--用Xshell复制到/opt目录后解压并编译安装

[root@ora10g ~]# cd /opt/

[root@ora10g opt]# tar -zxvf ext3grep-0.10.2.tar.gz

[root@ora10g opt]# ll
total 500
drwxr-xr-x 3 1000 1000 4096 Aug 26 09:09 ext3grep-0.10.2
-rw-r--r-- 1 root root 236364 Aug 26 09:08 ext3grep-0.10.2.tar.gz
drwxr-xr-x 3 root root 4096 Aug 22 16:44 ORCLfmap
drwxrwxr-x 8 oracle oinstall 4096 Aug 25 11:39 rlwrap-0.37
-rw-r--r-- 1 root root 251438 Aug 25 11:37 rlwrap-0.37.tar.gz
[root@ora10g opt]# cd ext3grep-0.10.2
[root@ora10g ext3grep-0.10.2]# ./configure&&make&&make install
编译过程略……

--查看软件命令使用方法
[root@ora10g ext3grep-0.10.2]# ext3grep --help
Running ext3grep version 0.10.2
Usage: ext3grep [options] [--] device-file
Options:
--version, -[vV] Print version and exit successfully.
--help, Print this help and exit successfully.
--superblock Print contents of superblock in addition to the rest.
If no action is specified then this option is implied.
--print Print content of block or inode, if any.
--ls Print directories with only one line per entry.
This option is often needed to turn on filtering.
--accept filen Accept 'filen' as a legal filename. Can be used multi-
ple times. If you change any --accept you must remove
BOTH stage* files!
--accept-all Simply accept everything as filename.
--journal Show content of journal.
--show-path-inodes Show the inode of each directory component in paths.
Filters:
--group grp Only process group 'grp'.
--directory Only process directory inodes.
--after dtime Only entries deleted on or after 'dtime'.
--before dtime Only entries deleted before 'dtime'.
--deleted Only show/process deleted entries.
--allocated Only show/process allocated inodes/blocks.
--unallocated Only show/process unallocated inodes/blocks.
--reallocated Do not suppress entries with reallocated inodes.
Inodes are considered 'reallocated' if the entry
is deleted but the inode is allocated, but also when
the file type in the dir entry and the inode are
different.
--zeroed-inodes Do not suppress entries with zeroed inodes. Linked
entries are always shown, regardless of this option.
--depth depth Process directories recursively up till a depth
of 'depth'.
Actions:
--inode-to-block ino Print the block that contains inode 'ino'.
--inode ino Show info on inode 'ino'.
If --ls is used and the inode is a directory, then
the filters apply to the entries of the directory.
If you do not use --ls then --print is implied.
--block blk Show info on block 'blk'.
If --ls is used and the block is the first block
of a directory, then the filters apply to entries
of the directory.
If you do not use --ls then --print is implied.
--histogram=[atime|ctime|mtime|dtime|group]
Generate a histogram based on the given specs.
Using atime, ctime or mtime will change the
meaning of --after and --before to those times.
--journal-block jblk Show info on journal block 'jblk'.
--journal-transaction seq
Show info on transaction with sequence number 'seq'.
--dump-names Write the path of files to stdout.
This implies --ls but suppresses it's output.
--search-start str Find blocks that start with the fixed string 'str'.
--search str Find blocks that contain the fixed string 'str'.
--search-inode blk Find inodes that refer to block 'blk'.
--search-zeroed-inodes Return allocated inode table entries that are zeroed.
--inode-dirblock-table dir
Print a table for directory path 'dir' of directory
block numbers found and the inodes used for each file.
--show-journal-inodes ino
Show copies of inode 'ino' still in the journal.
--restore-inode ino[@seqnr][,ino[@seqnr],...]
Restore the file(s) with known inode number 'ino'.
The restored files are created in ./RESTORED_FILES/
with their inode number as extension (ie, inode.12345).
If '@seqnr' is provided then (only) the journal entry
with that sequence number is used, otherwise the latest
entry is used (if any). You can use that in the case a
a file was overwritten or truncated, rather than deleted.
--restore-file 'path' [--restore-file 'path' ...]
Will restore file 'path'. 'path' is relative to the
root of the partition and does not start with a '/' (it
must be one of the paths returned by --dump-names).
The restored directory, file or symbolic link is
created in the current directory as 'RESTORED_FILES/path'.
--restore-all As --restore-file but attempts to restore everything.
The use of --after is highly recommended because the
attempt to restore very old files will only result in
them being hard linked to a more recently deleted file
and as such polute the output.
--show-hardlinks Show all inodes that are shared by two or more files.

推荐阅读
  • CentOS 7 磁盘与文件系统管理指南
    本文详细介绍了磁盘的基本结构、接口类型、分区管理以及文件系统格式化等内容,并提供了实际操作步骤,帮助读者更好地理解和掌握 CentOS 7 中的磁盘与文件系统管理。 ... [详细]
  • 本文详细介绍如何使用arm-eabi-gdb调试Android平台上的C/C++程序。通过具体步骤和实用技巧,帮助开发者更高效地进行调试工作。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • 1.如何在运行状态查看源代码?查看函数的源代码,我们通常会使用IDE来完成。比如在PyCharm中,你可以Ctrl+鼠标点击进入函数的源代码。那如果没有IDE呢?当我们想使用一个函 ... [详细]
  • CentOS7源码编译安装MySQL5.6
    2019独角兽企业重金招聘Python工程师标准一、先在cmake官网下个最新的cmake源码包cmake官网:https:www.cmake.org如此时最新 ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • 掌握Linux:基础命令入门
    本章节深入浅出地介绍了Linux系统中的基本命令操作,帮助读者快速上手并理解其核心功能。 ... [详细]
  • 解决Linux系统中pygraphviz安装问题
    本文探讨了在Linux环境下安装pygraphviz时遇到的常见问题,并提供了详细的解决方案和最佳实践。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 在哈佛大学商学院举行的Cyberposium大会上,专家们深入探讨了开源软件的崛起及其对企业市场的影响。会议指出,开源软件不仅为企业提供了新的增长机会,还促进了软件质量的提升和创新。 ... [详细]
  • CMake跨平台开发实践
    本文介绍如何使用CMake支持不同平台的代码编译。通过一个简单的示例,我们将展示如何编写CMakeLists.txt以适应Linux和Windows平台,并实现跨平台的函数调用。 ... [详细]
  • 在Linux系统中配置并启动ActiveMQ
    本文详细介绍了如何在Linux环境中安装和配置ActiveMQ,包括端口开放及防火墙设置。通过本文,您可以掌握完整的ActiveMQ部署流程,确保其在网络环境中正常运行。 ... [详细]
  • 如何配置Unturned服务器及其消息设置
    本文详细介绍了Unturned服务器的配置方法和消息设置技巧,帮助用户了解并优化服务器管理。同时,提供了关于云服务资源操作记录、远程登录设置以及文件传输的相关补充信息。 ... [详细]
  • 在Ubuntu 16.04 LTS上配置Qt Creator开发环境
    本文详细介绍了如何在Ubuntu 16.04 LTS系统中安装和配置Qt Creator,涵盖了从下载到安装的全过程,并提供了常见问题的解决方案。 ... [详细]
author-avatar
个信2602926933
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有