实验题·ext文件恢复===」需要进行解挂载

    技术2025-08-05  10

    实验题·ext文件恢复

    实验环境

    CentOS 7.6

    extundelete-0.2.4.tar

    需求分析

    挂载一个新的磁盘来实现ext文件恢复

    通过extundelete-0.2.4.tar这个软件包来进行恢复

    实验步骤

    [root@localhost ~]# fdisk /dev/sdb #进行分区 [root@localhost ~]# mkfs.ext4 /dev/sdb1 #格式化成ext格式的磁盘 [root@localhost ~]# mount /dev/sdb1 /opt #挂载磁盘 [root@localhost ~]# cd /opt #进入磁盘里面 [root@localhost opt]# ll #查看你磁盘里面的文件 总用量 16 drwx------. 2 root root 16384 7月 4 14:12 lost+found [root@localhost opt]# touch {1..5}.txt #新建一些文件进去 [root@localhost opt]# ll #查看新建好的文件 总用量 16 -rw-r--r--. 1 root root 0 7月 4 14:14 1.txt -rw-r--r--. 1 root root 0 7月 4 14:14 2.txt -rw-r--r--. 1 root root 0 7月 4 14:14 3.txt -rw-r--r--. 1 root root 0 7月 4 14:14 4.txt -rw-r--r--. 1 root root 0 7月 4 14:14 5.txt drwx------. 2 root root 16384 7月 4 14:12 lost+found [root@localhost opt]# cd /mnt #将软件包放入linux系统里面的/mnt目录下 [root@localhost mnt]# ll #查看软件包 总用量 108 -rw-r--r--. 1 root root 108472 7月 4 14:16 extundelete-0.2.4.tar.bz2 [root@localhost mnt]# tar jxvf extundelete-0.2.4.tar.bz2 #解压软件包 [root@localhost mnt]# cd extundelete-0.2.4 #进入该目录进行编译安装 [root@localhost extundelete-0.2.4]# ll 总用量 352 -rw-r--r--. 1 zhao zhao 3283 11月 3 2012 acinclude.m4 -rw-r--r--. 1 zhao zhao 0 1月 4 2013 aclocal.m4 -rwxr-xr-x. 1 zhao zhao 372 12月 31 2012 autogen.sh -rw-r--r--. 1 zhao zhao 4780 1月 4 2013 config.h.in -rwxr--r--. 1 zhao zhao 231557 1月 4 2013 configure -rw-r--r--. 1 zhao zhao 5357 12月 31 2012 configure.ac -rwxr-xr-x. 1 zhao zhao 20334 1月 4 2013 depcomp -rwxr-xr-x. 1 zhao zhao 13998 1月 4 2013 install-sh -rw-r--r--. 1 zhao zhao 17987 11月 3 2012 LICENSE -rw-r--r--. 1 zhao zhao 916 12月 31 2012 Makefile.am -rw-r--r--. 1 zhao zhao 23644 1月 4 2013 Makefile.in -rwxr-xr-x. 1 zhao zhao 10346 1月 4 2013 missing -rw-r--r--. 1 zhao zhao 1666 11月 3 2012 README drwxr-xr-x. 2 zhao zhao 220 1月 4 2013 src [root@localhost extundelete-0.2.4]# yum -y install gcc gcc-c++ make [root@localhost extundelete-0.2.4]# ./configure [root@localhost extundelete-0.2.4]# make && makeinstall [root@localhost opt]# rm -rf /opt/* #删除磁盘下的所有数据 [root@localhost ~]# umount /opt #解挂载 [root@localhost ~]# extundelete /dev/sdb1 --restore-all#进行恢复数据 然后就可以再当前目录下可以看到RECOVERED_FILES
    Processed: 0.013, SQL: 9