恢复 $HOME 目录中的单个文件

xra*_*alf 7 data-recovery

我不小心跑了rm -r /home/xralf,很快就用Ctrl+杀死了它C

似乎一切正常,但我注意到对我.vimrc来说很重要的 my 丢失了。

我试过命令:

$ extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
extundelete: failed to read-only open device "/dev/sda5": Error code 13
Run Code Online (Sandbox Code Playgroud)

要恢复文件,但似乎有问题,我需要卸载设备。

它安装在这里: /dev/sda5 on /home type ext4 (rw)

  • 有没有可能恢复文件.vimrc
  • 你会如何重新安装它?有问题我需要$HOME 目录。

我无法使用LiveCD,因为它现在在我的笔记本电脑上丢失了。USB我的笔记本电脑也不支持从启动。

使用以下命令运行命令sudo

sudo extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
WARNING: 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) 
Run Code Online (Sandbox Code Playgroud)

Kyl*_*nes 6

Error code 13EACCES- 访问冲突。

您无权从设备读取。以超级用户身份运行命令,即 use sudo extundelete ...