系統文件誤刪除恢復

wget http://nchc.dl.sourceforge.net/project/extundelete/extundelete/0.2.4/extundelete-0.2.4.tar.bz2

tar -jxvf extundelete-0.2.4.tar.bz2 

yum install e2fsprogs* e2fslibs* gcc gcc-c++ gcc-g77 -y

cd extundelete-0.2.4

./configure --prefix=/usr/local/extundelete

make

make install

[root@vm40 home]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/vda3        51G  3.5G   45G   8% /

tmpfs           1.9G  224K  1.9G   1% /dev/shm

/dev/vda1       194M   34M  151M  19% /boot

/dev/sr0        4.2G  4.2G     0 100% /media/CentOS_6.5_Final

/dev/sr0        4.2G  4.2G     0 100% /mnt

/dev/vda2        97G  188M   92G   1% /u01

[root@vm40 home]# cp /etc/passwd /u01/

[root@vm40 home]# sync

[root@vm40 home]# rm -f /u01/passwd 

[root@vm40 home]# sync

[root@vm40 home]# umount /u01

[root@vm40 home]# /usr/local/extundelete/bin/extundelete --restore-file passwd /dev/vda2

NOTICE: Extended attributes are not restored.

Loading filesystem metadata ... 782 groups loaded.

Loading journal descriptors ... 82 descriptors loaded.

Successfully restored file passwd

[root@vm40 home]# ls

oracle  RECOVERED_FILES

[root@vm40 home]# ls RECOVERED_FILES/

passwd

[root@vm40 home]# rm -fr RECOVERED_FILES/

[root@vm40 home]# mount /dev/vda2 /u01/

[root@vm40 home]# sync


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章