Linux Ext三、Ext4誤刪文件恢復 extundelete

使用linux不免遇到誤刪文件的狀況,使用extundlete 便可恢復誤刪文件php


記下操做流程:
1. 安裝Linux數據恢復軟件extundelete
須要依賴兩個包
node

sudo aptitude install e2fsprogs e2fslibs-devlinux

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

快速下載: download extundeletespa

編譯三部曲.net

./configure
make
sudo make install
rest

2.若是分區已經掛載,先umount,而且在將要恢復的地方查看空間大小orm

df -h ./ci

若是你要恢復的是根目錄或者系統目錄就只有拿硬盤掛到另一臺電腦上操做了。get


使用方法:

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

$ 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目錄下。

相關文章
相關標籤/搜索