I was working on my Debian machine few days ago when accidentally I pressed "rm -rf *" in a wrong directory(my main working directory). Well, I lost all the data. And after hunting net for hours, find out that there is no traditional method available for recovering files in ext3 file system.
In Ext2 file system, OS marks the blocks, inode and directory entry associated with the deleted file as unused. It did not use to delete the links, so that other files could still use them. And because of this, recovery of lost files were possible using certain tools like debufs, e2undel, recover, Midnight Commander etc. Giis-gET iT i sAY also claims to recover files from both ext2 and ext3 file system but I don't know it works or not.
In Ext3 file system, when the file is deleted, file size and block addresses in inodes are also deleted. Therefore, its not possible to find out where the file was originally located or more specifically it becomes difficult to track back the inode of the file using debugfs.
But, if you are lucky, file could still be there in your hard drive, though in chunks. Steps you must follow -
- Do not save any file in the same partition in which your deleted files were. This might result in overwriting of occupied blocks of deleted files.
- Mount another drive to the system(if not mounted) to save the dump.
- Find the Partition in which deleted files was there using `mount -t`
- If you know certain lines from the file, which are more or less unique to the file you deleted, then it might be useful. In my case, my Perl code began with "package rankSentences;", so I used that as the identifying text.
- Try the command =>
here,
- -a is for treating text file as if it is binary file.
- -A Number of lines of the dump that you want to extract after the "indentifyingText" (which was "package rankSentences" in my case.
- -B Number of lines before "identifyingText" you want to extract.
If you don't specify "identifyingText" this might result in dump.txt to be very large in size as it will start dumping the data of complete partition to that file.
And ya, be patient, it might take some time depending upon the size of your partition. After running that command you can look for chunks of your deleted file in dump.txt. And if you are lucky, you might find the complete file at one place. :)
--compiled from various sources on net.
4 comments:
rm -rf *??!! What were you thinking?
As I said, I had 10 shells opened. And I accidentally typed that on a wrong shell.
I just lost a file by type rm * instead of cp *. Your post saved my day.
Thanks!
你了解整形有哪些手術?整形外科一定要具有專科證照醫師才是基本要素。隆乳 果凍矽膠是目前市面上最好的材質!
你知道高雄婦產科中誰是不孕症及人工受孕的權威醫師嗎?肉毒桿菌有何功效及效果。
汽車隔熱紙 大樓隔熱紙有何差異?隔熱紙不是係數越高效果就會越佳喔!
你想選擇一位大陸新娘 外籍新娘的話,請進入我的網站也許就是你一生中最好的選擇。
納豆 保健食品要如何選擇呢?
選擇現代生活中最好的運動就是瑜珈,要選擇瑜珈就要先了解瑜珈教室設備、師資及瑜珈教學喔!
高雄瑜珈中的簡善琳瑜珈教室是南部地區最完善的瑜珈教室耶^^
MOTEL就是汽車旅館,它是提供情人溫馨休息住宿的好地方,到台中住宿時別忘了到台中汽車旅館看看喔!!!
台中乳酪蛋糕中禾雅堂乳酪蛋糕提供讓您難忘的蛋糕口味,除了chocolate蛋糕之外還有中秋禮盒多種樣式。
選購服飾潘朵拉日韓服飾有日系服飾、服飾批發、流行服飾及韓國服飾。
張艮輝是這次國民黨雲林立委中希望拜託大家鄉親支持的好立委。
外籍新娘 大陸新娘 越南新娘這些都是一生一世最專業的服務與選擇。
您在尋找墾丁旅遊網資訊嗎?畯富包車旅遊提供高雄旅遊 墾丁旅遊 阿里山旅遊 高雄縣旅遊 高雄租車 高雄計程車 高雄一日遊 機場接送等專業服務。
僑泰裝潢廚具網是全台最大的居家生活廚具網站有廚具 廚具工廠 系統傢俱 傢俱 裝潢 抽油煙機以及系統櫃、歐化廚具 室內設計作品與免費室內設計喔!
網路行銷是網站曝光的首要指標,如何能讓網站排名於首頁是需要靠SEO技術與專業,當然關鍵字的選擇就格外重要了,這是決定瀏覽者在搜尋行銷中唯一的方向。
Post a Comment