Linux Ext3、Ext4誤刪檔案恢複 extundelete

來源:互聯網
上載者:User

標籤:

使用linux難免遇到誤刪檔案的情況,使用extundlete 即可恢複誤刪檔案


記下操作流程:
1. 安裝Linux資料恢複軟體extundelete
需要依賴兩個包

sudo aptitude install e2fsprogs e2fslibs-dev

下載頁面http://extundelete.sourceforge.net/

快速下載: download extundelete

編譯三部曲

./configure
make
sudo make install

2.如果分區已經掛載,先umount,並且在將要恢複的地方查看空間大小

df -h ./

如果你要恢複的是根目錄或者系統目錄就只有拿硬碟掛到另外一台電腦上操作了。


使用方法:

---------------------------------------------

$ extundelete --help

Usage: extundelete [options] [--] device-file

Options:

  --version, -[vV]       Print version and exit successfully.

  --help,                Print this help and exit successfully.

  --superblock           Print contents of superblock in addition to the rest.

                         If no action is specified then this option is implied.

  --journal              Show content of journal.

  --after dtime          Only process entries deleted on or after ‘dtime‘.

  --before dtime         Only process entries deleted before ‘dtime‘.

Actions:

  --inode ino            Show info on inode ‘ino‘.

  --block blk            Show info on block ‘blk‘.

  --restore-inode ino[,ino,...]

                         Restore the file(s) with known inode number ‘ino‘.

                         The restored files are created in ./RESTORED_FILES

                         with their inode number as extension (ie, file.12345).

  --restore-file ‘path‘  Will restore file ‘path‘. ‘path‘ is relative to root

                         of the partition and does not start with a ‘/‘ (it

                         must be one of the paths returned by --dump-names).

                         The restored file is created in the current

                         directory as ‘RECOVERED_FILES/path‘.

  --restore-files ‘path‘ Will restore files which are listed in the file ‘path‘.

                         Each filename should be in the same format as an option

                         to --restore-file, and there should be one per line.

  --restore-all          Attempts to restore everything.

  -j journal             Reads an external journal from the named file.

  -b blocknumber         Uses the backup superblock at blocknumber when opening

                         the file system.

  -B blocksize           Uses blocksize as the block size when opening the file

                         system.  The number should be the number of bytes.


恢複分區所有的檔案
# extundelete /dev/sda1 –-restore-all

恢複單個檔案
# extundelete /dev/sda3 --restore-file /root/aaa.file

恢複單個目錄
# extundelete /dev/sdb1 --restore-directory /root/aaa

恢複的檔案在當前位置的RECOVERED_FILES目錄下。


Linux Ext3、Ext4誤刪檔案恢複 extundelete

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.