亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Linux下誤刪文件應急恢復

發布時間:2020-08-11 14:27:37 來源:ITPUB博客 閱讀:195 作者:colin_cwc 欄目:關系型數據庫
Linux下誤刪文件應急恢復
 
  維護中難免遇到狀態不好的時候或者新人操作不當,一個rm –f *刪除了大量的文件,導致生產重大故障,這個時候我們需要考慮文件恢復,為了能夠應對這種情況,在這里討論一個網上常用的恢復工具:extundelete,該工具支持ext3或者ext4.
1     安裝
首先安裝好準備包:
[root@redhat1 home]# yum install e2fs*                    --安裝extundelete軟件的依賴包
[root@redhat1 home]# rpm -aq |grep e2fs                --檢查軟件包是否安裝
e2fsprogs-devel-1.41.12-14.el6.i686
e2fsprogs-libs-1.41.12-14.el6.i686
e2fsprogs-1.41.12-14.el6.i686
 
確認gcc編譯工具齊全
gcc+
 
開始安裝
Linux下誤刪文件應急恢復
tar xvf  extundelete-0.2.4.tar.bz2
. /configure
make
make install
 
2     使用方法
root@localhost bin]# ./extundelete
No action specified; implying --superblock.
./extundelete: Missing device name.
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 ./RECOVERED_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 '/'
                         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-directory 'path'
                         Will restore directory 'path'. 'path' is relative to the
                         root directory of the file system.  The restored
                         directory is created in the output directory as 'path'.
  --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.
  --log 0                Make the program silent.
  --log filename         Logs all messages to filename.
--log D1=0,D2=filename   Custom control of log messages with comma-separated
   Examples below:       list of options.  Dn must be one of info, warn, or
   --log info,error      error.  Omission of the '=name' results in messages
   --log warn=0          with the specified level to be logged to the console.
   --log error=filename  If the parameter is '=0', logging for the specified
                         level will be turned off.  If the parameter is
                         '=filename', messages with that level will be written
                         to filename.
   -o directory          Save the recovered files to the named directory.
                         The restored files are created in a directory
                         named 'RECOVERED_FILES/' by default.
./extundelete: Error parsing command-line options.
 
3     實驗恢復
創建目錄
/boot/test
 
創建測試文件
[root@localhost test]# ls -rlt
total 12
-rw-r--r--. 1 root root 21 Oct  9 17:11 1111111111111112.txt
-rw-r--r--. 1 root root 13 Oct  9 17:11 1111111111111111.txt
-rw-r--r--. 1 root root 24 Oct  9 17:11 1111111111111113.txt
 
刪除文件
rm –rf *
 
4     恢復
cd /usr/local/bin/
 
查看可恢復的文件和目錄。
./extundelete /dev/sda1 --ls --inode 2
 
直接恢復文件到當前目錄。
./extundelete  /dev/sda1 --restore-all
查看當前目錄:RECOVERED_FILES 就可以看到刪除的文件。
 
直接恢復指定的文件
./extundelete /dev/sda1  --restore-file vmlinuz-2.6.32-642.el6.x86_64
 
直接恢復制定的文件夾
./extundelete /dev/sda1  --restore-directory test
 
網上可參考學習
https://my.oschina.net/fufangchun/blog/176550
 
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

紫阳县| 静海县| 汉寿县| 昆山市| 南汇区| 磴口县| 塔城市| 克拉玛依市| 共和县| 巨野县| 尼勒克县| 巴东县| 定襄县| 雷波县| 余江县| 巴楚县| 民权县| 华亭县| 七台河市| 清远市| 沙河市| 铜陵市| 万宁市| 景泰县| 建瓯市| 久治县| 普兰县| 红河县| 芦山县| 垫江县| 潮州市| 上犹县| 望江县| 清河县| 迭部县| 新丰县| 信丰县| 营山县| 巢湖市| 英吉沙县| 临泉县|