欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CentOS系統(tǒng)恢復(fù)誤刪除文件的方法

  發(fā)布時間:2015-11-02 16:27:41   作者:佚名   我要評論
這篇文章主要介紹了CentOS系統(tǒng)恢復(fù)誤刪除文件的方法,需要的朋友可以參考下

CentOS系統(tǒng)中,當誤刪除了文件后,進行以下幾步操來恢復(fù)文件。

1、關(guān)掉所有的服務(wù)

當發(fā)現(xiàn)誤刪除文件時,為了盡可能的恢復(fù)數(shù)據(jù),先要關(guān)掉所有的正在進行的服務(wù),不要再進行數(shù)據(jù)的寫入,要不然恢復(fù)的概率那就低了。我們可以直接

# killall 進程名

或者

# kill -9 pid
然后把誤刪除的文件所在分區(qū),重新掛載成只讀的
# mount -o ro /dev/sdb  /data/

2、安裝extundelete工具

# yum install -y e2fsprogs*      //安裝依賴包
# 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
# cd extundelete-0.2.4
# ./configure --prefix=/usr/local/extundelete
# make && make install

3、驗證是否安裝成功

# cd /usr/local/extundelete/bin
# ./extundelete -v
---------------------
extundelete version 0.2.4
libext2fs version 1.41.12
Processor is little endian.
---------------------

4、恢復(fù)數(shù)據(jù)

實例:假如我們誤刪除文件為 test.txt,所在分區(qū)為/dev/sdb。
1)掃描文件
# /usr/local/extundelete/bin/extundelete  /dev/sdb --inode 2    //掃描哪些文件被刪除了
2)恢復(fù)文件

# /usr/local/extundelete/bin/extundelete --restore-file test.txt /dev/sdb

3)查看文件
恢復(fù)的文件在當前目錄下的  RECOVERED_FILES/ 目錄下 
# ls ./RECOVERED_FILES/ 

可以看到 test.txt 文件。

注意:

--------------------------------------------------------------------------------
如果想恢復(fù)整個分區(qū)上的文件,則可以執(zhí)行以下命令
# /usr/local/extundelete/bin/extundelete --restore-all  /dev/sdb
恢復(fù)后的文件也在  ./RECOVERED_FILES/  目錄下。
--------------------------------------------------------------------------------

5、后續(xù)工作

1)重新掛載該分區(qū)為可寫。
2)備份重要數(shù)據(jù)。
3)覆蓋我們恢復(fù)出來的數(shù)據(jù)。
4)重啟服務(wù)器,恢復(fù)之前關(guān)閉的各種服務(wù)。

相關(guān)文章

最新評論