linux作為企業級伺服器,資料的安全性至關重要,任何資料德爾丟失和誤刪都是不可容忍的!最近我接觸到一款軟體-ext3grep,它可以恢復誤刪的資料,下面簡單講解一下這個軟體。
ext3grep的恢復原理
利用ext3grep恢復檔案時並不依賴特定文字格式。首先ext3grep通過檔案系統的root inode(根目錄的inode一般為2)來獲取當前檔案系統下所有檔案的資訊,包括存在的和已經刪除的檔案,這些資訊包括檔名和inode。然後利用inode資訊結合日誌去查詢該inode所在的block位置,包括直接塊、間接塊等資訊。最後利用dd命令將這些資訊備份出來,從而恢復資料檔案。
ext3grep的安裝
ext3grep官方**:
所需的系統相關包如下:
[root@localhost ~]#rpm -qa | grep e2fsprogs以上三個都必須安裝,不然後面的安裝會出現問題。e2fsprogs-libs-1.39-8.el5
e2fsprogs-1.39-8.el5
e2fsprogs-devel-1.39-8.el5
下面進入編譯安裝階段,過程如下:
[root@localhost /opt]# tar zxvf ext3grep-0.10.2.tar.gz實戰ext3grep恢復檔案[root@localhost ext3grep-0.10.2]# ./configure
[root@localhost ext3grep-0.10.2]# make
[root@localhost ext3grep-0.10.2]# make install
[root@localhost ext3grep-0.10.2]# ext3grep -v
running ext3grep version 0.10.2
模擬資料誤刪環境
下面通過乙個模擬環境,詳細介紹使用ext3grep恢復資料檔案的過程:
[root@localhost ~]# mkdir /disk[root@localhost ~]# mkdir /mydata
[root@localhost ~]# cd /mydata
[root@localhost mydata]# dd if=/dev/zero of=/mydata/disk1 count=102400
[root@localhost mydata]#mkfs.ext3 /mydata/disk1
[root@localhost mydata]#mount -o loop /mydata/disk1 /disk[root@localhost mydata]#cd /disk
[root@localhost disk]# cp /etc/profile /disk
[root@localhost disk]# cp /boot/initramfs-2.6.32-220.el6.i686.img /disk
[root@localhost disk]#echo"i am archy" > ext3grep.txt
[root@localhost disk]#mkdir /disk/ext3grep
[root@localhost disk]#cp /etc/hosts /disk/ext3grep
[root@localhost disk]#ls -al
[root@localhost disk]#md5sum profile查詢資料恢復資訊[root@localhost disk]#md5sum initramfs-2.6.32-220.el6.i686.img
[root@localhost disk]#md5sum ext3grep.txt
[root@localhost disk]#rm -rf /disk/*
[root@localhost /opt]# umount /disk
執行如下命令,查詢需要恢復的資料資訊:
[root@localhost /opt]# ext3grep /mydata/disk1 --ls --inode 2
這條命令主要用於掃瞄當前檔案系統下所有的資訊,包括存在的和已刪除的檔案,其中含有d標識的就是檔案已被刪除。通過以下命令可以獲取檔案要恢復的路徑資訊:
[root@localhost /opt]# ext3grep /mydata/disk1 --dump-names
恢復刪除資料
單個檔案恢復命令如下:
[root@localhost /opt]# ext3grep /mydata/disk1 --restore-file ext3grep.txt
恢復的檔案存放在/opt/restored_files目錄下。
恢復所有已刪除資料的命令如下:
[root@localhost /opt]# ext3grep /mydata/disk1 --reatore-all
ext3檔案系統反刪除利器 ext3grep
linux作為企業級伺服器,資料的安全性至關重要,任何資料德爾丟失和誤刪都是不可容忍的!最近我接觸到一款軟體 ext3grep,它可以恢復誤刪的資料,下面簡單講解一下這個軟體。ext3grep的恢復原理 利用ext3grep恢復檔案時並不依賴特定文字格式。首先ext3grep通過檔案系統的root ...
ext3檔案系統恢復誤刪除檔案
2.編譯安裝 configure make make install ext3grep 是否有資訊 3.e2fsprogs的安裝 rpm qa grep e2fsprogs 1 先安裝ext3grep軟體 wget tar zxvf ext3grep 0.10.1.tar.gz cd ext3gre...
Ext2與Ext3檔案系統的區別
ext2 是 gnu linux 系統中標準的檔案系統,其特點為訪問檔案的效能極好,對於中小型的檔案更顯示出優勢,這主要得利於其簇快取層的優良設計。其單一檔案大小與檔案系統本身的 容量上限與檔案系統本身的簇大小有關,在一般常見的 x86 電腦系統中,簇最大為 4kb,則單一檔案大小上限為 2048g...