天天看點

linux恢複檔案

linux恢複檔案

一.下載下傳安裝extundelete

2.解壓tar jvxf extundelete.tar.bz2

3.編譯安裝 ./configure  make && make install

4.extundelte用法

這裡說下我要用到的參數 src/extundelete --help

第一個是 恢複目錄 path為路徑後面跟要恢複那個目錄的路徑

第二個是 恢複所有

第三個是 恢複dtime這個時間戳以後删除的檔案

第四個是恢複這個時間戳以前删除的檔案  (這裡說下,卡時間恢複是非常好用的參數。你可以指定恢複那個時間到那個時間之間的資料)

基本這幾個選項就夠恢複了,當然還有--restore-files 參數來恢複單個檔案。

二.将分區挂在為隻讀

1.mount -o remount,ro 分區選項

三.測試

extundelete /dev/mapper/vg_vbok-opt --after /1381740180 --before 1381741080 --restore-directory 1

将在RECOVERIED_FILES裡面找到要恢複的檔案

最後将分區重新挂在為可讀寫

mount 分區 -o rw,remount

本文轉自 luoguo 51CTO部落格,原文連結:http://blog.51cto.com/luoguoling/1349146

繼續閱讀