extundelete误删除恢复工具(ext4文件系统)

工具安装:

[root@localhost ~]# yum -y install e2fsprogs-devel e2fsprogs-libs
[root@localhost ~]# tar -xf extundelete-0.2.4.tar.bz2 
[root@localhost extundelete-0.2.4]# ./configure && make && make install

extundelete命令常用选项:

--inode 数值 	       #指定从inode号多少开始显示
-restore-file 文件名    #恢复误删除的某个文件
-restore-all           #恢复所有文件
-after dtime           #在某个时间点之后删除的文件
-before dtime          #在某个时间点之前删除的文件

模拟删除:

[root@localhost ~]# rm -rf recover_test

第一时间卸载误删除文件所在的分区:

[root@localhost ~]# umount /dev/sdb1

使用extundelete工具恢复文件:

[root@localhost ~]# extundelete --restore-file recover_test /dev/sdb1
NOTICE: Extended attributes are not restored.
Loading filesystem metadata ... 40 groups loaded.
Loading journal descriptors ... 11 descriptors loaded.
Successfully restored file recover_test

恢复成功后,误删除的文件存放在RECOVERED_FILES的目录中:

[root@localhost ~]# ls
anaconda-ks.cfg  extundelete-0.2.4  install.log  install.log.syslog  RECOVERED_FILES
[root@localhost RECOVERED_FILES]# ls
recover_tes
当误删除文件是在/分区上时:
<1> 误删除文件后,及时进入单用户模式(重启或init 1直接切换)
<2> 修改/etc/fstab文件设置为只读ro
<3> extundelete --restore-file recover_test  


extundelete工具不支持xfs文件系统

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值