http://blog.csdn.net/pang601355182/article/details/7947011
extundelete需要依赖两个包
----e2fsprogs
下载地址:http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/1.41.14/e2fsprogs-1.41.14.tar.gz/download
----e2fsprogs-libs
下载地址:
http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/1.41.14/e2fsprogs-libs-1.41.14.tar.gz/download
----官网:http://www.sourceforge.net/ --> extundelete
下载地址:http://sourceforge.net/projects/extundelete/files/extundelete/0.2.0/extundelete-0.2.0.tar.bz2/download
tar -xjf extundelete-0.2.0.tar.bz2
按e2fsprogs -- e2fsprogs-libs -- extundelete的顺序逐一编译安装:
./configure
make
make install
必须先umount要恢复文件的分区或者把分区改为只读模式,命令:mount –o remout,ro 分区(例如:dev/hda1)
或者
mount -n -r -o remount /db 最好尽快将所在分区修改为只读方式,防止数据被覆盖使用。
# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/sda3 9.9G 6.7G 2.8G 71% /
tmpfs 736M 8.0K 736M 1% /dev/shm
/dev/sda1 97M 25M 68M 27% /boot
/dev/sdb1 20G 6.0G 13G 32% /var/www
假如有个分区/dev/sdb1,我把它挂载在/var/www。
cd /var/www
--------------恢复分区所有被删除的文件:
/usr/local/bin/extundelete /dev/sdb1 --restore-all
所以恢复的文件都会储存在当前目录下的一个名为RECOVERED_FILES目录下。
--------------根据时间:
假如删除的时间大概是2011-7-26 14:30
date -d "Jul 26 14:30" +%s
得出秒数 1234567890
恢复此时间后删除的所有文件
/usr/local/bin/extundelete /dev/sdb1 --after 1234567890 --restore-all
--------------根据文件名:
/usr/local/bin/extundelete /dev/sdb1 --restore-file '1'
--------------根据inode恢复文件。
查看文件inode:ls -i
/usr/local/bin/extundelete /dev/hda3 --restore-inode 222
--------------恢复多个文件:
创建一个文档,在文档输入文件的路径和名字,一个一行。如
restore的内容为:
/test/a
/test2/b
c
/usr/local/bin/extundelete /dev/hda3 --restore-files 'restore'
--------------恢复一个被误删除的文件
extundelete /dev/sda3 --restore-file /an/important/file
--------------恢复一个被误删除的文件夹
extundelete /dev/sda3 --restore-directory /an/important
==================================usr/local/bin/extundelete --help
Usage: /usr/local/bin/extundelete [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.
--journal Show content of journal.
--after dtime Only process entries deleted on or after 'dtime'.
--before dtime Only process entries deleted before 'dtime'.
Actions:
--inode ino Show info on inode 'ino'.
--block blk Show info on block 'blk'.
--restore-inode ino[,ino,...]
Restore the file(s) with known inode number 'ino'.
The restored files are created in ./RESTORED_FILES
with their inode number as extension (ie, file.12345).
--restore-file 'path' Will restore file 'path'. 'path' is relative to root
of the partition and does not start with a '/' (it
must be one of the paths returned by --dump-names).
The restored file is created in the current
directory as 'RECOVERED_FILES/path'.
--restore-files 'path' Will restore files which are listed in the file 'path'.
Each filename should be in the same format as an option
to --restore-file, and there should be one per line.
--restore-all Attempts to restore everything.
-j journal Reads an external journal from the named file.
-b blocknumber Uses the backup superblock at blocknumber when opening
the file system.
-B blocksize Uses blocksize as the block size when opening the file
system. The number should be the number of bytes.
You have new mail in /var/spool/mail/root
相关推荐
安装顺序:e2fsprogs --> e2fsprogs-libs --> extundelete 逐一编译安装 tar xf e2fsprogs-1.41.14.tar.gz cd e2fsprogs-1.41.14 ./configure make && make install cd tar -xf e2fsprogs-libs-1.41.14.tar.gz cd ...
centos7软件恢复工具extundelete的安装与使用-附件资源
本文档适用于rm -rf误操作,包括rm -rf /*将根目录删除恢复重要文件,目前支持ext文件系统。
如果你经常使用rm -rf 误删除文件,那么想找回文件的话,就相当麻烦了。本人遇到过一次,深受教训,建议不用使用rm -rf,否则有一天会后悔的。如果杯具已经发生,那么用extundelete尝试恢复。文件不是很清晰。还可以...
当误操作rm -rf后,需要恢复的磁盘类型是`xfs`,那恭喜你,放弃吧,无法恢复。 如果是ext4的话,则可以进行还原。 extundelete /dev/mapper/centos-home --inode 2 #还原全部文件 extundelete /dev/mapper/centos-...
linux删除文件还原可以分为两种情况,一种是删除以后在进程存在删除信息,一种是删除以后进程都找不到,只有借助于工具还原。这里分别检查介绍下 一,误删除文件进程还在的情况。 这种一般是有活动的进程存在持续...
方法2:把extundelete在虚拟机上(虚拟机系统要和服务器版本一样),提前安装好后再复制到U盘中,把U盘插入服务器,恢复时,恢复的文件要保存到U盘中,(不要让恢复的数据写到/下,那样会覆盖之前删除的文件)
Centos6 ext4文件误删除恢复文件工具 可以用此工具来恢复在系统中误删除的文件或目录 extundelete:支持 ext3 和 ext4 文件系统, 实现原理:通过分析文件系统日志,解析出所有文件的 inode 信息,利用 inode 去查找...
extundelete 可以恢复误删除的文件,适合LINUX操作系统!
作为一名运维人员,保证数据的安全是根本职责,所以在维护系统的时候,要慎之又慎,但是有时难免会出现数据被误删除的情况,在这个时候改如何快速、有效地恢复数据呢?本文我们就来介绍一下Linux系统下常用的几个数据...
extundelete是用于在linux服务器里面恢复删除数据的工具,而对于有些服务器为了安全没有开通外网的访问的情况下,需要用到手动下载依赖包来安装的情况
linux下几个比较好用的工具,全部来源于官方下载。这里分享出来。希望能帮助需要的人,谢谢!