不小心刪掉了 mypasswd
嚇死我了!今早做 wen10 的 gpg 簽證時,生成了一個 mykey 的檔案。然後我手快將 rm myk + Tab Enter 打成了 rm myp + Tab Enter ,然後順利刪掉了 mypasswd 這個檔案!

Oh. My. GOD!!!!

怎麼辦啊,幹快去找找備份,可是不知道備份是多少天之前,而且才剛剛加入了新的 gpg 密碼……

——居然,沒有備份!

鳴哇啊 T^T……這要我怎麼辦啊,我不知道裏面放了多少密碼欸,有辦法救回來嗎?

( 五分鐘後 )

不要動!現在最好不要做任何動作,檔案的資料應該還在同一個地方,只是檔案室的案引記錄被刪掉了,只要我能找出這個索引,理論上應該還可以救回來的。

跟隨這則文章debugfs 顯示著 0 deleted inodes found. ……沒救了嗎?

extundelete

這個好像能用?
[root@localhost penguin]# extundelete --restore-file /home/penguin/mypasswd /dev/vda3
NOTICE: Extended attributes are not restored.
WARNING: EXT3_FEATURE_INCOMPAT_RECOVER is set.
The partition should be unmounted to undelete any files without further data loss.
If the partition is not currently mounted, this message indicates
it was improperly unmounted, and you should run fsck before continuing.
If you decide to continue, extundelete may overwrite some of the deleted
files and make recovering those files impossible.  You should unmount the
file system and check it with fsck before using extundelete.
Would you like to continue? (y/n)
y
Loading filesystem metadata ... 120 groups loaded.
Loading journal descriptors ... 31542 descriptors loaded.
Successfully restored file /home/penguin/mypasswd
哦哦~救回來了!謝天謝地!現在得趕快設定好備份,再加一道警告防禦誤刪檔案好了。
Tag(s): bash
Profile picture
斟酌 鵬兄
Thu Dec 08 2016 04:12:25 GMT+0000 (Coordinated Universal Time)
Last modified: Thu Dec 08 2016 04:12:29 GMT+0000 (Coordinated Universal Time)
Comments
No comments here.
Do you even comment?
website: 
Not a valid website
Invalid email format
Please enter your email
*Name: 
Please enter a name
Submit
抱歉,Google Recaptcha 服務被牆掉了,所以不能回覆了