您現(xiàn)在的位置:首頁 >關(guān)于我們 >行業(yè)新聞 >如何正確使用數(shù)據(jù)恢復(fù)軟件恢復(fù)誤刪數(shù)據(jù)

如何正確使用數(shù)據(jù)恢復(fù)軟件恢復(fù)誤刪數(shù)據(jù)

時(shí)間:2016年3月3日
如何正確使用數(shù)據(jù)恢復(fù)軟件恢復(fù)誤刪數(shù)據(jù)
一、單個(gè)文件使用數(shù)據(jù)恢復(fù)軟件的過程
1.卸載磁盤分區(qū)
在將數(shù)據(jù)誤刪除后,立刻需要做的就是卸載這塊磁盤分區(qū):
[root@cloud1 data]# cd /mnt  
[root@cloud1 mnt]# umount /data
2.查詢可恢復(fù)的數(shù)據(jù)信息
通過extundelete命令可以查詢/dev/sdc1分區(qū)可恢復(fù)的數(shù)據(jù)信息:
[root@cloud1 /]# extundelete  /dev/sdc1  --inode 2  
......  
File name                                       | Inode number | Deleted status  
.                                                 2  
..                                                2  
lost+found                                        11             Deleted  
passwd                                            49153          Deleted  
test                                              425985         Deleted  
ganglia-3.4.0                                     245761         Deleted
根據(jù)上面的輸出,標(biāo)記為Deleted狀態(tài)的是已經(jīng)刪除的文件或目錄。同時(shí)還可以看到每個(gè)已刪除文件的inode值,接下來就可以恢復(fù)文件了。
3. 恢復(fù)單個(gè)文件
執(zhí)行如下命令開始恢復(fù)文件:
[root@cloud1 /]# extundelete  /dev/sdc1  --restore-file passwd  
Loading filesystem metadata ... 40 groups loaded.  
Loading journal descriptors ... 54 descriptors loaded.  
Successfully restored file passwd  
[root@cloud1 /]# cd RECOVERED_FILES/  
[root@cloud1 RECOVERED_FILES]# ls  
passwd  
[root@cloud1 RECOVERED_FILES]# md5sum  passwd  
0715baf8f17a6c51be63b1c5c0fbe8c5  passwd
extundelete恢復(fù)單個(gè)文件的參數(shù)是“--restore-file”,這里需要注意的是,“--restore-file”后面指定的是恢復(fù)文件路徑,這個(gè)路徑是文件的相對(duì)路徑。相對(duì)路徑是相對(duì)于原來文件的存
儲(chǔ)路徑而言的,比如,原來文件的存儲(chǔ)路徑是/data/passwd,那么在參數(shù)后面直接指定passwd文件即可,如果原來文件的存儲(chǔ)路徑是/data/test/mytest.txt,那么在參數(shù)后面通
過“test/mytest.txt”指定即可。
在文件恢復(fù)成功后,extundelete命令默認(rèn)會(huì)在執(zhí)行命令的當(dāng)前目錄下創(chuàng)建一個(gè)RECOVERED_FILES目錄,此目錄用于存放恢復(fù)的文件,所以執(zhí)行extundelete命令的當(dāng)前目錄必須是可寫的。
二、單個(gè)文件使用數(shù)據(jù)恢復(fù)軟件的過程
1.卸載磁盤分區(qū)
2.查詢可恢復(fù)的數(shù)據(jù)信息(流程大致如上)
3.恢復(fù)單個(gè)文件
執(zhí)行如下命令開始恢復(fù)文件:
[root@cloud1 mnt]# extundelete  /dev/sdc1  --restore-directory /ganglia-3.4.0  
Loading filesystem metadata ... 40 groups loaded.  
Loading journal descriptors ... 247 descriptors loaded.  
Searching for recoverable inodes in directory /ganglia-3.4.0 ...  
781 recoverable inodes found.  
Looking through the directory structure for deleted files ...  
4 recoverable inodes still lost.  
[root@cloud1 mnt]# ls  
RECOVERED_FILES  
[root@cloud1 mnt]# cd RECOVERED_FILES/  
[root@cloud1 RECOVERED_FILES]# ls  
ganglia-3.4.0


Copyright© 2004-2020 河南海騰電子技術(shù)有限公司 版權(quán)所有   經(jīng)營性ICP/ISP證 備案號(hào):B1-20180452   豫公網(wǎng)安備 41019702002018號(hào)    電子營業(yè)執(zhí)照