一:搭建模拟环境
[root@pan-T ~]# fdisk l#/dev/sda4为新添加的硬盘
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00009fb4
Device BootStartEndBlocksIdSystem
/dev/sda1*1256204800083Linux
Partition 1 does not end on cylinder boundary.
/dev/sda225615301024000083Linux
/dev/sda315301791209715282Linux swap / Solaris
/dev/sda417912052209651483Linux
[root@pan-T ~]# mkfs.ext4 /dev/sda4#格式化硬盘
[root@pan-T ~]# mkdir /tmp/sda4 #创建挂载点
[root@pan-T ~]# mount /dev/sda4 /tmp/sda4/ #挂载新硬盘
[root@pan-T ~]#cp -r {/etc/hosts,/etc/passwd} /tmp/sda4/
[root@pan-T ~]#cd /tmp/sda4/
[root@pan-T sda4]# mkdir -p a/b/c/d
[root@pan-T sda4]#cp /etc/passwd . /a
[root@pan-T sda4]#cp /etc/passwd ./a/b
[root@pan-T sda4]#cp /etc/passwd ./a/b/c
[root@pan-T sda4]#cp /etc/passwd ./a/b/c/d
[root@pan-T sda4]#mkdir /tmp/back
[root@pan-T sda4]#cp r ./* /tmp/back
[root@pan-T sda4]#rm rf ./*
[root@pan-T sda4]#cd
[root@pan-T ~]#umount /tmp/sda4
[root@pan-T ~]#
二、安装恢复软件包extundelete包
[root@pan-T ~]#tar -jxvf extundelete-0.2.4.tar.bz2 -C extundelete #解压缩到extundelete目录中
[root@pan-T ~]#cd /root/extundelete/extundelete-0.2.4
[root@pan-T extundelete-0.2.4]# yum -y install e2fsprogs e2fsprogs-devel
[root@pan-T extundelete-0.2.4]#./configure
[root@pan-T extundelete-0.2.4]#make && make install
三、通过extundelete软件恢复测试文件
[root@pan-T extundelete-0.2.4]#cd
[root@pan-T ~]#cd /root/test #切换到已经创建好的test目录中进行恢复操作
[root@pan-T ~]#extundelete /dev/sda4 --inode 2 #通过inode查看被删除的文件
[root@pan-T test]#extundelete /dev/sda4 restore-all #恢复所有文件
[root@pan-T test]#extundelete /dev/sda4 restore-inode 12 #通过inode号来恢复文件
[root@pan-T test]#extundelete /dev/sda4 restore-file passwd #通过file文件名来恢复文件
var kevent = 'onabort|onblur|onchange|onclick|ondblclick|onerror|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onresize|onselect|onsubmit|onunload'; var aevent = kevent.split('|'); jQuery('.showContent img').each(function(){ var nimg = this; jQuery.each(aevent, function(i, n){ if (n!='onload') { jQuery(nimg).attr(n, ''); } else { if (jQuery(nimg).attr(n) != 'if(this.width>650) this.width=650;') { jQuery(nimg).attr(n, ''); } } }); });
0人
|
了这篇文章 |