实验01:误删除文件恢复
实验目标
把误删除的文件恢复
实验步骤
一、环境准备
1. 确认 /boot 为独立分区(/dev/sda1),删除其中的内核文件
[root@localhost~]# df -hT
/dev/sda1 ext3 99M 12M 82M 13% /boot
......
[root@localhost~]# rm -rf /boot/*
立即卸载 /boot 分区
[root@localhost ~]#mount /dev/sda1
安装extundelete软件
[root@localhost~]# cd /root/Desktop/
[root@localhostDesktop]# tar -jxf extundelete-0.2.4.tar.bz2
[root@localhostDesktop]# cd extundelete-0.2.4
[root@localhostextundelete-0.2.4]# yum -y groupinstall "Development Libraries""Development Tools"
[root@localhostextundelete-0.2.4]# ./configure
[root@localhostextundelete-0.2.4]# make
[root@localhostextundelete-0.2.4]# make install
4.查看/dev/sda1设备上的可恢复文件列表:
[root@localhost ~]#extundelete --inode 2 /dev/sda1
5.恢复/dev/sda1设备上所有可恢复的文件:
extundelete --restore-all /dev/sda1
恢复指定文件:extundelete --restore-file 文件路径 /dev/sda1
恢复指定目录:extundelete --restore-directorie 目录路径 /dev/sda1
extundelete --restore-inode 待恢复文件的节点 /dev/sda1
[root@localhost ~]#extundelete --restore-all /dev/sda1
6.查看 RECOVERED_FILES/ 目录下找回了哪些被删除的文件
[root@localhost~]# cd RECOVERED_FILES/
[root@localhostRECOVERED_FILES]# ls
grub
7,将找回的内核文件拷贝到 /boot/ 目录下
[root@localhost ~]# cp-rf RECOVERED_FILES/* /boot/
转载于:https://blog.51cto.com/pengjc/1553062